Jordi Boggiano před 13 roky
rodič
revize
da33c84d07
46 změnil soubory, kde provedl 193 přidání a 206 odebrání
  1. 1 1
      src/Monolog/Formatter/ChromePHPFormatter.php
  2. 4 4
      src/Monolog/Formatter/FormatterInterface.php
  3. 0 2
      src/Monolog/Formatter/JsonFormatter.php
  4. 1 3
      src/Monolog/Formatter/LineFormatter.php
  5. 0 2
      src/Monolog/Formatter/NormalizerFormatter.php
  6. 1 1
      src/Monolog/Formatter/WildfireFormatter.php
  7. 4 3
      src/Monolog/Handler/AbstractHandler.php
  8. 2 6
      src/Monolog/Handler/AbstractProcessingHandler.php
  9. 5 5
      src/Monolog/Handler/BufferHandler.php
  10. 3 4
      src/Monolog/Handler/ChromePHPHandler.php
  11. 28 28
      src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php
  12. 32 32
      src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php
  13. 4 4
      src/Monolog/Handler/FingersCrossedHandler.php
  14. 5 6
      src/Monolog/Handler/FirePHPHandler.php
  15. 3 3
      src/Monolog/Handler/GelfHandler.php
  16. 2 2
      src/Monolog/Handler/GroupHandler.php
  17. 8 8
      src/Monolog/Handler/HandlerInterface.php
  18. 2 2
      src/Monolog/Handler/MailHandler.php
  19. 6 6
      src/Monolog/Handler/NativeMailerHandler.php
  20. 1 1
      src/Monolog/Handler/NullHandler.php
  21. 4 4
      src/Monolog/Handler/RotatingFileHandler.php
  22. 2 2
      src/Monolog/Handler/StreamHandler.php
  23. 4 4
      src/Monolog/Handler/SwiftMailerHandler.php
  24. 5 5
      src/Monolog/Handler/SyslogHandler.php
  25. 1 1
      src/Monolog/Handler/TestHandler.php
  26. 35 33
      src/Monolog/Logger.php
  27. 1 1
      src/Monolog/Processor/IntrospectionProcessor.php
  28. 1 1
      src/Monolog/Processor/MemoryPeakUsageProcessor.php
  29. 1 1
      src/Monolog/Processor/MemoryProcessor.php
  30. 1 1
      src/Monolog/Processor/MemoryUsageProcessor.php
  31. 1 1
      src/Monolog/Processor/WebProcessor.php
  32. 0 2
      tests/Monolog/Formatter/LineFormatterTest.php
  33. 0 2
      tests/Monolog/Formatter/NormalizerFormatterTest.php
  34. 2 2
      tests/Monolog/Functional/Handler/FirePHPHandlerTest.php
  35. 1 1
      tests/Monolog/Handler/ChromePHPHandlerTest.php
  36. 1 1
      tests/Monolog/Handler/FirePHPHandlerTest.php
  37. 1 0
      tests/Monolog/Handler/GelfHandlerTest.php
  38. 2 2
      tests/Monolog/Handler/GelfMocks.php
  39. 1 1
      tests/Monolog/Handler/MailHandlerTest.php
  40. 2 1
      tests/Monolog/Handler/MongoDBHandlerTest.php
  41. 1 1
      tests/Monolog/Handler/NullHandlerTest.php
  42. 0 1
      tests/Monolog/Handler/RotatingFileHandlerTest.php
  43. 8 9
      tests/Monolog/Handler/SocketHandlerTest.php
  44. 0 2
      tests/Monolog/Handler/SyslogHandlerTest.php
  45. 1 0
      tests/Monolog/LoggerTest.php
  46. 5 4
      tests/Monolog/Processor/IntrospectionProcessorTest.php

+ 1 - 1
src/Monolog/Formatter/ChromePHPFormatter.php

@@ -74,4 +74,4 @@ class ChromePHPFormatter implements FormatterInterface
 
         return $formatted;
     }
-}
+}

+ 4 - 4
src/Monolog/Formatter/FormatterInterface.php

@@ -21,16 +21,16 @@ interface FormatterInterface
     /**
      * Formats a log record.
      *
-     * @param array $record A record to format
+     * @param  array $record A record to format
      * @return mixed The formatted record
      */
