@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | static public function join(...$pieces) |
20 | 20 | { |
21 | 21 | $separator = DIRECTORY_SEPARATOR; |
22 | - $prefix = ($separator == substr($pieces[0],0,1)) ? $separator : ''; |
|
22 | + $prefix = ($separator == substr($pieces[0], 0, 1)) ? $separator : ''; |
|
23 | 23 | foreach ($pieces as &$piece) { |
24 | 24 | $piece = trim($piece, $separator); |
25 | 25 | } |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | if (!mkdir($dest, $mode, true)) { |
54 | 54 | return false; |
55 | 55 | } |
56 | - while(false !== ( $file = readdir($dir)) ) { |
|
56 | + while (false !== ($file = readdir($dir))) { |
|
57 | 57 | if (($file == '.') || ($file == '..')) { |
58 | 58 | continue; |
59 | 59 | } |
60 | - if (is_dir($source . '/' . $file) ) { |
|
60 | + if (is_dir($source . '/' . $file)) { |
|
61 | 61 | if (!static::cp($source . '/' . $file, $dest . '/' . $file)) { |
62 | 62 | return false; |
63 | 63 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | if (!$dir = opendir($path)) { |
96 | 96 | return false; |
97 | 97 | } |
98 | - while(false !== ( $file = readdir($dir)) ) { |
|
98 | + while (false !== ($file = readdir($dir))) { |
|
99 | 99 | if (($file == '.') || ($file == '..')) { |
100 | 100 | continue; |
101 | 101 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | if (!unlink($thisPath)) { |
105 | 105 | return false; |
106 | 106 | } |
107 | - } else if (is_dir($thisPath) ) { |
|
107 | + } else if (is_dir($thisPath)) { |
|
108 | 108 | if (!static::rm($thisPath)) { |
109 | 109 | return false; |
110 | 110 | } |
@@ -61,8 +61,7 @@ discard block |
||
61 | 61 | if (!static::cp($source . '/' . $file, $dest . '/' . $file)) { |
62 | 62 | return false; |
63 | 63 | } |
64 | - } |
|
65 | - else { |
|
64 | + } else { |
|
66 | 65 | if (!copy($source . '/' . $file, $dest . '/' . $file)) { |
67 | 66 | return false; |
68 | 67 | } |
@@ -108,8 +107,7 @@ discard block |
||
108 | 107 | if (!static::rm($thisPath)) { |
109 | 108 | return false; |
110 | 109 | } |
111 | - } |
|
112 | - else { |
|
110 | + } else { |
|
113 | 111 | if (!unlink($thisPath)) { |
114 | 112 | return false; |
115 | 113 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | // [2.0] |
96 | 96 | if ('f' == mb_substr($string, -1) || 'fe' == mb_substr($string, -2)) { |
97 | - $length = ('e' == mb_substr($string, -1)) ? -2 : -1 ; |
|
97 | + $length = ('e' == mb_substr($string, -1)) ? -2 : -1; |
|
98 | 98 | return mb_substr($string, 0, $length) . 'ves'; |
99 | 99 | } |
100 | 100 | |
@@ -325,8 +325,8 @@ discard block |
||
325 | 325 | */ |
326 | 326 | static public function moustaches(string $template, array $params) |
327 | 327 | { |
328 | - $keys = array_map(function ($value) { |
|
329 | - return '{'.$value.'}'; |
|
328 | + $keys = array_map(function($value) { |
|
329 | + return '{' . $value . '}'; |
|
330 | 330 | }, array_keys($params)); |
331 | 331 | $values = array_values($params); |
332 | 332 |