Skip to content
This repository was archived by the owner on Jun 9, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 deletions src/BitWeb/ErrorReporting/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,36 @@
class Configuration extends AbstractConfiguration
{
protected $errorReportingLevel = E_ALL;
protected $emails = array();
protected $emails = [];
protected $subject = 'Errors';
protected $fromAddress = '';
protected $botList = array();
protected $botList = [];
protected $ignore404 = false;
protected $ignoreBot404 = false;
protected $ignorableExceptions = array('ErrorException');
protected $ignorablePaths = array();
protected $ignorableExceptions = ['ErrorException'];
protected $ignorablePaths = [];

/**
* The level of error reporting.
*
* @var integer $errorReportingLevel
*/
public function setErrorReportingLevel($errorReportingLevel) {
public function setErrorReportingLevel($errorReportingLevel)
{
$this->errorReportingLevel = $errorReportingLevel;
}

/**
* @return integer
*/
public function getErrorReportingLevel() {
public function getErrorReportingLevel()
{
return $this->errorReportingLevel;
}

/**
* Defines bots.
*
* @var array $botList
*/
public function setBotList(array $botList)
Expand All @@ -40,7 +44,6 @@ public function setBotList(array $botList)
}

/**
*
* @return array
*/
public function getBotList()
Expand All @@ -50,6 +53,7 @@ public function getBotList()

/**
* An array of emails the error report is sent to.
*
* @var array $emails
*/
public function setEmails(array $emails)
Expand All @@ -67,6 +71,7 @@ public function getEmails()

/**
* Address where the message is sent from.
*
* @var String $fromAddress
*/
public function setFromAddress($fromAddress)
Expand All @@ -84,6 +89,7 @@ public function getFromAddress()

/**
* Exceptions to ignore.
*
* @var array $ignorableExceptions
*/
public function setIgnorableExceptions(array $ignorableExceptions)
Expand All @@ -101,6 +107,7 @@ public function getIgnorableExceptions()

/**
* Are 404 errors ignored?
*
* @var boolean $ignore404
*/
public function setIgnore404($ignore404)
Expand All @@ -118,6 +125,7 @@ public function getIgnore404()

/**
* Are bot 404 errors ignored?
*
* @var boolean $ignoreBot404
*/
public function setIgnoreBot404($ignoreBot404)
Expand All @@ -135,6 +143,7 @@ public function getIgnoreBot404()

/**
* The subject of the message being sent.
*
* @var string $subject
*/
public function setSubject($subject)
Expand All @@ -152,17 +161,19 @@ public function getSubject()

/**
* Paths to ignore.
*
* @var array $ignorablePaths
*/
public function setIgnorablePaths(array $ignorablePaths) {
public function setIgnorablePaths(array $ignorablePaths)
{
$this->ignorablePaths = $ignorablePaths;
}

/**
* @return array
*/
public function getIgnorablePaths() {
public function getIgnorablePaths()
{
return $this->ignorablePaths;
}

}
}
14 changes: 7 additions & 7 deletions src/BitWeb/ErrorReporting/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ class Error
/**
* @var ErrorInfo[]
*/
protected $errors = array();
protected $errors = [];

/**
* @var ErrorMeta
*/
protected $meta;

function __construct($errors, $meta)
public function __construct($errors, $meta)
{
$this->errors = $errors;
$this->meta = $meta;
}

/**
* @param ErrorInfo[] $errors
* @param ErrorInfo[] $errors
* @return self
*/
public function setErrors(array $errors)
Expand All @@ -31,8 +31,8 @@ public function setErrors(array $errors)
}

/**
* @param ErrorInfo $errorInfo
* @return $this
* @param ErrorInfo $errorInfo
* @return self
*/
public function addError(ErrorInfo $errorInfo)
{
Expand All @@ -49,7 +49,7 @@ public function getErrors()
}

/**
* @param ErrorMeta $meta
* @param ErrorMeta $meta
* @return self
*/
public function setMeta(ErrorMeta $meta)
Expand All @@ -65,4 +65,4 @@ public function getMeta()
{
return $this->meta;
}
}
}
17 changes: 5 additions & 12 deletions src/BitWeb/ErrorReporting/ErrorEventManager.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
<?php

