Passed
Push — master ( fe1bfe...d29151 )
by Giuliano
02:24
created
src/Foundation/FileSearch.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function files(string $pattern = null) : array
30 30
     {
31
-        $pattern = "/". $pattern ."/";
31
+        $pattern = "/" . $pattern . "/";
32 32
 
33 33
         $this->scan($this->path(), $pattern);
34 34
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     private function setPath(string $path) : FileSearch
100 100
     {
101
-        if (! is_dir($path)) {
101
+        if (!is_dir($path)) {
102 102
             throw new Exception('Path not found.');
103 103
         }
104 104
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@
 block discarded – undo
45 45
     {
46 46
         $items = array_diff(scandir($path), array('.', '..'));
47 47
 
48
-        foreach ($items as $item) { 
48
+        foreach ($items as $item) {
49 49
 
50 50
             $item = "$path/$item";
51 51
 
52
-            if (is_dir($item)) { 
52
+            if (is_dir($item)) {
53 53
                 return $this->scan($item, $pattern);
54 54
             }            
55 55
 
Please login to merge, or discard this patch.
src/Foundation/FolderReader.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
     static public function read(string $path, int $level) : array
10 10
     {        
11
-        if (! is_dir($path)) return [];
11
+        if (!is_dir($path)) return [];
12 12
         
13 13
         self::scan($path, 1, $level);
14 14
         
@@ -31,18 +31,18 @@  discard block
 block discarded – undo
31 31
 
32 32
     static private function scan(string $path, int $step, int $level) : void
33 33
     {
34
-        $items  = array_diff(scandir($path), array('.', '..'));        
34
+        $items = array_diff(scandir($path), array('.', '..'));        
35 35
         
36
-        foreach($items as $item) {
36
+        foreach ($items as $item) {
37 37
 
38 38
             $folder = "$path/$item"; 
39 39
 
40
-            if (! is_dir($folder)) {
40
+            if (!is_dir($folder)) {
41 41
                 continue;
42 42
             }
43 43
             
44 44
             if (is_dir($folder) && $step < $level) {
45
-                self::scan($folder, $step+1, $level);
45
+                self::scan($folder, $step + 1, $level);
46 46
             }
47 47
 
48 48
             if ($step == $level) {
Please login to merge, or discard this patch.