Test Failed
Push — master ( 9d3a5c...c5f273 )
by Sebastian
08:26
created
src/RGBAColor/FormatsConverter/HEXParser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,18 +21,18 @@
 block discarded – undo
21 21
      * @throws ColorException
22 22
      * @see RGBAColor::ERROR_INVALID_HEX_LENGTH
23 23
      */
24
-    public function parse(string $hex, string $name='') : RGBAColor
24
+    public function parse(string $hex, string $name = '') : RGBAColor
25 25
     {
26 26
         $hex = ltrim($hex, '#'); // Remove the hash if present
27 27
         $hex = strtoupper($hex);
28 28
         $length = strlen($hex);
29 29
 
30
-        if($length === 3)
30
+        if ($length === 3)
31 31
         {
32 32
             return $this->parseHEX3($hex, $name);
33 33
         }
34 34
 
35
-        if($length === 6)
35
+        if ($length === 6)
36 36
         {
37 37
             return $this->parseHEX6($hex, $name);
38 38
         }
Please login to merge, or discard this patch.
examples/htdocs/prepend.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
 
10 10
 declare(strict_types=1);
11 11
 
12
-$autoload = __DIR__ . '/../vendor/autoload.php';
12
+$autoload = __DIR__.'/../vendor/autoload.php';
13 13
 
14
-if(!file_exists($autoload))
14
+if (!file_exists($autoload))
15 15
 {
16 16
     die('<b>ERROR:</b> Autoloader not present. Please run composer install first.');
17 17
 }
Please login to merge, or discard this patch.
examples/htdocs/URLInfo/highlighting.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 		<br>
43 43
         <?php
44 44
         
45
-            foreach($urls as $url)
45
+            foreach ($urls as $url)
46 46
             {
47 47
                 $info = parseURL($url);
48 48
                 
Please login to merge, or discard this patch.
src/RGBAColor/ColorChannel/HexadecimalChannel.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     {
37 37
         $this->validateValue($value);
38 38
 
39
-        if(strlen($value) === 1)
39
+        if (strlen($value) === 1)
40 40
         {
41 41
             $value = str_repeat($value, 2);
42 42
         }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $match = preg_match('/\A[0-9A-F]{1,2}\z/iU', $hex);
55 55
 
56
-        if($match !== false && $match > 0)
56
+        if ($match !== false && $match > 0)
57 57
         {
58 58
             return;
59 59
         }
Please login to merge, or discard this patch.
src/ConvertHelper/ThrowableInfo/Serializer.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
             self::SERIALIZED_PREVIOUS => null,
40 40
         );
41 41
 
42
-        if($info->hasPrevious())
42
+        if ($info->hasPrevious())
43 43
         {
44 44
             $result[self::SERIALIZED_PREVIOUS] = $info->getPrevious()->serialize();
45 45
         }
46 46
 
47 47
         $calls = $info->getCalls();
48
-        foreach($calls as $call)
48
+        foreach ($calls as $call)
49 49
         {
50 50
             $result[self::SERIALIZED_CALLS][] = $call->serialize();
51 51
         }
@@ -63,12 +63,12 @@  discard block
 block discarded – undo
63 63
         $data = self::validateSerializedData($serialized);
64 64
         $data[self::SERIALIZED_PREVIOUS] = self::unserializePrevious($data[self::SERIALIZED_PREVIOUS]);
65 65
 
66
-        if(!isset($data[self::SERIALIZED_CLASS]))
66
+        if (!isset($data[self::SERIALIZED_CLASS]))
67 67
         {
68 68
             $data[self::SERIALIZED_CLASS] = '';
69 69
         }
70 70
 
71
-        if(!isset($data[self::SERIALIZED_DETAILS]))
71
+        if (!isset($data[self::SERIALIZED_DETAILS]))
72 72
         {
73 73
             $data[self::SERIALIZED_DETAILS] = '';
74 74
         }
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
             self::SERIALIZED_CALLS => 'array'
95 95
         );
96 96
 
97
-        foreach($keys as $key => $type)
97
+        foreach ($keys as $key => $type)
98 98
         {
99
-            if(!isset($serialized[$key]) || gettype($serialized[$key]) !== $type)
99
+            if (!isset($serialized[$key]) || gettype($serialized[$key]) !== $type)
100 100
             {
101 101
                 throw self::createTypeException($key, $type);
102 102
             }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      */
126 126
     private static function unserializePrevious(?array $previous) : ?ConvertHelper_ThrowableInfo
127 127
     {
128
-        if(!empty($previous))
128
+        if (!empty($previous))
129 129
         {
130 130
             return ConvertHelper_ThrowableInfo::fromSerialized($previous);
131 131
         }
Please login to merge, or discard this patch.
src/SVNHelper/Command.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     
57 57
     public function execute()
58 58
     {
59
-        if(isset($this->result))
59
+        if (isset($this->result))
60 60
         {
61 61
             return $this->result;
62 62
         }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         putenv('LC_ALL='.$locale);
68 68
         
69 69
         $this->result = $this->_execute();
70
-        if(!$this->result instanceof SVNHelper_CommandResult) {
70
+        if (!$this->result instanceof SVNHelper_CommandResult) {
71 71
             throw new SVNHelper_Exception(
72 72
                 'Not a valid SVN command result',
73 73
                 sprintf(
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     
84 84
     abstract protected function _execute();
85 85
 
86
-    protected function buildCommand($mode, $path=null, $params=array())
86
+    protected function buildCommand($mode, $path = null, $params = array())
87 87
     {
88 88
         $params[] = 'non-interactive';
89 89
         $params[] = 'username '.$this->helper->getAuthUser();
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         
92 92
         $cmd = 'svn '.$mode.' '.$path.' ';
93 93
         
94
-        foreach($params as $param) {
94
+        foreach ($params as $param) {
95 95
             $cmd .= '--'.$param.' ';
96 96
         }
97 97
         
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     * @param array $params
110 110
     * @return SVNHelper_CommandResult
111 111
     */
112
-    protected function execCommand($mode, $path=null, $params=array())
112
+    protected function execCommand($mode, $path = null, $params = array())
113 113
     {
114 114
         $relative = $this->helper->relativizePath($path);
115 115
         
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         exec($cmd, $output);
125 125
         
126 126
         $lines = array();
127
-        foreach($output as $line) {
127
+        foreach ($output as $line) {
128 128
             $lines[] = mb_strtolower(trim(utf8_encode($line)));
129 129
         }
130 130
         
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         //
137 137
         // Can happen for example when the path is not under version
138 138
         // control.
139
-        if(isset($lines[0]) && substr($lines[0], 0, 7) == 'skipped')
139
+        if (isset($lines[0]) && substr($lines[0], 0, 7) == 'skipped')
140 140
         {
141 141
             $tokens = explode('--', $lines[0]);
142 142
             $message = trim(array_pop($tokens));
@@ -157,20 +157,20 @@  discard block
 block discarded – undo
157 157
         // svn: w123456: warning message
158 158
         else
159 159
         {
160
-            foreach($lines as $line) 
160
+            foreach ($lines as $line) 
161 161
             {
162
-                if(strstr($line, 'svn:')) 
162
+                if (strstr($line, 'svn:')) 
163 163
                 {
164 164
                     $result = array();
165 165
                     preg_match_all('/svn:[ ]*(e|warning:[ ]*w)([0-9]+):(.*)/', $line, $result, PREG_PATTERN_ORDER);
166 166
                     
167
-                    if(isset($result[1]) && isset($result[1][0])) 
167
+                    if (isset($result[1]) && isset($result[1][0])) 
168 168
                     {
169 169
                         $message = trim($result[3][0]);
170 170
                         $code = trim($result[2][0]);
171 171
                         $type = self::SVN_ERROR_TYPE_ERROR;
172 172
                         
173
-                        if($result[1][0] != 'e') {
173
+                        if ($result[1][0] != 'e') {
174 174
                             $type = self::SVN_ERROR_TYPE_WARNING;
175 175
                         }
176 176
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         
184 184
         $result = new SVNHelper_CommandResult($this, $cmd, $lines, $errorMessages);
185 185
         
186
-        if($result->isError()) {
186
+        if ($result->isError()) {
187 187
             $this->log(sprintf('[%s] | Command returned errors.', $relative));
188 188
         } 
189 189
         
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
     
207 207
     protected function throwExceptionUnexpected(SVNHelper_CommandResult $result)
208 208
     {
209
-        if($result->isConnectionFailed()) {
209
+        if ($result->isConnectionFailed()) {
210 210
             $this->throwException(
211 211
                 t('Could not connect to the remote SVN repository'), 
212 212
                 '', 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
             );
216 216
         }
217 217
         
218
-        if($result->hasConflicts()) {
218
+        if ($result->hasConflicts()) {
219 219
             $this->throwException(
220 220
                 t('SVN command reported conflicts'), 
221 221
                 '', 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             );
225 225
         }
226 226
         
227
-        if($result->hasLocks()) {
227
+        if ($result->hasLocks()) {
228 228
             $this->throwException(
229 229
                 t('The target SVN folder or file is locked.'), 
230 230
                 '', 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         );
242 242
     }
243 243
     
244
-    protected function throwException($message, $details, $code, SVNHelper_CommandResult $result, $previous=null)
244
+    protected function throwException($message, $details, $code, SVNHelper_CommandResult $result, $previous = null)
245 245
     {
246 246
         $body = 
247 247
         '<p>'.
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         '</p>'.
257 257
         '<ul>';
258 258
             $errors = $result->getErrorMessages();
259
-            foreach($errors as $error) {
259
+            foreach ($errors as $error) {
260 260
                 $body .= 
261 261
                 '<li>'.
262 262
                     $error.
Please login to merge, or discard this patch.
src/SVNHelper/Target.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         $this->url = $this->helper->getURL().'/'.$this->relativePath;
21 21
         
22 22
         $path = $this->helper->getPath();
23
-        if(!empty($relativePath)) {
23
+        if (!empty($relativePath)) {
24 24
             $path .= $this->helper->getSlash().$this->relativePath;
25 25
         }
26 26
         
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         // this is relevant).
31 31
         $this->path = realpath($path);
32 32
         
33
-        if(!$this->path || !file_exists($this->path)) {
33
+        if (!$this->path || !file_exists($this->path)) {
34 34
             throw new SVNHelper_Exception(
35 35
                 'File not found',
36 36
                 sprintf(
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     
139 139
     public function runAdd()
140 140
     {
141
-        if(!$this->isVersioned()) {
141
+        if (!$this->isVersioned()) {
142 142
             $this->createAdd()->execute();
143 143
             $this->clearCache();
144 144
         }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     */
169 169
     public function getInfo()
170 170
     {
171
-        if(!isset($this->cache['info'])) {
171
+        if (!isset($this->cache['info'])) {
172 172
             $this->cache['info'] = $this->helper->createInfo($this);
173 173
         }
174 174
         
@@ -186,12 +186,12 @@  discard block
 block discarded – undo
186 186
     */
187 187
     public function runCommit($message)
188 188
     {
189
-        if(!$this->isVersioned()) {
189
+        if (!$this->isVersioned()) {
190 190
             $this->log('Adding the unversioned file.');
191 191
             $this->runAdd();
192 192
         }
193 193
         
194
-        if(!$this->isCommitted()) {
194
+        if (!$this->isCommitted()) {
195 195
             $this->createCommit($message)->execute();
196 196
             $this->clearCache();
197 197
         }
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 
225 225
     public function requireIsFile() : SVNHelper_Target_File
226 226
     {
227
-        if($this instanceof SVNHelper_Target_File)
227
+        if ($this instanceof SVNHelper_Target_File)
228 228
         {
229 229
             return $this;
230 230
         }
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 
239 239
     public function requireIsFolder() : SVNHelper_Target_Folder
240 240
     {
241
-        if($this instanceof SVNHelper_Target_Folder)
241
+        if ($this instanceof SVNHelper_Target_Folder)
242 242
         {
243 243
             return $this;
244 244
         }
Please login to merge, or discard this patch.
src/SVNHelper/CommandError.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@
 block discarded – undo
119 119
     public function hasAnyErrorCode(array $codes) : bool
120 120
     {
121 121
         $items = array();
122
-        foreach($codes as $code) {
122
+        foreach ($codes as $code) {
123 123
             $items[] = $this->filterCode($code);
124 124
         }
125 125
         
Please login to merge, or discard this patch.
src/StringBuilder.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     {
74 74
         $string = (string)$string;
75 75
         
76
-        if(!empty($string)) 
76
+        if (!empty($string)) 
77 77
         {
78 78
             $this->strings[] = $string;
79 79
         }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     {
92 92
         $flattened = (string)$string;
93 93
 
94
-        if($flattened !== "")
94
+        if ($flattened !== "")
95 95
         {
96 96
             $this->add($this->noSeparator.$flattened);
97 97
         }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     */
158 158
     public function t(string $format, ...$arguments) : StringBuilder
159 159
     {
160
-        if(!class_exists('\AppLocalize\Localization'))
160
+        if (!class_exists('\AppLocalize\Localization'))
161 161
         {
162 162
             array_unshift($arguments, $format);
163 163
             return $this->sf(...$arguments);
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
     {
183 183
         unset($context); // Only used by the localization parser.
184 184
 
185
-        if(!class_exists('\AppLocalize\Localization'))
185
+        if (!class_exists('\AppLocalize\Localization'))
186 186
         {
187 187
             array_unshift($arguments, $format);
188 188
             return $this->sf(...$arguments);
@@ -340,9 +340,9 @@  discard block
 block discarded – undo
340 340
     * @param StringBuilder_Interface|string|NULL $content
341 341
     * @return $this
342 342
     */
343
-    public function para($content=null) : StringBuilder
343
+    public function para($content = null) : StringBuilder
344 344
     {
345
-        if($content !== null) {
345
+        if ($content !== null) {
346 346
             return $this->html('<p>')->nospace($content)->html('</p>');
347 347
         }
348 348
 
@@ -358,21 +358,21 @@  discard block
 block discarded – undo
358 358
      * @param AttributeCollection|null $attributes
359 359
      * @return $this
360 360
      */
361
-    public function link(string $label, string $url, bool $newTab=false, ?AttributeCollection $attributes=null) : StringBuilder
361
+    public function link(string $label, string $url, bool $newTab = false, ?AttributeCollection $attributes = null) : StringBuilder
362 362
     {
363 363
         return $this->add($this->createLink($label, $url, $newTab, $attributes));
364 364
     }
365 365
 
366
-    private function createLink(string $label, string $url, bool $newTab=false, ?AttributeCollection $attributes=null) : HTMLTag
366
+    private function createLink(string $label, string $url, bool $newTab = false, ?AttributeCollection $attributes = null) : HTMLTag
367 367
     {
368
-        if($attributes === null)
368
+        if ($attributes === null)
369 369
         {
370 370
             $attributes = AttributeCollection::create();
371 371
         }
372 372
 
373 373
         $attributes->href($url);
374 374
 
375
-        if($newTab)
375
+        if ($newTab)
376 376
         {
377 377
             $attributes->target();
378 378
         }
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
             ->addText($label);
382 382
     }
383 383
 
384
-    public function linkOpen(string $url, bool $newTab=false, ?AttributeCollection $attributes=null) : StringBuilder
384
+    public function linkOpen(string $url, bool $newTab = false, ?AttributeCollection $attributes = null) : StringBuilder
385 385
     {
386 386
         return $this->html($this->createLink('', $url, $newTab, $attributes)->renderOpen());
387 387
     }
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
     */
426 426
     public function spanned($string, $classes) : StringBuilder
427 427
     {
428
-        if(!is_array($classes)) 
428
+        if (!is_array($classes)) 
429 429
         {
430 430
             $classes = array((string)$classes);
431 431
         }
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
      * @return $this
444 444
      * @throws ConvertHelper_Exception
445 445
      */
446
-    public function bool($value, bool $yesNo=false) : StringBuilder
446
+    public function bool($value, bool $yesNo = false) : StringBuilder
447 447
     {
448 448
         return $this->add(ConvertHelper::bool2string($value, $yesNo));
449 449
     }
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
      */
463 463
     public function ifTrue(bool $condition, $content) : StringBuilder
464 464
     {
465
-        if($condition === true)
465
+        if ($condition === true)
466 466
         {
467 467
             $this->add($this->renderContent($content));
468 468
         }
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
      */
485 485
     public function ifFalse(bool $condition, $string) : StringBuilder
486 486
     {
487
-        if($condition === false)
487
+        if ($condition === false)
488 488
         {
489 489
             $this->add($this->renderContent($string));
490 490
         }
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
      */
569 569
     public function ifOr(bool $condition, $ifTrue, $ifFalse) : StringBuilder
570 570
     {
571
-        if($condition === true)
571
+        if ($condition === true)
572 572
         {
573 573
             return $this->add($this->renderContent($ifTrue));
574 574
         }
Please login to merge, or discard this patch.