-    function format(array $record);
+    public function format(array $record);
 
     /**
      * Formats a set of log records.
      *
-     * @param array $records A set of records to format
+     * @param  array $records A set of records to format
      * @return mixed The formatted set of records
      */
-    function formatBatch(array $records);
+    public function formatBatch(array $records);
 }

+ 0 - 2
src/Monolog/Formatter/JsonFormatter.php

@@ -11,8 +11,6 @@
 
 namespace Monolog\Formatter;
 
-use Monolog\Logger;
-
 /**
  * Encodes whatever record data is passed to it as json
  *

+ 1 - 3
src/Monolog/Formatter/LineFormatter.php

@@ -11,8 +11,6 @@
 
 namespace Monolog\Formatter;
 
-use Monolog\Logger;
-
 /**
  * Formats incoming records into a one-line string
  *
@@ -28,7 +26,7 @@ class LineFormatter extends NormalizerFormatter
     protected $format;
 
     /**
-     * @param string $format The format of the message
+     * @param string $format     The format of the message
      * @param string $dateFormat The format of the timestamp: one supported by DateTime::format
      */
     public function __construct($format = null, $dateFormat = null)

+ 0 - 2
src/Monolog/Formatter/NormalizerFormatter.php

@@ -11,8 +11,6 @@
 
 namespace Monolog\Formatter;
 
-use Monolog\Logger;
-
 /**
  * Normalizes incoming records to remove objects/resources so it's easier to dump to various targets
  *

+ 1 - 1
src/Monolog/Formatter/WildfireFormatter.php

@@ -84,4 +84,4 @@ class WildfireFormatter implements FormatterInterface
     {
         throw new \BadMethodCallException('Batch formatting does not make sense for the WildfireFormatter');
     }
-}
+}

+ 4 - 3
src/Monolog/Handler/AbstractHandler.php

@@ -32,7 +32,7 @@ abstract class AbstractHandler implements HandlerInterface
     protected $processors = array();
 
     /**
-     * @param integer $level The minimum logging level at which this handler will be triggered
+     * @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($level = Logger::DEBUG, $bubble = true)
@@ -87,6 +87,7 @@ abstract class AbstractHandler implements HandlerInterface
         if (!$this->processors) {
             throw new \LogicException('You tried to pop from an empty processor stack.');
         }
+
         return array_shift($this->processors);
     }
 
@@ -155,8 +156,8 @@ abstract class AbstractHandler implements HandlerInterface
     public function __destruct()
     {
         try {
-            $this->close();    
-        } catch(\Exception $e) {
+            $this->close();
+        } catch (\Exception $e) {
             // do nothing
         }
     }

+ 2 - 6
src/Monolog/Handler/AbstractProcessingHandler.php

@@ -11,10 +11,6 @@
 
 namespace Monolog\Handler;
 
-use Monolog\Logger;
-use Monolog\Formatter\FormatterInterface;
-use Monolog\Formatter\LineFormatter;
-
 /**
  * Base Handler class providing the Handler structure
  *
@@ -46,7 +42,7 @@ abstract class AbstractProcessingHandler extends AbstractHandler
     /**
      * Writes the record down to the log of the implementing handler
      *
-     * @param array $record
+     * @param  array $record
      * @return void
      */
     abstract protected function write(array $record);
@@ -54,7 +50,7 @@ abstract class AbstractProcessingHandler extends AbstractHandler
     /**
      * Processes a record.
      *
-     * @param array $record
+     * @param  array $record
      * @return array
      */
     protected function processRecord(array $record)

+ 5 - 5
src/Monolog/Handler/BufferHandler.php

