Browse Source

Merge pull request #10694 from mehdi-fathi/mehdi-fathi

Fix name of varible,extra params
Mark Story 8 years ago
parent
commit
184d4e4d81

+ 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) {

+ 2 - 2
src/View/Form/FormContext.php

@@ -135,9 +135,9 @@ class FormContext implements ContextInterface
     public function attributes($field)
     {
         $column = (array)$this->_form->schema()->field($field);
-        $whitelist = ['length' => null, 'precision' => null];
+        $whiteList = ['length' => null, 'precision' => null];
 
-        return array_intersect_key($column, $whitelist);
+        return array_intersect_key($column, $whiteList);
     }
 
     /**

+ 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

+ 6 - 0
tests/TestCase/View/Form/FormContextTest.php

@@ -25,6 +25,12 @@ use Cake\View\Form\FormContext;
  */
 class FormContextTest extends TestCase
 {
+    /**
+     * The request object.
+     *
+     * @var \Cake\Http\ServerRequest
+     */
+    protected $request;
 
     /**
      * setup method.