1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-10 23:24:02 +02:00

Fix CS and add chainability to a few more setter methods, refs #221

This commit is contained in:
Jordi Boggiano
2013-08-09 14:12:38 +02:00
parent 07868bfc7e
commit 7a8844d4db
4 changed files with 21 additions and 11 deletions

View File

@@ -77,6 +77,8 @@ abstract class AbstractHandler implements HandlerInterface
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);
return $this;
}
/**
@@ -117,10 +119,13 @@ abstract class AbstractHandler implements HandlerInterface
* Sets minimum logging level at which this handler will be triggered.
*
* @param integer $level
* @return self
*/
public function setLevel($level)
{
$this->level = $level;
return $this;
}
/**
@@ -138,10 +143,13 @@ abstract class AbstractHandler implements HandlerInterface
*
* @param Boolean $bubble True means that bubbling is not permitted.
* False means that this handler allows bubbling.
* @return self
*/
public function setBubble($bubble)
{
$this->bubble = $bubble;
return $this;
}
/**

View File

@@ -62,6 +62,7 @@ interface HandlerInterface
* Adds a processor in the stack.
*
* @param callable $callback
* @return self
*/
public function pushProcessor($callback);
@@ -76,6 +77,7 @@ interface HandlerInterface
* Sets the formatter.
*
* @param FormatterInterface $formatter
* @return self
*/
public function setFormatter(FormatterInterface $formatter);