namespace BitWeb\ErrorReporting;
/**
* Created by PhpStorm.
* User: priit
* Date: 6/25/14
* Time: 4:07 PM
*/

interface ErrorEventManager {
interface ErrorEventManager
{
public function trigger($event, $target = null, $argv = [], $callback = null);

public function trigger( $event, $target = null, $argv = array(), $callback = null);

public function attach( $event, $function);

}
public function attach($event, $function);
}
13 changes: 6 additions & 7 deletions src/BitWeb/ErrorReporting/ErrorInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace BitWeb\ErrorReporting;


class ErrorInfo
{
/**
Expand All @@ -25,7 +24,7 @@ class ErrorInfo
*/
protected $severity;

function __construct($class, $title, $tracking, $severity = null)
public function __construct($class, $title, $tracking, $severity = null)
{
$this->class = $class;
$this->severity = $severity;
Expand All @@ -34,7 +33,7 @@ function __construct($class, $title, $tracking, $severity = null)
}

/**
* @param string $class
* @param string $class
* @return self
*/
public function setClass($class)
Expand All @@ -52,7 +51,7 @@ public function getClass()
}

/**
* @param string $severity
* @param string $severity
* @return self
*/
public function setSeverity($severity)
Expand All @@ -70,7 +69,7 @@ public function getSeverity()
}

/**
* @param string $title
* @param string $title
* @return self
*/
public function setTitle($title)
Expand All @@ -88,7 +87,7 @@ public function getTitle()
}

/**
* @param string $tracking
* @param string $tracking
* @return self
*/
public function setTracking($tracking)
Expand All @@ -104,4 +103,4 @@ public function getTracking()
{
return $this->tracking;
}
}
}
22 changes: 11 additions & 11 deletions src/BitWeb/ErrorReporting/ErrorMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ErrorMeta
protected $requestDuration;

/**
* @param array $getData
* @param array $getData
* @return self
*/
public function setGetData(array $getData)
Expand All @@ -74,7 +74,7 @@ public function getGetData()
}

/**
* @param string $ip
* @param string $ip
* @return self
*/
public function setIp($ip)
Expand All @@ -92,7 +92,7 @@ public function getIp()
}

/**
* @param array $postData
* @param array $postData
* @return self
*/
public function setPostData(array $postData)
Expand All @@ -110,7 +110,7 @@ public function getPostData()
}

/**
* @param string $referrer
* @param string $referrer
* @return self
*/
public function setReferrer($referrer)
Expand All @@ -128,7 +128,7 @@ public function getReferrer()
}

/**
* @param float $requestDuration
* @param float $requestDuration
* @return self
*/
public function setRequestDuration($requestDuration)
Expand All @@ -146,7 +146,7 @@ public function getRequestDuration()
}

/**
* @param \DateTime $requestTime
* @param \DateTime $requestTime
* @return self
*/
public function setRequestTime(\DateTime $requestTime)
Expand All @@ -164,7 +164,7 @@ public function getRequestTime()
}

/**
* @param array $serverData
* @param array $serverData
* @return self
*/
public function setServerData(array $serverData)
Expand All @@ -182,7 +182,7 @@ public function getServerData()
}

/**
* @param array $sessionData
* @param array $sessionData
* @return self
*/
public function setSessionData(array $sessionData = null)
Expand All @@ -200,7 +200,7 @@ public function getSessionData()
}

/**
* @param string $url
* @param string $url
* @return self
*/
public function setUrl($url)
Expand All @@ -218,7 +218,7 @@ public function getUrl()
}

/**
* @param string $userAgent
* @param string $userAgent
* @return self
*/
public function setUserAgent($userAgent)
Expand All @@ -234,4 +234,4 @@ public function getUserAgent()
{
return $this->userAgent;
}
}
}
Loading