From 3926d95f8a7270ef81c28f346100c297d03ada5d Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 26 Dec 2013 11:43:12 +0100 Subject: [PATCH] CS fixes --- src/Monolog/Handler/AbstractHandler.php | 4 +-- src/Monolog/Handler/CubeHandler.php | 4 +-- src/Monolog/Handler/DynamoDbHandler.php | 2 +- src/Monolog/Handler/HandlerInterface.php | 2 +- src/Monolog/Handler/PushoverHandler.php | 26 +++++++++---------- src/Monolog/Handler/RavenHandler.php | 4 +-- src/Monolog/Handler/RotatingFileHandler.php | 2 +- src/Monolog/Logger.php | 6 ++--- .../Processor/IntrospectionProcessor.php | 13 ++++------ 9 files changed, 30 insertions(+), 33 deletions(-) diff --git a/src/Monolog/Handler/AbstractHandler.php b/src/Monolog/Handler/AbstractHandler.php index 81fc7a37..3bb21b71 100644 --- a/src/Monolog/Handler/AbstractHandler.php +++ b/src/Monolog/Handler/AbstractHandler.php @@ -141,8 +141,8 @@ abstract class AbstractHandler implements HandlerInterface /** * Sets the bubbling behavior. * - * @param Boolean $bubble true means that this handler allows bubbling. - * false means that bubbling is not permitted. + * @param Boolean $bubble true means that this handler allows bubbling. + * false means that bubbling is not permitted. * @return self */ public function setBubble($bubble) diff --git a/src/Monolog/Handler/CubeHandler.php b/src/Monolog/Handler/CubeHandler.php index cdcde2d5..d968720c 100644 --- a/src/Monolog/Handler/CubeHandler.php +++ b/src/Monolog/Handler/CubeHandler.php @@ -32,8 +32,8 @@ class CubeHandler extends AbstractProcessingHandler * Create a Cube handler * * @throws UnexpectedValueException when given url is not a valid url. - * A valid url must consists of three parts : protocol://host:port - * Only valid protocol used by Cube are http and udp + * A valid url must consists of three parts : protocol://host:port + * Only valid protocol used by Cube are http and udp */ public function __construct($url, $level = Logger::DEBUG, $bubble = true) { diff --git a/src/Monolog/Handler/DynamoDbHandler.php b/src/Monolog/Handler/DynamoDbHandler.php index ad6622e1..5702c5fb 100644 --- a/src/Monolog/Handler/DynamoDbHandler.php +++ b/src/Monolog/Handler/DynamoDbHandler.php @@ -75,7 +75,7 @@ class DynamoDbHandler extends AbstractProcessingHandler */ protected function filterEmptyFields(array $record) { - return array_filter($record, function($value) { + return array_filter($record, function ($value) { return !empty($value) || false === $value || 0 === $value; }); } diff --git a/src/Monolog/Handler/HandlerInterface.php b/src/Monolog/Handler/HandlerInterface.php index 4e7d6392..accff037 100644 --- a/src/Monolog/Handler/HandlerInterface.php +++ b/src/Monolog/Handler/HandlerInterface.php @@ -47,7 +47,7 @@ interface HandlerInterface * * @param array $record The record to handle * @return Boolean true means that this handler handled the record, and that bubbling is not permitted. - * false means the record was either not processed or that this handler allows bubbling. + * false means the record was either not processed or that this handler allows bubbling. */ public function handle(array $record); diff --git a/src/Monolog/Handler/PushoverHandler.php b/src/Monolog/Handler/PushoverHandler.php index 9408a031..b1dff9b6 100644 --- a/src/Monolog/Handler/PushoverHandler.php +++ b/src/Monolog/Handler/PushoverHandler.php @@ -32,19 +32,19 @@ 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 - * 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 - * @param integer $emergencyLevel The minimum logging level at which this handler will start - * sending "emergency" requests to the Pushover API - * @param integer $retry The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user. - * @param integer $expire The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds). + * @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 + * @param integer $emergencyLevel The minimum logging level at which this handler will start + * sending "emergency" requests to the Pushover API + * @param integer $retry The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user. + * @param integer $expire The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds). */ public function __construct($token, $users, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $highPriorityLevel = Logger::CRITICAL, $emergencyLevel = Logger::EMERGENCY, $retry = 30, $expire = 25200) { diff --git a/src/Monolog/Handler/RavenHandler.php b/src/Monolog/Handler/RavenHandler.php index 02c8261e..653e61c1 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; }); @@ -78,7 +78,7 @@ class RavenHandler extends AbstractProcessingHandler } // the record with the highest severity is the "main" one - $record = array_reduce($records, function($highest, $record) { + $record = array_reduce($records, function ($highest, $record) { if ($record['level'] >= $highest['level']) { return $record; } diff --git a/src/Monolog/Handler/RotatingFileHandler.php b/src/Monolog/Handler/RotatingFileHandler.php index 18a0fcc5..a02ff516 100644 --- a/src/Monolog/Handler/RotatingFileHandler.php +++ b/src/Monolog/Handler/RotatingFileHandler.php @@ -105,7 +105,7 @@ class RotatingFileHandler extends StreamHandler } // Sorting the files by name to remove the older ones - usort($logFiles, function($a, $b) { + usort($logFiles, function ($a, $b) { return strcmp($b, $a); }); diff --git a/src/Monolog/Logger.php b/src/Monolog/Logger.php index 33b22367..82a22291 100644 --- a/src/Monolog/Logger.php +++ b/src/Monolog/Logger.php @@ -129,9 +129,9 @@ class Logger implements LoggerInterface protected $processors; /** - * @param string $name The logging channel - * @param HandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc. - * @param callable[] $processors Optional array of processors + * @param string $name The logging channel + * @param HandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc. + * @param callable[] $processors Optional array of processors */ public function __construct($name, array $handlers = array(), array $processors = array()) { diff --git a/src/Monolog/Processor/IntrospectionProcessor.php b/src/Monolog/Processor/IntrospectionProcessor.php index 26007aa8..a2c48ce6 100644 --- a/src/Monolog/Processor/IntrospectionProcessor.php +++ b/src/Monolog/Processor/IntrospectionProcessor.php @@ -30,7 +30,7 @@ class IntrospectionProcessor private $skipClassesPartials; - public function __construct($level = Logger::DEBUG, array $skipClassesPartials = array('Monolog\\')) + public function __construct($level = Logger::DEBUG, array $skipClassesPartials = array('Monolog\\')) { $this->level = $level; $this->skipClassesPartials = $skipClassesPartials; @@ -56,18 +56,15 @@ class IntrospectionProcessor $i = 0; - while (isset($trace[$i]['class'])) - { - foreach ($this->skipClassesPartials as $part) - { - if (strpos($trace[$i]['class'], $part) !== false) - { + while (isset($trace[$i]['class'])) { + foreach ($this->skipClassesPartials as $part) { + if (strpos($trace[$i]['class'], $part) !== false) { $i++; continue 2; } } break; - } + } // we should have the call source now $record['extra'] = array_merge(