Test Failed
Push — master ( 9a4759...0f3564 )
by Sebastian
04:15 queued 59s
created
src/FileHelper.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
     public static function detectMimeType(string $fileName) : ?string
208 208
     {
209 209
         $ext = self::getExtension($fileName);
210
-        if(empty($ext)) {
210
+        if (empty($ext)) {
211 211
             return null;
212 212
         }
213 213
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
      * @see FileHelper::ERROR_FILE_DOES_NOT_EXIST
248 248
      * @see FileHelper::ERROR_UNKNOWN_FILE_MIME_TYPE
249 249
      */
250
-    public static function sendFile(string $filePath, ?string $fileName = null, bool $asAttachment=true) : void
250
+    public static function sendFile(string $filePath, ?string $fileName = null, bool $asAttachment = true) : void
251 251
     {
252 252
         self::getFileInfo($filePath)->getDownloader()->send($fileName, $asAttachment);
253 253
     }
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
      * @throws FileHelper_Exception
265 265
      * @see FileHelper::ERROR_CANNOT_OPEN_URL
266 266
      */
267
-    public static function downloadFile(string $url, int $timeout=0, bool $SSLEnabled=false) : string
267
+    public static function downloadFile(string $url, int $timeout = 0, bool $SSLEnabled = false) : string
268 268
     {
269 269
         return FileDownloader::factory($url)
270 270
             ->setTimeout($timeout)
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     {
317 317
         $info = self::getPathInfo($pathOrDirIterator);
318 318
 
319
-        if($extension === true || $info instanceof FolderInfo)
319
+        if ($extension === true || $info instanceof FolderInfo)
320 320
         {
321 321
             return $info->getName();
322 322
         }
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
      * @see FileHelper::ERROR_CANNOT_FIND_JSON_FILE
338 338
      * @see FileHelper::ERROR_CANNOT_DECODE_JSON_FILE
339 339
      */
340
-    public static function parseJSONFile(string $file, string $targetEncoding='', $sourceEncoding=null) : array
340
+    public static function parseJSONFile(string $file, string $targetEncoding = '', $sourceEncoding = null) : array
341 341
     {
342 342
         return JSONFile::factory(self::getFileInfo($file))
343 343
             ->setTargetEncoding($targetEncoding)
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
      * @throws FileHelper_Exception
391 391
      * @see FileHelper::createFileFinder()
392 392
      */
393
-    public static function findHTMLFiles(string $targetFolder, array $options=array()) : array
393
+    public static function findHTMLFiles(string $targetFolder, array $options = array()) : array
394 394
     {
395 395
         return self::findFiles($targetFolder, array('html'), $options);
396 396
     }
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
      * @throws FileHelper_Exception
410 410
      * @see FileHelper::createFileFinder()
411 411
      */
412
-    public static function findPHPFiles(string $targetFolder, array $options=array()) : array
412
+    public static function findPHPFiles(string $targetFolder, array $options = array()) : array
413 413
     {
414 414
         return self::findFiles($targetFolder, array('php'), $options);
415 415
     }
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
     * @see FileHelper::createFileFinder()
432 432
     * @deprecated Use the file finder instead.
433 433
     */
434
-    public static function findFiles($targetFolder, array $extensions=array(), array $options=array()) : array
434
+    public static function findFiles($targetFolder, array $extensions = array(), array $options = array()) : array
435 435
     {
436 436
         $finder = self::createFileFinder($targetFolder);
437 437
 
@@ -441,16 +441,16 @@  discard block
 block discarded – undo
441 441
 
442 442
         $finder->setPathmodeStrip();
443 443
         
444
-        if(isset($options['relative-path']) && $options['relative-path'] === true) 
444
+        if (isset($options['relative-path']) && $options['relative-path'] === true) 
445 445
         {
446 446
             $finder->setPathmodeRelative();
447 447
         } 
448
-        else if(isset($options['absolute-path']) && $options['absolute-path'] === true)
448
+        else if (isset($options['absolute-path']) && $options['absolute-path'] === true)
449 449
         {
450 450
             $finder->setPathmodeAbsolute();
451 451
         }
452 452
         
453
-        if(isset($options['strip-extension'])) 
453
+        if (isset($options['strip-extension'])) 
454 454
         {
455 455
             $finder->stripExtensions();
456 456
         }
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
     * @param bool $keepPath Whether to keep the path component, if any. Default PHP pathinfo behavior is not to.
469 469
     * @return string
470 470
     */
471
-    public static function removeExtension(string $filename, bool $keepPath=false) : string
471
+    public static function removeExtension(string $filename, bool $keepPath = false) : string
472 472
     {
473 473
         return self::getFileInfo($filename)->removeExtension($keepPath);
474 474
     }
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 
481 481
     public static function createUnicodeHandling() : UnicodeHandling
482 482
     {
483
-        if(!isset(self::$unicodeHandling))
483
+        if (!isset(self::$unicodeHandling))
484 484
         {
485 485
             self::$unicodeHandling = new UnicodeHandling();
486 486
         }
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
     * @see FileHelper::ERROR_SAVE_FILE_NOT_WRITABLE
514 514
     * @see FileHelper::ERROR_SAVE_FILE_WRITE_FAILED
515 515
     */
516
-    public static function saveAsJSON($data, string $file, bool $pretty=false) : void
516
+    public static function saveAsJSON($data, string $file, bool $pretty = false) : void
517 517
     {
518 518
         JSONFile::factory(self::getFileInfo($file))
519 519
             ->putData($data, $pretty);
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
     * @see FileHelper::ERROR_SAVE_FILE_NOT_WRITABLE
532 532
     * @see FileHelper::ERROR_SAVE_FILE_WRITE_FAILED
533 533
     */
534
-    public static function saveFile(string $filePath, string $content='') : void
534
+    public static function saveFile(string $filePath, string $content = '') : void
535 535
     {
536 536
         self::getFileInfo($filePath)->putContents($content);
537 537
     }
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
      */
575 575
     public static function checkPHPFileSyntax(string $path)
576 576
     {
577
-        if(!self::canMakePHPCalls()) {
577
+        if (!self::canMakePHPCalls()) {
578 578
             return true;
579 579
         }
580 580
         
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
         // when the validation is successful, the first entry
586 586
         // in the array contains the success message. When it
587 587
         // is invalid, the first entry is always empty.
588
-        if(!empty($output[0])) {
588
+        if (!empty($output[0])) {
589 589
             return true;
590 590
         }
591 591
         
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
     public static function getModifiedDate(string $path) : ?DateTime
607 607
     {
608 608
         $time = filemtime($path);
609
-        if($time === false) {
609
+        if ($time === false) {
610 610
             return null;
611 611
         }
612 612
 
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
     * @param int $depth The folder depth to reduce the path to
668 668
     * @return string
669 669
     */
670
-    public static function relativizePathByDepth(string $path, int $depth=2) : string
670
+    public static function relativizePathByDepth(string $path, int $depth = 2) : string
671 671
     {
672 672
         return PathRelativizer::relativizeByDepth($path, $depth);
673 673
     }
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
     * @see FileHelper::ERROR_FILE_DOES_NOT_EXIST
707 707
     * @see FileHelper::ERROR_REAL_PATH_NOT_FOUND
708 708
     */
709
-    public static function requireFileExists($path, ?int $errorCode=null) : string
709
+    public static function requireFileExists($path, ?int $errorCode = null) : string
710 710
     {
711 711
         return self::getPathInfo($path)
712 712
             ->requireIsFile()
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
      * @return string
721 721
      * @throws FileHelper_Exception
722 722
      */
723
-    public static function requireFileReadable(string $path, ?int $errorCode=null) : string
723
+    public static function requireFileReadable(string $path, ?int $errorCode = null) : string
724 724
     {
725 725
         return self::getPathInfo($path)
726 726
             ->requireIsFile()
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
      * @see FileHelper::ERROR_FILE_DOES_NOT_EXIST
810 810
      * @see FileHelper::ERROR_CANNOT_OPEN_FILE_TO_READ_LINES
811 811
      */
812
-    public static function readLines(string $filePath, int $amount=0) : array
812
+    public static function readLines(string $filePath, int $amount = 0) : array
813 813
     {
814 814
         return self::getFileInfo($filePath)
815 815
             ->getLineReader()
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
      *
860 860
      * @throws FileHelper_Exception
861 861
      */
862
-    public static function createPathsReducer(array $paths=array()) : PathsReducer
862
+    public static function createPathsReducer(array $paths = array()) : PathsReducer
863 863
     {
864 864
         return new PathsReducer($paths);
865 865
     }
Please login to merge, or discard this patch.
src/AttributeCollection.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function setAttributes(array $attributes) : AttributeCollection
69 69
     {
70
-        foreach($attributes as $name => $value)
70
+        foreach ($attributes as $name => $value)
71 71
         {
72 72
             $this->attr($name, $value);
73 73
         }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         return $this;
76 76
     }
77 77
 
78
-    public function getAttribute(string $name, string $default='') : string
78
+    public function getAttribute(string $name, string $default = '') : string
79 79
     {
80 80
         return $this->attributes[$name] ?? $default;
81 81
     }
@@ -84,14 +84,14 @@  discard block
 block discarded – undo
84 84
      * @param array<string,string|number|bool|NULL|Interface_Stringable|StringBuilder_Interface> $attributes
85 85
      * @return AttributeCollection
86 86
      */
87
-    public static function create(array $attributes=array()) : AttributeCollection
87
+    public static function create(array $attributes = array()) : AttributeCollection
88 88
     {
89 89
         return new AttributeCollection($attributes);
90 90
     }
91 91
 
92
-    public function prop(string $name, bool $enabled=true) : AttributeCollection
92
+    public function prop(string $name, bool $enabled = true) : AttributeCollection
93 93
     {
94
-        if($enabled)
94
+        if ($enabled)
95 95
         {
96 96
             return $this->attr($name, $name);
97 97
         }
@@ -108,18 +108,18 @@  discard block
 block discarded – undo
108 108
     {
109 109
         $string = Filtering::value2string($value);
110 110
 
111
-        if($name === 'class')
111
+        if ($name === 'class')
112 112
         {
113 113
             return $this->addClasses(ConvertHelper::explodeTrim(' ', $string));
114 114
         }
115 115
 
116
-        if($name === 'style')
116
+        if ($name === 'style')
117 117
         {
118 118
             $this->styles->parseStylesString($string);
119 119
             return $this;
120 120
         }
121 121
 
122
-        if($string !== '')
122
+        if ($string !== '')
123 123
         {
124 124
             $this->attributes[$name] = $string;
125 125
         }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     {
139 139
         $this->attr($name, $value);
140 140
 
141
-        if(isset($this->attributes[$name]))
141
+        if (isset($this->attributes[$name]))
142 142
         {
143 143
             $this->attributes[$name] = Filtering::quotes($this->attributes[$name]);
144 144
         }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
     public function remove(string $name) : AttributeCollection
155 155
     {
156
-        if(isset($this->attributes[$name]))
156
+        if (isset($this->attributes[$name]))
157 157
         {
158 158
             unset($this->attributes[$name]);
159 159
         }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
     private function getRenderer() : AttributesRenderer
177 177
     {
178
-        if(isset($this->renderer))
178
+        if (isset($this->renderer))
179 179
         {
180 180
             return $this->renderer;
181 181
         }
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 
239 239
     public const TARGET_BLANK = '_blank';
240 240
 
241
-    public function target(string $value=self::TARGET_BLANK) : AttributeCollection
241
+    public function target(string $value = self::TARGET_BLANK) : AttributeCollection
242 242
     {
243 243
         return $this->attr('target', $value);
244 244
     }
Please login to merge, or discard this patch.
src/FileHelper/PathInfoInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 interface PathInfoInterface
25 25
 {
26 26
     public function getName() : string;
27
-    public function getExtension(bool $lowercase=true) : string;
27
+    public function getExtension(bool $lowercase = true) : string;
28 28
     public function getPath() : string;
29 29
     public function exists() : bool;
30 30
     public function isFolder() : bool;
Please login to merge, or discard this patch.
src/FileHelper/FolderTree.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     {
23 23
         $info = FileHelper::getFolderInfo($rootFolder);
24 24
 
25
-        if(!$info->exists())
25
+        if (!$info->exists())
26 26
         {
27 27
             return true;
28 28
         }
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
         foreach ($d as $item)
33 33
         {
34
-            if(self::processDeleteItem($item) === false)
34
+            if (self::processDeleteItem($item) === false)
35 35
             {
36 36
                 return false;
37 37
             }
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
     {
101 101
         $target = FileHelper::createFolder($target);
102 102
 
103
-        $d =  FileHelper::getPathInfo($source)->requireIsFolder()->getIterator();
103
+        $d = FileHelper::getPathInfo($source)->requireIsFolder()->getIterator();
104 104
 
105 105
         foreach ($d as $item)
106 106
         {
107
-            if($item->isDot())
107
+            if ($item->isDot())
108 108
             {
109 109
                 continue;
110 110
             }
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 
126 126
         if ($item->isFolder())
127 127
         {
128
-            self::copy($item, $target . '/' . $item->getName());
128
+            self::copy($item, $target.'/'.$item->getName());
129 129
         }
130
-        else if($item->isFile())
130
+        else if ($item->isFile())
131 131
         {
132 132
             $item
133 133
                 ->requireIsFile()
Please login to merge, or discard this patch.