From e059c441e0fb025e5b70b115ca5df064ad2c966b Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 6 May 2011 19:47:27 +0200 Subject: [PATCH 1/2] Fixed CS and phpdoc --- src/Monolog/Formatter/WildfireFormatter.php | 2 +- src/Monolog/Handler/FirePHPHandler.php | 5 +++-- tests/Monolog/Formatter/WildfireFormatterTest.php | 2 -- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Monolog/Formatter/WildfireFormatter.php b/src/Monolog/Formatter/WildfireFormatter.php index e51bbfab..823d8b00 100644 --- a/src/Monolog/Formatter/WildfireFormatter.php +++ b/src/Monolog/Formatter/WildfireFormatter.php @@ -49,7 +49,7 @@ class WildfireFormatter extends LineFormatter implements FormatterInterface /** * {@inheritdoc} */ - public function format(Array $record) + public function format(array $record) { // Format record according with LineFormatter $formatted = parent::format($record); diff --git a/src/Monolog/Handler/FirePHPHandler.php b/src/Monolog/Handler/FirePHPHandler.php index 3ad2f6f3..fca99b73 100644 --- a/src/Monolog/Handler/FirePHPHandler.php +++ b/src/Monolog/Handler/FirePHPHandler.php @@ -67,7 +67,7 @@ class FirePHPHandler extends AbstractHandler * * @param array $meta Wildfire Plugin, Protocol & Structure Indexes * @param string $message Log message - * @return string Complete header string ready for the client + * @return array Complete header string ready for the client as key and message as value */ protected function createHeader(array $meta, $message) { @@ -81,6 +81,7 @@ class FirePHPHandler extends AbstractHandler * * @see createHeader() * @param array $record + * @return string */ protected function createRecordHeader(array $record) { @@ -102,7 +103,7 @@ class FirePHPHandler extends AbstractHandler * * @see createHeader() * @see sendHeader() - * @return Array + * @return array */ protected function getInitHeaders() { diff --git a/tests/Monolog/Formatter/WildfireFormatterTest.php b/tests/Monolog/Formatter/WildfireFormatterTest.php index b2dfa924..2ccb54dd 100644 --- a/tests/Monolog/Formatter/WildfireFormatterTest.php +++ b/tests/Monolog/Formatter/WildfireFormatterTest.php @@ -15,7 +15,6 @@ use Monolog\Logger; class WildfireFormatterTest extends \PHPUnit_Framework_TestCase { - /** * @dataProvider recordProvider */ @@ -46,5 +45,4 @@ class WildfireFormatterTest extends \PHPUnit_Framework_TestCase array($record), ); } - } From 708d799e1d433aaffdbb6dbcaa684af44c761a9e Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 6 May 2011 19:48:34 +0200 Subject: [PATCH 2/2] Simplified code --- src/Monolog/Formatter/LineFormatter.php | 4 ++-- src/Monolog/Formatter/WildfireFormatter.php | 9 --------- src/Monolog/Handler/FirePHPHandler.php | 10 ---------- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/Monolog/Formatter/LineFormatter.php b/src/Monolog/Formatter/LineFormatter.php index cce3e329..efb2e492 100644 --- a/src/Monolog/Formatter/LineFormatter.php +++ b/src/Monolog/Formatter/LineFormatter.php @@ -34,8 +34,8 @@ class LineFormatter implements FormatterInterface */ public function __construct($format = null, $dateFormat = null) { - $this->format = $format ?: self::SIMPLE_FORMAT; - $this->dateFormat = $dateFormat ?: self::SIMPLE_DATE; + $this->format = $format ?: static::SIMPLE_FORMAT; + $this->dateFormat = $dateFormat ?: static::SIMPLE_DATE; } /** diff --git a/src/Monolog/Formatter/WildfireFormatter.php b/src/Monolog/Formatter/WildfireFormatter.php index 823d8b00..53e81ce9 100644 --- a/src/Monolog/Formatter/WildfireFormatter.php +++ b/src/Monolog/Formatter/WildfireFormatter.php @@ -37,15 +37,6 @@ class WildfireFormatter extends LineFormatter implements FormatterInterface Logger::ALERT => 'ERROR', ); - /** - * {@inheritdoc} - */ - public function __construct($format = null, $dateFormat = null) - { - $this->format = $format ?: self::SIMPLE_FORMAT; - $this->dateFormat = $dateFormat ?: self::SIMPLE_DATE; - } - /** * {@inheritdoc} */ diff --git a/src/Monolog/Handler/FirePHPHandler.php b/src/Monolog/Handler/FirePHPHandler.php index fca99b73..9d568029 100644 --- a/src/Monolog/Handler/FirePHPHandler.php +++ b/src/Monolog/Handler/FirePHPHandler.php @@ -52,16 +52,6 @@ class FirePHPHandler extends AbstractHandler */ protected static $messageIndex = 1; - /** - * @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 = false) - { - $this->level = $level; - $this->bubble = $bubble; - } - /** * Base header creation function used by init headers & record headers *