From 0f4401891edfe73a59179f5020731811736335d5 Mon Sep 17 00:00:00 2001 From: "Birkir A. Barkarson" Date: Fri, 11 Oct 2013 14:58:39 +0900 Subject: [PATCH] Fixes based on comments. - Change function to private. - Use private variable correctly. --- src/Monolog/Handler/StreamHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Monolog/Handler/StreamHandler.php b/src/Monolog/Handler/StreamHandler.php index 66c36acc..521b5751 100644 --- a/src/Monolog/Handler/StreamHandler.php +++ b/src/Monolog/Handler/StreamHandler.php @@ -61,7 +61,7 @@ class StreamHandler extends AbstractProcessingHandler if (!$this->url) { throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().'); } - $errorMessage = null; + $this->errorMessage = null; set_error_handler(array($this, 'customErrorHandler')); $this->stream = fopen($this->url, 'a'); restore_error_handler(); @@ -73,7 +73,7 @@ class StreamHandler extends AbstractProcessingHandler fwrite($this->stream, (string) $record['formatted']); } - protected function customErrorHandler($code, $msg) { + private function customErrorHandler($code, $msg) { $this->errorMessage = preg_replace('{^fopen\(.*?\): }', '', $msg); } }