From dc2f5a4da9591457ab376af57921eecb9ba41209 Mon Sep 17 00:00:00 2001 From: mehdi fathi Date: Thu, 25 May 2017 23:10:26 +0430 Subject: [PATCH] Fix name of varible,extera param --- src/Log/Engine/BaseLog.php | 3 +-- src/Log/Engine/FileLog.php | 14 +++++++------- tests/TestCase/Log/LogTest.php | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Log/Engine/BaseLog.php b/src/Log/Engine/BaseLog.php index 9954368d60b..499e9977400 100644 --- a/src/Log/Engine/BaseLog.php +++ b/src/Log/Engine/BaseLog.php @@ -84,10 +84,9 @@ public function scopes() * or add additional info to the logged message. * * @param mixed $data The data to be converted to string and logged. - * @param array $context Additional logging information for the message. * @return string */ - protected function _format($data, array $context = []) + protected function _format($data) { if (is_string($data)) { return $data; diff --git a/src/Log/Engine/FileLog.php b/src/Log/Engine/FileLog.php index 7ba0cd70e9e..f77d2162d08 100644 --- a/src/Log/Engine/FileLog.php +++ b/src/Log/Engine/FileLog.php @@ -182,23 +182,23 @@ protected function _getFilename($level) */ protected function _rotateFile($filename) { - $filepath = $this->_path . $filename; - clearstatcache(true, $filepath); + $filePath = $this->_path . $filename; + clearstatcache(true, $filePath); - if (!file_exists($filepath) || - filesize($filepath) < $this->_size + if (!file_exists($filePath) || + filesize($filePath) < $this->_size ) { return null; } $rotate = $this->_config['rotate']; if ($rotate === 0) { - $result = unlink($filepath); + $result = unlink($filePath); } else { - $result = rename($filepath, $filepath . '.' . time()); + $result = rename($filePath, $filePath . '.' . time()); } - $files = glob($filepath . '.*'); + $files = glob($filePath . '.*'); if ($files) { $filesToDelete = count($files) - $rotate; while ($filesToDelete > 0) { diff --git a/tests/TestCase/Log/LogTest.php b/tests/TestCase/Log/LogTest.php index 8eb15178439..c7e9945977d 100644 --- a/tests/TestCase/Log/LogTest.php +++ b/tests/TestCase/Log/LogTest.php @@ -126,7 +126,7 @@ public function testDrop() } /** - * test config() with valid key name + * test invalid level * * @expectedException \InvalidArgumentException * @return void