@@ -28,10 +28,10 @@ class BufferHandler extends AbstractHandler
     protected $buffer = array();
 
     /**
-     * @param HandlerInterface $handler Handler.
-     * @param integer $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
-     * @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 HandlerInterface $handler    Handler.
+     * @param integer          $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
+     * @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(HandlerInterface $handler, $bufferSize = 0, $level = Logger::DEBUG, $bubble = true)
     {
@@ -65,7 +65,7 @@ class BufferHandler extends AbstractHandler
      */
     public function close()
     {
-        if($this->buffer) {
+        if ($this->buffer) {
             $this->handler->handleBatch($this->buffer);
             $this->buffer = array();
         }

+ 3 - 4
src/Monolog/Handler/ChromePHPHandler.php

@@ -11,7 +11,6 @@
 
 namespace Monolog\Handler;
 
-use Monolog\Logger;
 use Monolog\Formatter\ChromePHPFormatter;
 
 /**
@@ -31,9 +30,9 @@ class ChromePHPHandler extends AbstractProcessingHandler
      */
     const HEADER_NAME = 'X-ChromePhp-Data';
 
-    static protected $initialized = false;
+    protected static $initialized = false;
 
-    static protected $json = array(
+    protected static $json = array(
         'version' => self::VERSION,
         'columns' => array('label', 'log', 'backtrace', 'type'),
         'rows' => array(),
@@ -124,4 +123,4 @@ class ChromePHPHandler extends AbstractProcessingHandler
         return !isset($_SERVER['HTTP_USER_AGENT'])
                || preg_match('{\bChrome/\d+[\.\d+]*\b}', $_SERVER['HTTP_USER_AGENT']);
     }
-}
+}

+ 28 - 28
src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php

@@ -1,28 +1,28 @@
-<?php
-
-/*
- * This file is part of the Monolog package.
- *
- * (c) Jordi Boggiano <j.boggiano@seld.be>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler\FingersCrossed;
-
-/**
- * Interface for activation strategies for the FingersCrossedHandler.
- *
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
- */
-interface ActivationStrategyInterface
-{
-    /**
-     * Returns whether the given record activates the handler.
-     *
-     * @param array $record
-     * @return Boolean
-     */
-    function isHandlerActivated(array $record);
-}
+<?php
+
+/*
+ * This file is part of the Monolog package.
+ *
+ * (c) Jordi Boggiano <j.boggiano@seld.be>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Handler\FingersCrossed;
+
+/**
+ * Interface for activation strategies for the FingersCrossedHandler.
+ *
+ * @author Johannes M. Schmitt <schmittjoh@gmail.com>
+ */
+interface ActivationStrategyInterface
+{
+    /**
+     * Returns whether the given record activates the handler.
+     *
+     * @param  array   $record
+     * @return Boolean
+     */
+    public function isHandlerActivated(array $record);
+}

+ 32 - 32
src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php

@@ -1,32 +1,32 @@
-<?php
-
-/*
- * This file is part of the Monolog package.
- *
- * (c) Jordi Boggiano <j.boggiano@seld.be>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler\FingersCrossed;
-
-/**
- * Error level based activation strategy.
- *
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
- */
-class ErrorLevelActivationStrategy implements ActivationStrategyInterface
-{
-    private $actionLevel;
-
-    public function __construct($actionLevel)
-    {
-        $this->actionLevel = $actionLevel;
-    }
-
-    public function isHandlerActivated(array $record)
-    {
-        return $record['level'] >= $this->actionLevel;
-    }
-}
+<?php
+
+/*
+ * This file is part of the Monolog package.
+ *
+ * (c) Jordi Boggiano <j.boggiano@seld.be>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Handler\FingersCrossed;
+
+/**
+ * Error level based activation strategy.
+ *
+ * @author Johannes M. Schmitt <schmittjoh@gmail.com>
+ */
+class ErrorLevelActivationStrategy implements ActivationStrategyInterface
+{
+    private $actionLevel;
+
+    public function __construct($actionLevel)
+    {
+        $this->actionLevel = $actionLevel;
+    }
+
+    public function isHandlerActivated(array $record)
+    {
+        return $record['level'] >= $this->actionLevel;
+    }
+}

+ 4 - 4
src/Monolog/Handler/FingersCrossedHandler.php

@@ -34,11 +34,11 @@ class FingersCrossedHandler extends AbstractHandler
     protected $stopBuffering;
 
     /**
-     * @param callback|HandlerInterface $handler Handler or factory callback($record, $fingersCrossedHandler).
+     * @param callback|HandlerInterface       $handler            Handler or factory callback($record, $fingersCrossedHandler).
      * @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action
-     * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
-     * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
-     * @param Boolean $stopBuffering Whether the handler should stop buffering after being triggered (default true)
+     * @param int                             $bufferSize         How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
+     * @param Boolean                         $bubble             Whether the messages that are handled can bubble up the stack or not
+     * @param Boolean                         $stopBuffering      Whether the handler should stop buffering after being triggered (default true)
      */
     public function __construct($handler, $activationStrategy = null, $bufferSize = 0, $bubble = true, $stopBuffering = true)
     {

+ 5 - 6
src/Monolog/Handler/FirePHPHandler.php

@@ -11,7 +11,6 @@
 
 namespace Monolog\Handler;
 
-use Monolog\Logger;
 use Monolog\Formatter\WildfireFormatter;
 
 /**
@@ -57,9 +56,9 @@ class FirePHPHandler extends AbstractProcessingHandler
     /**
      * Base header creation function used by init headers & record headers
      *
-     * @param array $meta Wildfire Plugin, Protocol & Structure Indexes
-     * @param string $message Log message
-     * @return array Complete header string ready for the client as key and message as value
+     * @param  array  $meta    Wildfire Plugin, Protocol & Structure Indexes
+     * @param  string $message Log message
+     * @return array  Complete header string ready for the client as key and message as value
      */
     protected function createHeader(array $meta, $message)
     {
@@ -72,7 +71,7 @@ class FirePHPHandler extends AbstractProcessingHandler
      * Creates message header from record
      *
      * @see createHeader()
-     * @param array $record
+     * @param  array  $record
      * @return string
      */
     protected function createRecordHeader(array $record)
@@ -158,4 +157,4 @@ class FirePHPHandler extends AbstractProcessingHandler
                || preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT'])
                || isset($_SERVER['HTTP_X_FIREPHP_VERSION']);
     }
-}
+}

