Browse Source

Fix up commenting and formatting.

Mark Story 8 years ago
parent
commit
4323074a66
2 changed files with 7 additions and 7 deletions
  1. 1 1
      src/Filesystem/File.php
  2. 6 6
      tests/TestCase/Filesystem/FileTest.php

+ 1 - 1
src/Filesystem/File.php

@@ -363,7 +363,7 @@ class File
      */
     protected static function _basename($path, $ext = null)
     {
-        //check for multibyte string and use basename() if not found
+        // check for multibyte string and use basename() if not found
         if (mb_strlen($path) === strlen($path)) {
             return ($ext === null)? basename($path) : basename($path, $ext);
         }

+ 6 - 6
tests/TestCase/Filesystem/FileTest.php

@@ -140,6 +140,7 @@ class FileTest extends TestCase
 
     /**
      * Test _basename method
+     *
      * @dataProvider baseNameValueProvider
      * @return void
      */
@@ -150,22 +151,21 @@ class FileTest extends TestCase
         }
         $File = new File($path, false);
 
-        //some of paths is directory like '/etc/sudoers.d'
+        // some paths are directories like '/etc/sudoers.d'
         if (!is_dir($path)) {
-            //test the name after running __construct()
+            // Check the name after running __construct()
             $result = $File->name;
             $expecting = basename($path);
             $this->assertEquals($expecting, $result);
         }
 
-        //test the name()
+        // Check name()
         $splInfo = new SplFileInfo($path);
         $File->name = ltrim($splInfo->getFilename(), '/\\');
         if ($suffix === null) {
             $File->info();//to set and unset 'extension' in bellow
-            if (isset($File->info['extension'])) {
-                unset($File->info['extension']);
-            }
+            unset($File->info['extension']);
+
             $this->assertEquals(basename($path), $File->name());
         } else {
             $File->info['extension'] = $suffix;