Browse Source

Fix name of varible,extera param

mehdi fathi 8 years ago
parent
commit
dc2f5a4da9
3 changed files with 9 additions and 10 deletions
  1. 1 2
      src/Log/Engine/BaseLog.php
  2. 7 7
      src/Log/Engine/FileLog.php
  3. 1 1
      tests/TestCase/Log/LogTest.php

+ 1 - 2
src/Log/Engine/BaseLog.php

@@ -84,10 +84,9 @@ abstract class BaseLog extends AbstractLogger
      * 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;

+ 7 - 7
src/Log/Engine/FileLog.php

@@ -182,23 +182,23 @@ class FileLog extends BaseLog
      */
     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) {

+ 1 - 1
tests/TestCase/Log/LogTest.php

@@ -126,7 +126,7 @@ class LogTest extends TestCase
     }
 
     /**
-     * test config() with valid key name
+     * test invalid level
      *
      * @expectedException \InvalidArgumentException
      * @return void