+ 3 - 3
src/Monolog/Handler/GelfHandler.php

@@ -17,7 +17,7 @@ use Monolog\Handler\AbstractProcessingHandler;
 use Monolog\Formatter\GelfMessageFormatter;
 
 /**
- * Handler to send messages to a Graylog2 (http://www.graylog2.org) server 
+ * Handler to send messages to a Graylog2 (http://www.graylog2.org) server
  *
  * @author Matt Lehner <mlehner@gmail.com>
  */
@@ -30,8 +30,8 @@ class GelfHandler extends AbstractProcessingHandler
 
     /**
      * @param Gelf\IMessagePublisher $publisher a publisher object
-     * @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                $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(IMessagePublisher $publisher, $level = Logger::DEBUG, $bubble = true)
     {

+ 2 - 2
src/Monolog/Handler/GroupHandler.php

@@ -21,8 +21,8 @@ class GroupHandler extends AbstractHandler
     protected $handlers;
 
     /**
-     * @param array $handlers Array of Handlers.
-     * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
+     * @param array   $handlers Array of Handlers.
+     * @param Boolean $bubble   Whether the messages that are handled can bubble up the stack or not
      */
     public function __construct(array $handlers, $bubble = true)
     {

+ 8 - 8
src/Monolog/Handler/HandlerInterface.php

@@ -27,51 +27,51 @@ interface HandlerInterface
      *
      * @return Boolean
      */
-    function isHandling(array $record);
+    public function isHandling(array $record);
 
     /**
      * Handles a record.
      *
      * The return value of this function controls the bubbling process of the handler stack.
      *
-     * @param array $record The record to handle
+     * @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.
      */
-    function handle(array $record);
+    public function handle(array $record);
 
     /**
      * Handles a set of records at once.
      *
      * @param array $records The records to handle (an array of record arrays)
      */
-    function handleBatch(array $records);
+    public function handleBatch(array $records);
 
     /**
      * Adds a processor in the stack.
      *
      * @param callable $callback
      */
-    function pushProcessor($callback);
+    public function pushProcessor($callback);
 
     /**
      * Removes the processor on top of the stack and returns it.
      *
      * @return callable
      */
-    function popProcessor();
+    public function popProcessor();
 
     /**
      * Sets the formatter.
      *
      * @param FormatterInterface $formatter
      */
-    function setFormatter(FormatterInterface $formatter);
+    public function setFormatter(FormatterInterface $formatter);
 
     /**
      * Gets the formatter.
      *
      * @return FormatterInterface
      */
-    function getFormatter();
+    public function getFormatter();
 }

