Passed
Push — master ( b3b99f...4489d6 )
by 世昌
01:46
created
nebula/src/application/helper/DirectoryHelper.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -94,11 +94,11 @@  discard block
 block discarded – undo
94 94
      * @param boolean $full
95 95
      * @return \Iterator
96 96
      */
97
-    public static function readFiles(string $path, bool $recursive=false, ?string $regex=null, bool $full=true, int $mode = RecursiveIteratorIterator::LEAVES_ONLY) : \Iterator
97
+    public static function readFiles(string $path, bool $recursive = false, ?string $regex = null, bool $full = true, int $mode = RecursiveIteratorIterator::LEAVES_ONLY) : \Iterator
98 98
     {
99 99
         $parent = Path::format($path);
100 100
         foreach (static::read($path, $recursive, $regex, false, $mode) as $subpath) {
101
-            $path = $full?$subpath:$parent.DIRECTORY_SEPARATOR.$subpath;
101
+            $path = $full ? $subpath : $parent.DIRECTORY_SEPARATOR.$subpath;
102 102
             if (is_file($path)) {
103 103
                 yield $subpath;
104 104
             }
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
      * @param boolean $full
115 115
      * @return \Iterator
116 116
      */
117
-    public static function readDirs(string $path, bool $recursive=false, ?string $regex=null, bool $full=false, int $mode = RecursiveIteratorIterator::LEAVES_ONLY): \Iterator
117
+    public static function readDirs(string $path, bool $recursive = false, ?string $regex = null, bool $full = false, int $mode = RecursiveIteratorIterator::LEAVES_ONLY): \Iterator
118 118
     {
119 119
         $parent = Path::format($path);
120 120
         foreach (static::read($path, $recursive, $regex, false, $mode) as $subpath) {
121
-            $path = $full?$subpath:$parent.DIRECTORY_SEPARATOR.$subpath;
121
+            $path = $full ? $subpath : $parent.DIRECTORY_SEPARATOR.$subpath;
122 122
             if (is_dir($path)) {
123 123
                 yield $subpath;
124 124
             }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      * @param boolean $full
135 135
      * @return \Iterator
136 136
      */
137
-    public static function read(string $path, bool $recursive=false, ?string $regex=null, bool $full=true, int $mode = RecursiveIteratorIterator::LEAVES_ONLY): \Iterator
137
+    public static function read(string $path, bool $recursive = false, ?string $regex = null, bool $full = true, int $mode = RecursiveIteratorIterator::LEAVES_ONLY): \Iterator
138 138
     {
139 139
         $directory = Path::format($path);
140 140
         if ($directory && \is_dir($directory)) {
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     }
151 151
     
152 152
 
153
-    protected static function buildIterator(string $directory, bool $recursive=false, ?string $regex = null, int $mode): \Iterator
153
+    protected static function buildIterator(string $directory, bool $recursive = false, ?string $regex = null, int $mode): \Iterator
154 154
     {
155 155
         $it = new \RecursiveDirectoryIterator($directory, \RecursiveDirectoryIterator::SKIP_DOTS);
156 156
         if ($regex !== null) {
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      */
172 172
     public static function cut(string $path, string $basepath):string
173 173
     {
174
-        $path =  PathTrait::toAbsolutePath($path);
174
+        $path = PathTrait::toAbsolutePath($path);
175 175
         $basepath = PathTrait::toAbsolutePath($basepath);
176 176
         if (strpos($path, $basepath.DIRECTORY_SEPARATOR) === 0) {
177 177
             return substr($path, \strlen($basepath) + 1);
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
      * @param boolean $move
189 189
      * @return boolean
190 190
      */
191
-    public static function copy(string $path, string $toPath, ?string $regex=null, bool $move = false):bool
191
+    public static function copy(string $path, string $toPath, ?string $regex = null, bool $move = false):bool
192 192
     {
193 193
         $directory = Path::format($path);
194 194
         static::makes($toPath);
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
      * @param string|null $regex
228 228
      * @return boolean
229 229
      */
230
-    public static function move(string $path, string $toPath, ?string $regex=null):bool
230
+    public static function move(string $path, string $toPath, ?string $regex = null):bool
231 231
     {
232 232
         return static::copy($path, $toPath, $regex, true);
233 233
     }
Please login to merge, or discard this patch.