diff --git a/src/Monolog/Handler/ChromePHPHandler.php b/src/Monolog/Handler/ChromePHPHandler.php index fd832a76..38196c22 100644 --- a/src/Monolog/Handler/ChromePHPHandler.php +++ b/src/Monolog/Handler/ChromePHPHandler.php @@ -40,21 +40,6 @@ class ChromePHPHandler extends AbstractProcessingHandler protected static $sendHeaders = true; - /** - * pointer to the static sendHeaders for BC - */ - protected $sendHeaders; - - /** - * @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) - { - parent::__construct($level, $bubble); - $this->sendHeaders =& static::$sendHeaders; - } - /** * {@inheritdoc} */ @@ -138,4 +123,28 @@ class ChromePHPHandler extends AbstractProcessingHandler return !isset($_SERVER['HTTP_USER_AGENT']) || preg_match('{\bChrome/\d+[\.\d+]*\b}', $_SERVER['HTTP_USER_AGENT']); } + + /** + * BC getter for the sendHeaders property that has been made static + */ + public function __get($property) + { + if ('sendHeaders' !== $property) { + throw new \InvalidArgumentException('Undefined property '.$property); + } + + return static::$sendHeaders; + } + + /** + * BC setter for the sendHeaders property that has been made static + */ + public function __set($property, $value) + { + if ('sendHeaders' !== $property) { + throw new \InvalidArgumentException('Undefined property '.$property); + } + + static::$sendHeaders = $value; + } } diff --git a/src/Monolog/Handler/FirePHPHandler.php b/src/Monolog/Handler/FirePHPHandler.php index b9f904dd..46a039ad 100644 --- a/src/Monolog/Handler/FirePHPHandler.php +++ b/src/Monolog/Handler/FirePHPHandler.php @@ -53,21 +53,6 @@ class FirePHPHandler extends AbstractProcessingHandler protected static $sendHeaders = true; - /** - * pointer to the static sendHeaders for BC - */ - protected $sendHeaders; - - /** - * @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) - { - parent::__construct($level, $bubble); - $this->sendHeaders =& static::$sendHeaders; - } - /** * Base header creation function used by init headers & record headers * @@ -172,4 +157,28 @@ class FirePHPHandler extends AbstractProcessingHandler || preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT']) || isset($_SERVER['HTTP_X_FIREPHP_VERSION']); } + + /** + * BC getter for the sendHeaders property that has been made static + */ + public function __get($property) + { + if ('sendHeaders' !== $property) { + throw new \InvalidArgumentException('Undefined property '.$property); + } + + return static::$sendHeaders; + } + + /** + * BC setter for the sendHeaders property that has been made static + */ + public function __set($property, $value) + { + if ('sendHeaders' !== $property) { + throw new \InvalidArgumentException('Undefined property '.$property); + } + + static::$sendHeaders = $value; + } }