+ 2 - 2
src/Monolog/Handler/MailHandler.php

@@ -41,7 +41,7 @@ abstract class MailHandler extends AbstractProcessingHandler
      * Send a mail with the given content
      *
      * @param string $content
-     * @param array $records the array of log records that formed this content
+     * @param array  $records the array of log records that formed this content
      */
     abstract protected function send($content, array $records);
 
@@ -52,4 +52,4 @@ abstract class MailHandler extends AbstractProcessingHandler
     {
         $this->send((string) $record['formatted'], array($record));
     }
-}
+}

+ 6 - 6
src/Monolog/Handler/NativeMailerHandler.php

@@ -27,11 +27,11 @@ class NativeMailerHandler extends MailHandler
     );
 
     /**
-     * @param string|array $to The receiver of the mail
-     * @param string $subject The subject of the mail
-     * @param string $from The sender of the mail
-     * @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 string|array $to      The receiver of the mail
+     * @param string       $subject The subject of the mail
+     * @param string       $from    The sender of the mail
+     * @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($to, $subject, $from, $level = Logger::ERROR, $bubble = true)
     {
@@ -62,4 +62,4 @@ class NativeMailerHandler extends MailHandler
             mail($to, $this->subject, wordwrap($content, 70), implode("\r\n", $this->headers) . "\r\n");
         }
     }
-}
+}

+ 1 - 1
src/Monolog/Handler/NullHandler.php

@@ -42,4 +42,4 @@ class NullHandler extends AbstractHandler
 
         return true;
     }
-}
+}

+ 4 - 4
src/Monolog/Handler/RotatingFileHandler.php

@@ -28,10 +28,10 @@ class RotatingFileHandler extends StreamHandler
     protected $mustRotate;
 
     /**
-     * @param string $filename
+     * @param string  $filename
      * @param integer $maxFiles The maximal amount of files to keep (0 means unlimited)
-     * @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 $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($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true)
     {
@@ -106,4 +106,4 @@ class RotatingFileHandler extends StreamHandler
             }
         }
     }
-}
+}

+ 2 - 2
src/Monolog/Handler/StreamHandler.php

@@ -26,8 +26,8 @@ class StreamHandler extends AbstractProcessingHandler
     protected $url;
 
     /**
-     * @param string $stream
-     * @param integer $level The minimum logging level at which this handler will be triggered
+     * @param string  $stream
+     * @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($stream, $level = Logger::DEBUG, $bubble = true)

+ 4 - 4
src/Monolog/Handler/SwiftMailerHandler.php

@@ -24,10 +24,10 @@ class SwiftMailerHandler extends MailHandler
     protected $message;
 
     /**
-     * @param \Swift_Mailer $mailer The mailer to use
+     * @param \Swift_Mailer           $mailer  The mailer to use
      * @param callback|\Swift_Message $message An example message for real messages, only the body will be replaced
-     * @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                 $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(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, $bubble = true)
     {
@@ -52,4 +52,4 @@ class SwiftMailerHandler extends MailHandler
 
         $this->mailer->send($message);
     }
-}
+}

+ 5 - 5
src/Monolog/Handler/SyslogHandler.php

@@ -58,10 +58,10 @@ class SyslogHandler extends AbstractProcessingHandler
     );
 
     /**
-     * @param string $ident
-     * @param mixed $facility
-     * @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 string  $ident
+     * @param mixed   $facility
+     * @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($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true)
     {
@@ -81,7 +81,7 @@ class SyslogHandler extends AbstractProcessingHandler
         // convert textual description of facility to syslog constant
         if (array_key_exists(strtolower($facility), $this->facilities)) {
             $facility = $this->facilities[strtolower($facility)];
-        } else if (!in_array($facility, array_values($this->facilities), true)) {
+        } elseif (!in_array($facility, array_values($this->facilities), true)) {
             throw new \UnexpectedValueException('Unknown facility value "'.$facility.'" given');
         }
 

+ 1 - 1
src/Monolog/Handler/TestHandler.php

@@ -117,4 +117,4 @@ class TestHandler extends AbstractProcessingHandler
         $this->recordsByLevel[$record['level']][] = $record;
         $this->records[] = $record;
     }
-}
+}

+ 35 - 33
src/Monolog/Logger.php

@@ -120,6 +120,7 @@ class Logger
         if (!$this->handlers) {
             throw new \LogicException('You tried to pop from an empty handler stack.');
         }
+
         return array_shift($this->handlers);
     }
 
@@ -146,15 +147,16 @@ class Logger
         if (!$this->processors) {
             throw new \LogicException('You tried to pop from an empty processor stack.');
         }
+
         return array_shift($this->processors);
     }
 
     /**
      * Adds a log record.
      *
-     * @param integer $level The logging level
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  integer $level   The logging level
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function addRecord($level, $message, array $context = array())
@@ -198,8 +200,8 @@ class Logger
     /**
      * Adds a log record at the DEBUG level.
      *
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function addDebug($message, array $context = array())
@@ -210,8 +212,8 @@ class Logger
     /**
      * Adds a log record at the INFO level.
      *
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function addInfo($message, array $context = array())
@@ -222,8 +224,8 @@ class Logger
     /**
      * Adds a log record at the WARNING level.
      *
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function addWarning($message, array $context = array())
@@ -234,8 +236,8 @@ class Logger
     /**
      * Adds a log record at the ERROR level.
      *
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function addError($message, array $context = array())
@@ -246,8 +248,8 @@ class Logger
     /**
      * Adds a log record at the CRITICAL level.
      *
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function addCritical($message, array $context = array())
@@ -258,8 +260,8 @@ class Logger
     /**
      * Adds a log record at the ALERT level.
      *
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function addAlert($message, array $context = array())
@@ -270,7 +272,7 @@ class Logger
     /**
      * Gets the name of the logging level.
      *
-     * @param integer $level
+     * @param  integer $level
      * @return string
      */
     public static function getLevelName($level)
