1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-08 06:06:40 +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'); 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;
} }
/** /**
@@ -97,7 +99,7 @@ abstract class AbstractHandler implements HandlerInterface
public function setFormatter(FormatterInterface $formatter) public function setFormatter(FormatterInterface $formatter)
{ {
$this->formatter = $formatter; $this->formatter = $formatter;
return $this; return $this;
} }
@@ -116,11 +118,14 @@ abstract class AbstractHandler implements HandlerInterface
/** /**
* Sets minimum logging level at which this handler will be triggered. * Sets minimum logging level at which this handler will be triggered.
* *
* @param integer $level * @param integer $level
* @return self
*/ */
public function setLevel($level) public function setLevel($level)
{ {
$this->level = $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. * @param Boolean $bubble True means that bubbling is not permitted.
* False means that this handler allows bubbling. * False means that this handler allows bubbling.
* @return self
*/ */
public function setBubble($bubble) public function setBubble($bubble)
{ {
$this->bubble = $bubble; $this->bubble = $bubble;
return $this;
} }
/** /**

View File

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

View File

@@ -28,12 +28,12 @@ class NativeMailerHandler extends MailHandler
protected $maxColumnWidth; protected $maxColumnWidth;
/** /**
* @param string|array $to The receiver of the mail * @param string|array $to The receiver of the mail
* @param string $subject The subject of the mail * @param string $subject The subject of the mail
* @param string $from The sender 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 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 $bubble Whether the messages that are handled can bubble up the stack or not
* @param int $maxColumnWidth The maximum column width that the message lines will have * @param int $maxColumnWidth The maximum column width that the message lines will have
*/ */
public function __construct($to, $subject, $from, $level = Logger::ERROR, $bubble = true, $maxColumnWidth = 70) public function __construct($to, $subject, $from, $level = Logger::ERROR, $bubble = true, $maxColumnWidth = 70)
{ {

View File

@@ -43,7 +43,7 @@ class PushoverHandler extends SocketHandler
* sending "high priority" requests to the Pushover API * sending "high priority" requests to the Pushover API
* @param integer $emergencyLevel The minimum logging level at which this handler will start * @param integer $emergencyLevel The minimum logging level at which this handler will start
* sending "emergency" requests to the Pushover API * 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 $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 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) public function __construct($token, $users, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $highPriorityLevel = Logger::CRITICAL, $emergencyLevel = Logger::EMERGENCY, $retry = 30, $expire = 25200)