Test Failed
Push — master ( c6159a...ad222e )
by Sebastian
03:11
created
src/Request/URLComparer.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     
82 82
     public function addLimitParam(string $name) : Request_URLComparer
83 83
     {
84
-        if(!in_array($name, $this->limitParams, true))
84
+        if (!in_array($name, $this->limitParams, true))
85 85
         {
86 86
             $this->limitParams[] = $name;
87 87
         }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      */
96 96
     public function addLimitParams(array $names) : Request_URLComparer
97 97
     {
98
-        foreach($names as $name)
98
+        foreach ($names as $name)
99 99
         {
100 100
             $this->addLimitParam($name);
101 101
         }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         return $this;
104 104
     }
105 105
     
106
-    public function setIgnoreFragment(bool $ignore=true) : Request_URLComparer
106
+    public function setIgnoreFragment(bool $ignore = true) : Request_URLComparer
107 107
     {
108 108
         $this->ignoreFragment = $ignore;
109 109
         return $this;
@@ -126,13 +126,13 @@  discard block
 block discarded – undo
126 126
             'query' 
127 127
         );
128 128
         
129
-        if(!$this->ignoreFragment) {
129
+        if (!$this->ignoreFragment) {
130 130
             $keys[] = 'fragment';
131 131
         }
132 132
         
133
-        foreach($keys as $key)
133
+        foreach ($keys as $key)
134 134
         {
135
-            if(!$this->compareKey($key)) {
135
+            if (!$this->compareKey($key)) {
136 136
                 return false;
137 137
             }
138 138
         }
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         
148 148
         $filter = 'filter_'.$key;
149 149
         
150
-        if(method_exists($this, $filter)) 
150
+        if (method_exists($this, $filter)) 
151 151
         {
152 152
             $sVal = $this->$filter($sVal);
153 153
             $tVal = $this->$filter($tVal);
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     protected function filter_path(string $path) : string
160 160
     {
161 161
         // fix double slashes in URLs
162
-        while(strpos($path, '//') !== false)
162
+        while (strpos($path, '//') !== false)
163 163
         {
164 164
             $path = str_replace('//', '/', $path);
165 165
         }
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     
170 170
     protected function filter_query(string $query) : string
171 171
     {
172
-        if(empty($query)) {
172
+        if (empty($query)) {
173 173
             return '';
174 174
         }
175 175
         
@@ -188,15 +188,15 @@  discard block
 block discarded – undo
188 188
      */
189 189
     protected function limitParams(array $params) : array
190 190
     {
191
-        if(empty($this->limitParams)) {
191
+        if (empty($this->limitParams)) {
192 192
             return $params;
193 193
         }
194 194
         
195 195
         $keep = array();
196 196
         
197
-        foreach($this->limitParams as $name)
197
+        foreach ($this->limitParams as $name)
198 198
         {
199
-            if(isset($params[$name])) {
199
+            if (isset($params[$name])) {
200 200
                 $keep[$name] = $params[$name];
201 201
             }
202 202
         }
Please login to merge, or discard this patch.
src/functions.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
  * @param bool $forceNew
13 13
  * @return NumberInfo
14 14
  */
15
-function parseNumber($value, bool $forceNew=false)
15
+function parseNumber($value, bool $forceNew = false)
16 16
 {
17
-    if($value instanceof NumberInfo && $forceNew !== true) {
17
+    if ($value instanceof NumberInfo && $forceNew !== true) {
18 18
         return $value;
19 19
     }
20 20
     
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     $args = func_get_args();
110 110
     
111 111
     // is the localization package installed?
112
-    if(function_exists('\AppLocalize\t'))
112
+    if (function_exists('\AppLocalize\t'))
113 113
     {
114 114
         return call_user_func_array('\AppLocalize\t', $args);
115 115
     }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
  * @param bool $initial The initial boolean value to use.
125 125
  * @return Value_Bool
126 126
  */
127
-function valBool(bool $initial=false) : Value_Bool
127
+function valBool(bool $initial = false) : Value_Bool
128 128
 {
129 129
     return new Value_Bool($initial);
130 130
 }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
  * @param bool $initial
138 138
  * @return Value_Bool_True
139 139
  */
140
-function valBoolTrue(bool $initial=false) : Value_Bool_True
140
+function valBoolTrue(bool $initial = false) : Value_Bool_True
141 141
 {
142 142
     return new Value_Bool_True($initial);
143 143
 }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
  * @param bool $initial
151 151
  * @return Value_Bool_False
152 152
  */
153
-function valBoolFalse(bool $initial=true) : Value_Bool_False
153
+function valBoolFalse(bool $initial = true) : Value_Bool_False
154 154
 {
155 155
     return new Value_Bool_False($initial);
156 156
 }
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
  */
182 182
 function init() : void
183 183
 {
184
-    if(!class_exists('\AppLocalize\Localization')) {
184
+    if (!class_exists('\AppLocalize\Localization')) {
185 185
         return;
186 186
     }
187 187
     
Please login to merge, or discard this patch.
src/ConvertHelper.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      * @param int $tabSize The amount of spaces per tab.
56 56
      * @return string
57 57
      */
58
-    public static function tabs2spaces(string $string, int $tabSize=4) : string
58
+    public static function tabs2spaces(string $string, int $tabSize = 4) : string
59 59
     {
60 60
         return ConvertHelper_String::tabs2spaces($string, $tabSize);
61 61
     }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     * @param int $tabSize The amount of spaces per tab in the source string.
68 68
     * @return string
69 69
     */
70
-    public static function spaces2tabs(string $string, int $tabSize=4) : string
70
+    public static function spaces2tabs(string $string, int $tabSize = 4) : string
71 71
     {
72 72
         return ConvertHelper_String::spaces2tabs($string, $tabSize);
73 73
     }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     * @deprecated Use the Highlighter class directly instead.
141 141
     * @see Highlighter::xml()
142 142
     */
143
-    public static function highlight_xml(string $xml, bool $formatSource=false) : string
143
+    public static function highlight_xml(string $xml, bool $formatSource = false) : string
144 144
     {
145 145
         return Highlighter::xml($xml, $formatSource);
146 146
     }
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
      * @param bool $html
207 207
      * @return string
208 208
      */
209
-    public static function var_dump($var, bool $html=true) : string
209
+    public static function var_dump($var, bool $html = true) : string
210 210
     {
211 211
         $info = parseVariable($var);
212 212
         
213
-        if($html) {
213
+        if ($html) {
214 214
             return $info->toHTML();
215 215
         }
216 216
         
@@ -225,11 +225,11 @@  discard block
 block discarded – undo
225 225
     * @param bool $html Whether to style the dump as HTML.
226 226
     * @return string
227 227
     */
228
-    public static function print_r($var, bool $return=false, bool $html=true) : string
228
+    public static function print_r($var, bool $return = false, bool $html = true) : string
229 229
     {
230 230
         $result = parseVariable($var)->enableType()->toString();
231 231
         
232
-        if($html) 
232
+        if ($html) 
233 233
         {
234 234
             $result = 
235 235
             '<pre style="background:#fff;color:#333;padding:16px;border:solid 1px #bbb;border-radius:4px">'.
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             '</pre>';
238 238
         }
239 239
         
240
-        if(!$return) 
240
+        if (!$return) 
241 241
         {
242 242
             echo $result;
243 243
         }
@@ -419,12 +419,12 @@  discard block
 block discarded – undo
419 419
         $output = '';
420 420
         $split = str_split($unicodeChar);
421 421
         
422
-        foreach($split as $octet) 
422
+        foreach ($split as $octet) 
423 423
         {
424 424
             $ordInt = ord($octet);
425 425
             // Convert from int (base 10) to hex (base 16), for PHP \x syntax
426 426
             $ordHex = base_convert((string)$ordInt, 10, 16);
427
-            $output .= '\x' . $ordHex;
427
+            $output .= '\x'.$ordHex;
428 428
         }
429 429
         
430 430
         return $output;
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
     * 
639 639
     * @see JSHelper::buildRegexStatement()
640 640
     */
641
-    public static function regex2js(string $regex, string $statementType=JSHelper::JS_REGEX_OBJECT) : string
641
+    public static function regex2js(string $regex, string $statementType = JSHelper::JS_REGEX_OBJECT) : string
642 642
     {
643 643
         return JSHelper::buildRegexStatement($regex, $statementType);
644 644
     }
@@ -657,11 +657,11 @@  discard block
 block discarded – undo
657 657
     * @throws ConvertHelper_Exception
658 658
     * @see ConvertHelper::ERROR_JSON_ENCODE_FAILED
659 659
     */
660
-    public static function var2json($variable, int $options=0, int $depth=512) : string
660
+    public static function var2json($variable, int $options = 0, int $depth = 512) : string
661 661
     {
662 662
         $result = json_encode($variable, $options, $depth);
663 663
         
664
-        if($result !== false) {
664
+        if ($result !== false) {
665 665
             return $result;
666 666
         }
667 667
         
@@ -701,12 +701,12 @@  discard block
 block discarded – undo
701 701
     {
702 702
         $boms = FileHelper::createUnicodeHandling()->getUTFBOMs();
703 703
 
704
-        foreach($boms as $bomChars)
704
+        foreach ($boms as $bomChars)
705 705
         {
706 706
             $length = mb_strlen($bomChars);
707 707
             $text = mb_substr($string, 0, $length);
708 708
 
709
-            if($text===$bomChars)
709
+            if ($text === $bomChars)
710 710
             {
711 711
                 return mb_substr($string, $length);
712 712
             }
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
     * @see ConvertHelper_TextComparer::OPTION_MAX_LEVENSHTEIN_DISTANCE
779 779
     * @see ConvertHelper_TextComparer::OPTION_PRECISION
780 780
     */
781
-    public static function matchString(string $source, string $target, array $options=array()) : float
781
+    public static function matchString(string $source, string $target, array $options = array()) : float
782 782
     {
783 783
         return (new ConvertHelper_TextComparer())
784 784
             ->setOptions($options)
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
     * @see ConvertHelper::INTERVAL_HOURS
857 857
     * @see ConvertHelper::INTERVAL_DAYS
858 858
     */
859
-    public static function interval2total(DateInterval $interval, string $unit=self::INTERVAL_SECONDS) : int
859
+    public static function interval2total(DateInterval $interval, string $unit = self::INTERVAL_SECONDS) : int
860 860
     {
861 861
         return ConvertHelper_DateInterval::toTotal($interval, $unit);
862 862
     }
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
     * @param bool $short
869 869
     * @return string|NULL
870 870
     */
871
-    public static function date2dayName(DateTime $date, bool $short=false) : ?string
871
+    public static function date2dayName(DateTime $date, bool $short = false) : ?string
872 872
     {
873 873
         return ConvertHelper_Date::toDayName($date, $short);
874 874
     }
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
     * @param bool $short
889 889
     * @return string[]
890 890
     */
891
-    public static function getDayNames(bool $short=false) : array
891
+    public static function getDayNames(bool $short = false) : array
892 892
     {
893 893
         return ConvertHelper_Date::getDayNames($short);
894 894
     }
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
     * @param bool $caseInsensitive
1048 1048
     * @return ConvertHelper_StringMatch[]
1049 1049
     */
1050
-    public static function findString(string $needle, string $haystack, bool $caseInsensitive=false): array
1050
+    public static function findString(string $needle, string $haystack, bool $caseInsensitive = false): array
1051 1051
     {
1052 1052
         return ConvertHelper_String::findString($needle, $haystack, $caseInsensitive);
1053 1053
     }
@@ -1097,17 +1097,17 @@  discard block
 block discarded – undo
1097 1097
     */
1098 1098
     public static function isInteger($value) : bool
1099 1099
     {
1100
-        if(is_int($value)) {
1100
+        if (is_int($value)) {
1101 1101
             return true;
1102 1102
         }
1103 1103
         
1104 1104
         // booleans get converted to numbers, so they would
1105 1105
         // actually match the regex.
1106
-        if(is_bool($value)) {
1106
+        if (is_bool($value)) {
1107 1107
             return false;
1108 1108
         }
1109 1109
         
1110
-        if(is_string($value) && $value !== '') {
1110
+        if (is_string($value) && $value !== '') {
1111 1111
             return preg_match('/\A-?\d+\z/', $value) === 1;
1112 1112
         }
1113 1113
         
@@ -1173,7 +1173,7 @@  discard block
 block discarded – undo
1173 1173
      * @param bool $keepKeys
1174 1174
      * @return array<number|string,mixed>
1175 1175
      */
1176
-    public static function arrayRemoveValues(array $sourceArray, array $values, bool $keepKeys=false) : array
1176
+    public static function arrayRemoveValues(array $sourceArray, array $values, bool $keepKeys = false) : array
1177 1177
     {
1178 1178
         return ConvertHelper_Array::removeValues($sourceArray, $values, $keepKeys);
1179 1179
     }
Please login to merge, or discard this patch.
src/FileHelper/UploadFileSizeInfo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size.
52 52
         $result = (float)preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size.
53 53
 
54
-        if($unit)
54
+        if ($unit)
55 55
         {
56 56
             // Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by.
57 57
             return (int)round($result * (1024 ** stripos('bkmgtpezy', $unit[0])));
Please login to merge, or discard this patch.
src/FileHelper/FileInfo.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $pathString = AbstractPathInfo::type2string($path);
44 44
 
45
-        if(!isset(self::$infoCache[$pathString]))
45
+        if (!isset(self::$infoCache[$pathString]))
46 46
         {
47 47
             self::$infoCache[$pathString] = new FileInfo($pathString);
48 48
         }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     {
73 73
         parent::__construct($path);
74 74
 
75
-        if(!self::is_file($this->path))
75
+        if (!self::is_file($this->path))
76 76
         {
77 77
             throw new FileHelper_Exception(
78 78
                 'Not a file path',
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     {
87 87
         $path = trim($path);
88 88
 
89
-        if(empty($path))
89
+        if (empty($path))
90 90
         {
91 91
             return false;
92 92
         }
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
         return is_file($path) || pathinfo($path, PATHINFO_EXTENSION) !== '';
95 95
     }
96 96
 
97
-    public function removeExtension(bool $keepPath=false) : string
97
+    public function removeExtension(bool $keepPath = false) : string
98 98
     {
99
-        if(!$keepPath)
99
+        if (!$keepPath)
100 100
         {
101 101
             return pathinfo($this->getName(), PATHINFO_FILENAME);
102 102
         }
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
         return implode('/', $parts);
111 111
     }
112 112
 
113
-    public function getExtension(bool $lowercase=true) : string
113
+    public function getExtension(bool $lowercase = true) : string
114 114
     {
115 115
         $ext = pathinfo($this->path, PATHINFO_EXTENSION);
116 116
 
117
-        if($lowercase)
117
+        if ($lowercase)
118 118
         {
119 119
             $ext = mb_strtolower($ext);
120 120
         }
@@ -130,12 +130,12 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public function delete() : FileInfo
132 132
     {
133
-        if(!$this->exists())
133
+        if (!$this->exists())
134 134
         {
135 135
             return $this;
136 136
         }
137 137
 
138
-        if(unlink($this->path))
138
+        if (unlink($this->path))
139 139
         {
140 140
             return $this;
141 141
         }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     {
163 163
         $this->checkCopyPrerequisites($targetPath);
164 164
 
165
-        if(copy($this->path, $targetPath))
165
+        if (copy($this->path, $targetPath))
166 166
         {
167 167
             return self::factory($targetPath);
168 168
         }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
      */
215 215
     public function getLineReader() : LineReader
216 216
     {
217
-        if(!isset($this->lineReader))
217
+        if (!isset($this->lineReader))
218 218
         {
219 219
             $this->lineReader = new LineReader($this);
220 220
         }
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 
234 234
         $result = file_get_contents($this->getPath());
235 235
 
236
-        if($result !== false) {
236
+        if ($result !== false) {
237 237
             return $result;
238 238
         }
239 239
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
      */
256 256
     public function putContents(string $content) : FileInfo
257 257
     {
258
-        if($this->exists())
258
+        if ($this->exists())
259 259
         {
260 260
             $this->requireWritable();
261 261
         }
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
                 ->requireWritable();
267 267
         }
268 268
 
269
-        if(file_put_contents($this->path, $content) !== false)
269
+        if (file_put_contents($this->path, $content) !== false)
270 270
         {
271 271
             return $this;
272 272
         }
Please login to merge, or discard this patch.
src/FileHelper/PathRelativizer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
      * @param int $depth The folder depth to reduce the path to
19 19
      * @return string
20 20
      */
21
-    public static function relativizeByDepth(string $path, int $depth=2) : string
21
+    public static function relativizeByDepth(string $path, int $depth = 2) : string
22 22
     {
23 23
         $path = FileHelper::normalizePath($path);
24 24
 
@@ -26,17 +26,17 @@  discard block
 block discarded – undo
26 26
         $tokens = array_filter($tokens); // remove empty entries (trailing slash for example)
27 27
         $tokens = array_values($tokens); // re-index keys
28 28
 
29
-        if(empty($tokens)) {
29
+        if (empty($tokens)) {
30 30
             return '';
31 31
         }
32 32
 
33 33
         // remove the drive if present
34
-        if(strpos($tokens[0], ':') !== false) {
34
+        if (strpos($tokens[0], ':') !== false) {
35 35
             array_shift($tokens);
36 36
         }
37 37
 
38 38
         // path was only the drive
39
-        if(count($tokens) === 0) {
39
+        if (count($tokens) === 0) {
40 40
             return '';
41 41
         }
42 42
 
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 
46 46
         // reduce the path to the specified depth
47 47
         $length = count($tokens);
48
-        if($length > $depth) {
49
-            $tokens = array_slice($tokens, $length-$depth);
48
+        if ($length > $depth) {
49
+            $tokens = array_slice($tokens, $length - $depth);
50 50
         }
51 51
 
52 52
         // append the last element again
Please login to merge, or discard this patch.
src/FileHelper/FileFinder.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  * @see \AppUtils\FileHelper\FileFinder
8 8
  */
9 9
 
10
-declare(strict_types = 1);
10
+declare(strict_types=1);
11 11
 
12 12
 namespace AppUtils\FileHelper;
13 13
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      * @param bool $enabled
91 91
      * @return FileFinder
92 92
      */
93
-    public function makeRecursive(bool $enabled=true) : FileFinder
93
+    public function makeRecursive(bool $enabled = true) : FileFinder
94 94
     {
95 95
         return $this->setOption('recursive', $enabled);
96 96
     }
@@ -295,22 +295,22 @@  discard block
 block discarded – undo
295 295
         return $this->getAll();
296 296
     }
297 297
     
298
-    protected function find(string $path, bool $isRoot=false) : void
298
+    protected function find(string $path, bool $isRoot = false) : void
299 299
     {
300
-        if($isRoot) {
300
+        if ($isRoot) {
301 301
             $this->found = array();
302 302
         }
303 303
         
304 304
         $recursive = $this->getBoolOption('recursive');
305 305
         
306 306
         $d = new DirectoryIterator($path);
307
-        foreach($d as $item)
307
+        foreach ($d as $item)
308 308
         {
309 309
             $pathname = $item->getPathname();
310 310
             
311
-            if($item->isDir())
311
+            if ($item->isDir())
312 312
             {
313
-                if($recursive && !$item->isDot()) {
313
+                if ($recursive && !$item->isDot()) {
314 314
                     $this->find($pathname);
315 315
                 }
316 316
                 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
             
320 320
             $file = $this->filterFile($pathname);
321 321
             
322
-            if($file !== null) 
322
+            if ($file !== null) 
323 323
             {
324 324
                 $this->found[] = $file;
325 325
             }
@@ -332,23 +332,23 @@  discard block
 block discarded – undo
332 332
         
333 333
         $extension = FileHelper::getExtension($path);
334 334
         
335
-        if(!$this->filterExclusion($extension)) {
335
+        if (!$this->filterExclusion($extension)) {
336 336
             return null;
337 337
         }
338 338
         
339 339
         $path = $this->filterPath($path);
340 340
         
341
-        if($this->getOption('strip-extensions') === true)
341
+        if ($this->getOption('strip-extensions') === true)
342 342
         {
343 343
             $path = str_replace('.'.$extension, '', $path);
344 344
         }
345 345
         
346
-        if($path === '') {
346
+        if ($path === '') {
347 347
             return null;
348 348
         }
349 349
         
350 350
         $replace = $this->getOption('slash-replacement');
351
-        if(!empty($replace)) {
351
+        if (!empty($replace)) {
352 352
             $path = str_replace('/', $replace, $path);
353 353
         }
354 354
         
@@ -367,13 +367,13 @@  discard block
 block discarded – undo
367 367
         $include = $this->getOption(self::OPTION_INCLUDE_EXTENSIONS);
368 368
         $exclude = $this->getOption(self::OPTION_EXCLUDE_EXTENSIONS);
369 369
         
370
-        if(!empty($include))
370
+        if (!empty($include))
371 371
         {
372
-            if(!in_array($extension, $include, true)) {
372
+            if (!in_array($extension, $include, true)) {
373 373
                 return false;
374 374
             }
375 375
         }
376
-        else if(!empty($exclude) && in_array($extension, $exclude, true))
376
+        else if (!empty($exclude) && in_array($extension, $exclude, true))
377 377
         {
378 378
             return false;
379 379
         }
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
     */
390 390
     protected function filterPath(string $path) : string
391 391
     {
392
-        switch($this->getStringOption(self::OPTION_PATHMODE))
392
+        switch ($this->getStringOption(self::OPTION_PATHMODE))
393 393
         {
394 394
             case self::PATH_MODE_STRIP:
395 395
                 return basename($path);
Please login to merge, or discard this patch.
src/FileHelper/FolderInfo.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $pathString = AbstractPathInfo::type2string($path);
31 31
 
32
-        if(!isset(self::$infoCache[$pathString]))
32
+        if (!isset(self::$infoCache[$pathString]))
33 33
         {
34 34
             self::$infoCache[$pathString] = new FolderInfo($pathString);
35 35
         }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     {
59 59
         parent::__construct($path);
60 60
 
61
-        if(!self::is_dir($this->path))
61
+        if (!self::is_dir($this->path))
62 62
         {
63 63
             throw new FileHelper_Exception(
64 64
                 'Not a folder',
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
     {
81 81
         $path = trim($path);
82 82
 
83
-        if($path === '' || $path === '.' || $path === '..')
83
+        if ($path === '' || $path === '.' || $path === '..')
84 84
         {
85 85
             return false;
86 86
         }
87 87
 
88
-        if(is_dir($path))
88
+        if (is_dir($path))
89 89
         {
90 90
             return true;
91 91
         }
@@ -103,12 +103,12 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function delete() : FolderInfo
105 105
     {
106
-        if(!$this->exists())
106
+        if (!$this->exists())
107 107
         {
108 108
             return $this;
109 109
         }
110 110
 
111
-        if(rmdir($this->path))
111
+        if (rmdir($this->path))
112 112
         {
113 113
             return $this;
114 114
         }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      */
135 135
     public function create() : FolderInfo
136 136
     {
137
-        if(is_dir($this->path) || mkdir($this->path, 0777, true) || is_dir($this->path))
137
+        if (is_dir($this->path) || mkdir($this->path, 0777, true) || is_dir($this->path))
138 138
         {
139 139
             return $this;
140 140
         }
Please login to merge, or discard this patch.
src/FileHelper/AbstractPathInfo.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
         $path = realpath($this->path);
96 96
 
97
-        if($path !== false)
97
+        if ($path !== false)
98 98
         {
99 99
             return FileHelper::normalizePath($path);
100 100
         }
@@ -113,14 +113,14 @@  discard block
 block discarded – undo
113 113
      * @return $this
114 114
      * @throws FileHelper_Exception
115 115
      */
116
-    private function requireTrue(bool $condition, string $conditionLabel, ?int $errorCode=null) : self
116
+    private function requireTrue(bool $condition, string $conditionLabel, ?int $errorCode = null) : self
117 117
     {
118
-        if($condition === true)
118
+        if ($condition === true)
119 119
         {
120 120
             return $this;
121 121
         }
122 122
 
123
-        if($errorCode === null)
123
+        if ($errorCode === null)
124 124
         {
125 125
             $errorCode = FileHelper::ERROR_FILE_DOES_NOT_EXIST;
126 126
         }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
      * @return $this
138 138
      * @throws FileHelper_Exception
139 139
      */
140
-    public function requireExists(?int $errorCode=null) : self
140
+    public function requireExists(?int $errorCode = null) : self
141 141
     {
142 142
         return $this->requireTrue(
143 143
             !empty($this->path) && realpath($this->path) !== false,
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      * @return $this
152 152
      * @throws FileHelper_Exception
153 153
      */
154
-    public function requireReadable(?int $errorCode=null) : self
154
+    public function requireReadable(?int $errorCode = null) : self
155 155
     {
156 156
         $this->requireExists($errorCode);
157 157
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
      * @return $this
168 168
      * @throws FileHelper_Exception
169 169
      */
170
-    public function requireWritable(?int $errorCode=null) : self
170
+    public function requireWritable(?int $errorCode = null) : self
171 171
     {
172 172
         return $this->requireTrue(
173 173
             $this->isWritable(),
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      */
185 185
     public function requireIsFile() : FileInfo
186 186
     {
187
-        if($this instanceof FileInfo)
187
+        if ($this instanceof FileInfo)
188 188
         {
189 189
             return $this;
190 190
         }
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
      */
208 208
     public function requireIsFolder() : FolderInfo
209 209
     {
210
-        if($this instanceof FolderInfo)
210
+        if ($this instanceof FolderInfo)
211 211
         {
212 212
             return $this;
213 213
         }
@@ -228,12 +228,12 @@  discard block
 block discarded – undo
228 228
      */
229 229
     public static function type2string($path) : string
230 230
     {
231
-        if($path instanceof PathInfoInterface)
231
+        if ($path instanceof PathInfoInterface)
232 232
         {
233 233
             return $path->getPath();
234 234
         }
235 235
 
236
-        if($path instanceof DirectoryIterator)
236
+        if ($path instanceof DirectoryIterator)
237 237
         {
238 238
             return $path->getPathname();
239 239
         }
@@ -255,19 +255,19 @@  discard block
 block discarded – undo
255 255
      */
256 256
     public static function resolveType($path) : PathInfoInterface
257 257
     {
258
-        if($path instanceof PathInfoInterface)
258
+        if ($path instanceof PathInfoInterface)
259 259
         {
260 260
             return $path;
261 261
         }
262 262
 
263 263
         $path = self::type2string($path);
264 264
 
265
-        if(FolderInfo::is_dir($path))
265
+        if (FolderInfo::is_dir($path))
266 266
         {
267 267
             return FolderInfo::factory($path);
268 268
         }
269 269
 
270
-        if(FileInfo::is_file($path))
270
+        if (FileInfo::is_file($path))
271 271
         {
272 272
             return FileInfo::factory($path);
273 273
         }
Please login to merge, or discard this patch.