@@ -281,7 +283,7 @@ class Logger
     /**
      * Checks whether the Logger has a handler that listens on the given level
      *
-     * @param integer $level
+     * @param  integer $level
      * @return Boolean
      */
     public function isHandling($level)
@@ -312,8 +314,8 @@ class Logger
      *
      * This method allows to have an easy ZF compatibility.
      *
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function debug($message, array $context = array())
@@ -326,8 +328,8 @@ class Logger
      *
      * This method allows to have an easy ZF compatibility.
      *
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function info($message, array $context = array())
@@ -340,8 +342,8 @@ class Logger
      *
      * This method allows to have an easy ZF compatibility.
      *
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function notice($message, array $context = array())
@@ -354,8 +356,8 @@ class Logger
      *
      * This method allows to have an easy ZF compatibility.
      *
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function warn($message, array $context = array())
@@ -368,8 +370,8 @@ class Logger
      *
      * This method allows to have an easy ZF compatibility.
      *
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function err($message, array $context = array())
@@ -382,8 +384,8 @@ class Logger
      *
      * This method allows to have an easy ZF compatibility.
      *
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function crit($message, array $context = array())
@@ -396,8 +398,8 @@ class Logger
      *
      * This method allows to have an easy ZF compatibility.
      *
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function alert($message, array $context = array())
@@ -410,8 +412,8 @@ class Logger
      *
      * This method allows to have an easy ZF compatibility.
      *
-     * @param string $message The log message
-     * @param array $context The log context
+     * @param  string  $message The log message
+     * @param  array   $context The log context
      * @return Boolean Whether the record has been processed
      */
     public function emerg($message, array $context = array())

+ 1 - 1
src/Monolog/Processor/IntrospectionProcessor.php

