2
0
Эх сурвалжийг харах

Merge pull request #561 from rkrx/patch-1

Added self-referenced returns to get fluent interfaces
Jordi Boggiano 10 жил өмнө
parent
commit
72123e3d6c

+ 4 - 0
src/Monolog/Logger.php

@@ -152,10 +152,12 @@ class Logger implements LoggerInterface
      * Pushes a handler on to the stack.
      * Pushes a handler on to the stack.
      *
      *
      * @param HandlerInterface $handler
      * @param HandlerInterface $handler
+     * @return $this
      */
      */
     public function pushHandler(HandlerInterface $handler)
     public function pushHandler(HandlerInterface $handler)
     {
     {
         array_unshift($this->handlers, $handler);
         array_unshift($this->handlers, $handler);
+        return $this;
     }
     }
 
 
     /**
     /**
@@ -184,6 +186,7 @@ class Logger implements LoggerInterface
      * Adds a processor on to the stack.
      * Adds a processor on to the stack.
      *
      *
      * @param callable $callback
      * @param callable $callback
+     * @return $this
      */
      */
     public function pushProcessor($callback)
     public function pushProcessor($callback)
     {
     {
@@ -191,6 +194,7 @@ class Logger implements LoggerInterface
             throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given');
             throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given');
         }
         }
         array_unshift($this->processors, $callback);
         array_unshift($this->processors, $callback);
+        return $this;
     }
     }
 
 
     /**
     /**