diff --git a/src/Monolog/ErrorHandler.php b/src/Monolog/ErrorHandler.php index 6b2fa362..aa5a278a 100644 --- a/src/Monolog/ErrorHandler.php +++ b/src/Monolog/ErrorHandler.php @@ -47,10 +47,10 @@ class ErrorHandler * * By default it will handle errors, exceptions and fatal errors * - * @param LoggerInterface $logger - * @param array|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling - * @param int|false $exceptionLevel a LogLevel::* constant, or false to disable exception handling - * @param int|false $fatalLevel a LogLevel::* constant, or false to disable fatal error handling + * @param LoggerInterface $logger + * @param array|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling + * @param int|false $exceptionLevel a LogLevel::* constant, or false to disable exception handling + * @param int|false $fatalLevel a LogLevel::* constant, or false to disable fatal error handling * @return ErrorHandler */ public static function register(LoggerInterface $logger, $errorLevelMap = array(), $exceptionLevel = null, $fatalLevel = null) diff --git a/src/Monolog/Handler/ErrorLogHandler.php b/src/Monolog/Handler/ErrorLogHandler.php index fea6de6c..477c5654 100644 --- a/src/Monolog/Handler/ErrorLogHandler.php +++ b/src/Monolog/Handler/ErrorLogHandler.php @@ -23,9 +23,9 @@ class ErrorLogHandler extends AbstractProcessingHandler protected $messageType; /** - * @param integer $messageType Says where the error should go. - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not + * @param integer $messageType Says where the error should go. + * @param integer $level The minimum logging level at which this handler will be triggered + * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not */ public function __construct($messageType = 0, $level = Logger::DEBUG, $bubble = true) { diff --git a/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php b/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php index 770dd765..646d57a8 100644 --- a/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php +++ b/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php @@ -37,7 +37,7 @@ class ChannelLevelActivationStrategy implements ActivationStrategyInterface private $channelToActionLevel; /** - * @param int $defaultActionLevel The default action level to be used if the record's category doesn't match any + * @param int $defaultActionLevel The default action level to be used if the record's category doesn't match any * @param array $categoryToActionLevel An array that maps channel names to action levels. */ public function __construct($defaultActionLevel, $channelToActionLevel = array()) diff --git a/src/Monolog/Handler/HipChatHandler.php b/src/Monolog/Handler/HipChatHandler.php index 1aa8d654..e1402a03 100644 --- a/src/Monolog/Handler/HipChatHandler.php +++ b/src/Monolog/Handler/HipChatHandler.php @@ -48,13 +48,13 @@ class HipChatHandler extends SocketHandler private $notify; /** - * @param string $token HipChat API Token - * @param string $room The room that should be alerted of the message (Id or Name) - * @param string $name Name used in the "from" field - * @param bool $notify Trigger a notification in clients or not - * @param int $level The minimum logging level at which this handler will be triggered + * @param string $token HipChat API Token + * @param string $room The room that should be alerted of the message (Id or Name) + * @param string $name Name used in the "from" field + * @param bool $notify Trigger a notification in clients or not + * @param int $level The minimum logging level at which this handler will be triggered * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - * @param Boolean $useSSL Whether to connect via SSL. + * @param Boolean $useSSL Whether to connect via SSL. */ public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true) { @@ -70,7 +70,7 @@ class HipChatHandler extends SocketHandler /** * {@inheritdoc} * - * @param array $record + * @param array $record * @return string */ protected function generateDataStream($record) @@ -83,7 +83,7 @@ class HipChatHandler extends SocketHandler /** * Builds the body of API call * - * @param array $record + * @param array $record * @return string */ private function buildContent($record) @@ -103,7 +103,7 @@ class HipChatHandler extends SocketHandler /** * Builds the header of the API Call * - * @param string $content + * @param string $content * @return string */ private function buildHeader($content) @@ -120,7 +120,7 @@ class HipChatHandler extends SocketHandler /** * Assigns a color to each level of log records. * - * @param integer $level + * @param integer $level * @return string */ protected function getAlertColor($level) diff --git a/src/Monolog/Handler/PushoverHandler.php b/src/Monolog/Handler/PushoverHandler.php index 2cf4f577..c4da70e4 100644 --- a/src/Monolog/Handler/PushoverHandler.php +++ b/src/Monolog/Handler/PushoverHandler.php @@ -30,12 +30,12 @@ class PushoverHandler extends SocketHandler private $emergencyLevel; /** - * @param string $token Pushover api token - * @param string|array $users Pushover user id or array of ids the message will be sent to - * @param string $title Title sent to the Pushover API - * @param integer $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - * @param Boolean $useSSL Whether to connect via SSL. Required when pushing messages to users that are not + * @param string $token Pushover api token + * @param string|array $users Pushover user id or array of ids the message will be sent to + * @param string $title Title sent to the Pushover API + * @param integer $level The minimum logging level at which this handler will be triggered + * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not + * @param Boolean $useSSL Whether to connect via SSL. Required when pushing messages to users that are not * the pushover.net app owner. OpenSSL is required for this option. * @param integer $highPriorityLevel The minimum logging level at which this handler will start * sending "high priority" requests to the Pushover API @@ -108,11 +108,13 @@ class PushoverHandler extends SocketHandler $this->user = null; } - public function setHighPriorityLevel($value) { + public function setHighPriorityLevel($value) + { $this->highPriorityLevel = $value; } - public function setEmergencyLevel($value) { + public function setEmergencyLevel($value) + { $this->emergencyLevel = $value; } } diff --git a/src/Monolog/Handler/RavenHandler.php b/src/Monolog/Handler/RavenHandler.php index 9a85293a..8835e666 100644 --- a/src/Monolog/Handler/RavenHandler.php +++ b/src/Monolog/Handler/RavenHandler.php @@ -69,7 +69,7 @@ class RavenHandler extends AbstractProcessingHandler $level = $this->level; // filter records based on their level - $records = array_filter($records, function($record) use($level) { + $records = array_filter($records, function($record) use ($level) { return $record['level'] >= $level; }); @@ -79,7 +79,7 @@ class RavenHandler extends AbstractProcessingHandler // the record with the highest severity is the "main" one $record = array_reduce($records, function($highest, $record) { - if($record['level'] >= $highest['level']) { + if ($record['level'] >= $highest['level']) { $highest = $record; return $highest; @@ -140,6 +140,7 @@ class RavenHandler extends AbstractProcessingHandler if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Exception) { $options['extra']['message'] = $record['formatted']; $this->ravenClient->captureException($record['context']['exception'], $options); + return; } diff --git a/tests/Monolog/Handler/NewRelicHandlerTest.php b/tests/Monolog/Handler/NewRelicHandlerTest.php index 583c164d..bc7bcab8 100644 --- a/tests/Monolog/Handler/NewRelicHandlerTest.php +++ b/tests/Monolog/Handler/NewRelicHandlerTest.php @@ -54,10 +54,12 @@ class StubNewRelicHandler extends NewRelicHandler } } -function newrelic_notice_error() { +function newrelic_notice_error() +{ return true; } -function newrelic_add_custom_parameter() { +function newrelic_add_custom_parameter() +{ return true; }