Browse Source

Deprecated normalizePath to fix it in the new method normalizeFullPath.
Added some directives for code analysis (Change directive writing x2 for Travis CI).
Added deprecationWarning, and suppress noinspection directive for
deprecation

AlPri78 7 years ago
parent
commit
9172828b83
2 changed files with 1 additions and 6 deletions
  1. 1 0
      src/Filesystem/Folder.php
  2. 0 6
      tests/TestCase/Filesystem/FolderTest.php

+ 1 - 0
src/Filesystem/Folder.php

@@ -359,6 +359,7 @@ class Folder
      */
     public static function normalizePath($path)
     {
+        deprecationWarning('Folder::normalizePath() is deprecated. Use Folder::correctSlashFor() instead.');
         return Folder::correctSlashFor($path);
     }
 

+ 0 - 6
tests/TestCase/Filesystem/FolderTest.php

@@ -686,17 +686,14 @@ class FolderTest extends TestCase
     public function testNormalizePath()
     {
         $path = '/path/to/file';
-        /** @noinspection PhpDeprecationInspection */
         $result = Folder::normalizePath($path);
         $this->assertEquals('/', $result);
 
         $path = '\\path\\\to\\\file';
-        /** @noinspection PhpDeprecationInspection */
         $result = Folder::normalizePath($path);
         $this->assertEquals('/', $result);
 
         $path = 'C:\\path\\to\\file';
-        /** @noinspection PhpDeprecationInspection */
         $result = Folder::normalizePath($path);
         $this->assertEquals('\\', $result);
     }
@@ -756,19 +753,16 @@ class FolderTest extends TestCase
             $Folder = new Folder();
             $Folder->cd(ROOT);
             $path = 'C:\\path\\to\\file';
-            /** @noinspection PhpDeprecationInspection */
             $result = $Folder->inCakePath($path);
             $this->assertFalse($result);
 
             $path = ROOT;
             $Folder->cd(ROOT);
-            /** @noinspection PhpDeprecationInspection */
             $result = $Folder->inCakePath($path);
             $this->assertFalse($result);
 
             $path = DS . 'config';
             $Folder->cd(ROOT . DS . 'config');
-            /** @noinspection PhpDeprecationInspection */
             $result = $Folder->inCakePath($path);
             $this->assertTrue($result);
         });