@@ -25,7 +25,7 @@ namespace Monolog\Processor;
 class IntrospectionProcessor
 {
     /**
-     * @param array $record
+     * @param  array $record
      * @return array
      */
     public function __invoke(array $record)

+ 1 - 1
src/Monolog/Processor/MemoryPeakUsageProcessor.php

@@ -20,7 +20,7 @@ namespace Monolog\Processor;
 class MemoryPeakUsageProcessor extends MemoryProcessor
 {
     /**
-     * @param array $record
+     * @param  array $record
      * @return array
      */
     public function __invoke(array $record)

+ 1 - 1
src/Monolog/Processor/MemoryProcessor.php

@@ -31,7 +31,7 @@ abstract class MemoryProcessor
     /**
      * Formats bytes into a human readable string
      *
-     * @param int $bytes
+     * @param  int    $bytes
      * @return string
      */
     protected static function formatBytes($bytes)

+ 1 - 1
src/Monolog/Processor/MemoryUsageProcessor.php

@@ -20,7 +20,7 @@ namespace Monolog\Processor;
 class MemoryUsageProcessor extends MemoryProcessor
 {
     /**
-     * @param array $record
+     * @param  array $record
      * @return array
      */
     public function __invoke(array $record)

+ 1 - 1
src/Monolog/Processor/WebProcessor.php

@@ -35,7 +35,7 @@ class WebProcessor
     }
 
     /**
-     * @param array $record
+     * @param  array $record
      * @return array
      */
     public function __invoke(array $record)

+ 0 - 2
tests/Monolog/Formatter/LineFormatterTest.php

@@ -11,8 +11,6 @@
 
 namespace Monolog\Formatter;
 
-use Monolog\Logger;
-
 /**
  * @covers Monolog\Formatter\LineFormatter
  */

+ 0 - 2
tests/Monolog/Formatter/NormalizerFormatterTest.php

@@ -11,8 +11,6 @@
 
 namespace Monolog\Formatter;
 
-use Monolog\Logger;
-
 /**
  * @covers Monolog\Formatter\NormalizerFormatter
  */

+ 2 - 2
tests/Monolog/Functional/Handler/FirePHPHandlerTest.php

@@ -9,11 +9,11 @@
  * file that was distributed with this source code.
  */
 
-spl_autoload_register(function($class)
-{
+spl_autoload_register(function($class) {
     $file = __DIR__.'/../../../../src/'.strtr($class, '\\', '/').'.php';
     if (file_exists($file)) {
         require $file;
+
         return true;
     }
 });

+ 1 - 1
tests/Monolog/Handler/ChromePHPHandlerTest.php

@@ -95,4 +95,4 @@ class TestChromePHPHandler extends ChromePHPHandler
     {
         return $this->headers;
     }
-}
+}

+ 1 - 1
tests/Monolog/Handler/FirePHPHandlerTest.php

@@ -91,4 +91,4 @@ class TestFirePHPHandler extends FirePHPHandler
     {
         return $this->headers;
     }
-}
+}

+ 1 - 0
tests/Monolog/Handler/GelfHandlerTest.php

@@ -38,6 +38,7 @@ class GelfHandlerTest extends TestCase
     protected function getHandler($messagePublisher)
     {
         $handler = new GelfHandler($messagePublisher);
+
         return $handler;
     }
 

+ 2 - 2
tests/Monolog/Handler/GelfMocks.php

@@ -16,11 +16,11 @@ use Gelf\Message;
 
 class MockMessagePublisher extends MessagePublisher
 {
-    public function publish(Message $message) {
+    public function publish(Message $message)
+    {
         $this->lastMessage = $message;
     }
 
     public $lastMessage = null;
 }
 
-

+ 1 - 1
tests/Monolog/Handler/MailHandlerTest.php

@@ -72,4 +72,4 @@ class MailHandlerTest extends TestCase
 
         $handler->handle($record);
     }
-}
+}

+ 2 - 1
tests/Monolog/Handler/MongoDBHandlerTest.php

@@ -48,7 +48,8 @@ class MongoDBHandlerTest extends TestCase
 }
 
 if (!class_exists('Mongo')) {
-    class Mongo {
+    class Mongo
+    {
         public function selectCollection() {}
     }
 }

+ 1 - 1
tests/Monolog/Handler/NullHandlerTest.php

@@ -30,4 +30,4 @@ class NullHandlerTest extends TestCase
         $handler = new NullHandler(Logger::WARNING);
         $this->assertFalse($handler->handle($this->getRecord(Logger::DEBUG)));
     }
-}
+}

+ 0 - 1
tests/Monolog/Handler/RotatingFileHandlerTest.php

@@ -12,7 +12,6 @@
 namespace Monolog\Handler;
 
 use Monolog\TestCase;
-use Monolog\Logger;
 
 /**
  * @covers Monolog\Handler\RotatingFileHandler

+ 8 - 9
tests/Monolog/Handler/SocketHandlerTest.php

@@ -120,12 +120,12 @@ class SocketHandlerTest extends TestCase
     {
         $this->setMockHandler(array('fwrite'));
 
-        $callback = function($arg)
-        {
+        $callback = function($arg) {
             $map = array(
                 'Hello world' => 6,
                 'world' => false,
             );
+
             return $map[$arg];
         };
 
@@ -143,12 +143,12 @@ class SocketHandlerTest extends TestCase
     {
         $this->setMockHandler(array('fwrite', 'streamGetMetadata'));
 
-        $callback = function($arg)
-        {
+        $callback = function($arg) {
             $map = array(
                 'Hello world' => 6,
                 'world' => 5,
             );
+
             return $map[$arg];
         };
 
@@ -159,7 +159,6 @@ class SocketHandlerTest extends TestCase
             ->method('streamGetMetadata')
             ->will($this->returnValue(array('timed_out' => true)));
 
-
         $this->writeRecord('Hello world');
     }
 
@@ -171,9 +170,9 @@ class SocketHandlerTest extends TestCase
         $this->setMockHandler(array('fwrite', 'streamGetMetadata'));
 
         $res = $this->res;
-        $callback = function($string) use ($res)
-        {
+        $callback = function($string) use ($res) {
             fclose($res);
+
             return strlen('Hello');
         };
 
@@ -201,12 +200,12 @@ class SocketHandlerTest extends TestCase
     {
         $this->setMockHandler(array('fwrite'));
 
-        $callback = function($arg)
-        {
+        $callback = function($arg) {
             $map = array(
                 'Hello world' => 6,
                 'world' => 5,
             );
+
             return $map[$arg];
         };
 

+ 0 - 2
tests/Monolog/Handler/SyslogHandlerTest.php

@@ -11,8 +11,6 @@
 
 namespace Monolog\Handler;
 
-use Monolog\Logger;
-
 class SyslogHandlerTest extends \PHPUnit_Framework_TestCase
 {
     /**

+ 1 - 0
tests/Monolog/LoggerTest.php

@@ -127,6 +127,7 @@ class LoggerTest extends \PHPUnit_Framework_TestCase
         $logger->pushHandler($handler);
         $logger->pushProcessor(function($record) {
             $record['extra']['win'] = true;
+
             return $record;
         });
         $logger->addError('test');

+ 5 - 4
tests/Monolog/Processor/IntrospectionProcessorTest.php

@@ -21,6 +21,7 @@ class IntrospectionProcessorTest extends TestCase
         $processor = new IntrospectionProcessor();
         $handler = new TestHandler();
         $handler->pushProcessor($processor);
+
         return $handler;
     }
 
@@ -31,7 +32,7 @@ class IntrospectionProcessorTest extends TestCase
         $tester->test($handler, $this->getRecord());
         list($record) = $handler->getRecords();
         $this->assertEquals(__FILE__, $record['extra']['file']);
-        $this->assertEquals(57, $record['extra']['line']);
+        $this->assertEquals(58, $record['extra']['line']);
         $this->assertEquals('Acme\Tester', $record['extra']['class']);
         $this->assertEquals('test', $record['extra']['function']);
     }
@@ -42,7 +43,7 @@ class IntrospectionProcessorTest extends TestCase
         \Acme\tester($handler, $this->getRecord());
         list($record) = $handler->getRecords();
         $this->assertEquals(__FILE__, $record['extra']['file']);
-        $this->assertEquals(63, $record['extra']['line']);
+        $this->assertEquals(64, $record['extra']['line']);
         $this->assertEquals(null, $record['extra']['class']);
         $this->assertEquals('Acme\tester', $record['extra']['function']);
     }
@@ -52,7 +53,7 @@ namespace Acme;
 
 class Tester
 {
-    function test($handler, $record)
+    public function test($handler, $record)
     {
         $handler->handle($record);
     }
@@ -61,4 +62,4 @@ class Tester
 function tester($handler, $record)
 {
     $handler->handle($record);
-}
+}