Passed
Push — master ( 2d6f8b...2b9668 )
by Sebastian
08:32 queued 11s
created
src/NumberInfo.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function setValue($value) : NumberInfo
86 86
     {
87
-        if($value instanceof NumberInfo) {
87
+        if ($value instanceof NumberInfo) {
88 88
             $value = $value->getValue();
89 89
         }
90 90
         
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     
118 118
     public function isPositive() : bool
119 119
     {
120
-        if(!$this->isEmpty()) {
120
+        if (!$this->isEmpty()) {
121 121
             $number = $this->getNumber();
122 122
             return $number > 0;
123 123
         }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      */
149 149
     public function hasValue() : bool
150 150
     {
151
-        if(!$this->isEmpty() && !$this->isZero()) {
151
+        if (!$this->isEmpty() && !$this->isZero()) {
152 152
             return true;
153 153
         }
154 154
         
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
      */
222 222
     public function getUnits()
223 223
     {
224
-        if(!$this->hasUnits()) {
224
+        if (!$this->hasUnits()) {
225 225
             return 'px';
226 226
         }
227 227
         
@@ -255,15 +255,15 @@  discard block
 block discarded – undo
255 255
      */
256 256
     public function toAttribute()
257 257
     {
258
-        if($this->isEmpty()) {
258
+        if ($this->isEmpty()) {
259 259
             return null;
260 260
         }
261 261
         
262
-        if($this->isZero()) {
262
+        if ($this->isZero()) {
263 263
             return '0';
264 264
         }
265 265
         
266
-        if($this->isPercent()) {
266
+        if ($this->isPercent()) {
267 267
             return $this->getNumber().$this->getUnits();
268 268
         }
269 269
         
@@ -276,11 +276,11 @@  discard block
 block discarded – undo
276 276
      */
277 277
     public function toCSS()
278 278
     {
279
-        if($this->isEmpty()) {
279
+        if ($this->isEmpty()) {
280 280
             return null;
281 281
         }
282 282
         
283
-        if($this->isZero()) {
283
+        if ($this->isZero()) {
284 284
             return '0';
285 285
         }
286 286
         
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
     
290 290
     public function __toString()
291 291
     {
292
-        if($this->isEmpty()) {
292
+        if ($this->isEmpty()) {
293 293
             return '';
294 294
         }
295 295
         
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
     public function isBiggerThan($number)
308 308
     {
309 309
         $number = parseNumber($number);
310
-        if($number->getUnits() != $this->getUnits()) {
310
+        if ($number->getUnits() != $this->getUnits()) {
311 311
             return false;
312 312
         }
313 313
         
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
     public function isSmallerThan($number)
326 326
     {
327 327
         $number = parseNumber($number);
328
-        if($number->getUnits() != $this->getUnits()) {
328
+        if ($number->getUnits() != $this->getUnits()) {
329 329
             return false;
330 330
         }
331 331
         
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
     public function isBiggerEqual($number)
336 336
     {
337 337
         $number = parseNumber($number);
338
-        if($number->getUnits() != $this->getUnits()) {
338
+        if ($number->getUnits() != $this->getUnits()) {
339 339
             return false;
340 340
         }
341 341
         
@@ -352,14 +352,14 @@  discard block
 block discarded – undo
352 352
      */
353 353
     public function add($value)
354 354
     {
355
-        if($this->isEmpty()) {
355
+        if ($this->isEmpty()) {
356 356
             $this->setValue($value);
357 357
             return $this;
358 358
         }
359 359
         
360 360
         $number = parseNumber($value);
361 361
         
362
-        if($number->getUnits() == $this->getUnits() || !$number->hasUnits())
362
+        if ($number->getUnits() == $this->getUnits() || !$number->hasUnits())
363 363
         {
364 364
             $new = $this->getNumber() + $number->getNumber();
365 365
             $this->setValue($new.$this->getUnits());
@@ -378,14 +378,14 @@  discard block
 block discarded – undo
378 378
      */
379 379
     public function subtract($value)
380 380
     {
381
-        if($this->isEmpty()) {
381
+        if ($this->isEmpty()) {
382 382
             $this->setValue($value);
383 383
             return $this;
384 384
         }
385 385
         
386 386
         $number = parseNumber($value);
387 387
         
388
-        if($number->getUnits() == $this->getUnits() || !$number->hasUnits())
388
+        if ($number->getUnits() == $this->getUnits() || !$number->hasUnits())
389 389
         {
390 390
             $new = $this->getNumber() - $number->getNumber();
391 391
             $this->setValue($new.$this->getUnits());
@@ -412,25 +412,25 @@  discard block
 block discarded – undo
412 412
     
413 413
     protected function percentOperation($operation, $percent)
414 414
     {
415
-        if($this->isZeroOrEmpty()) {
415
+        if ($this->isZeroOrEmpty()) {
416 416
             return $this;
417 417
         }
418 418
         
419 419
         $percent = parseNumber($percent);
420
-        if($percent->hasUnits() && !$percent->isPercent()) {
420
+        if ($percent->hasUnits() && !$percent->isPercent()) {
421 421
             return $this;
422 422
         }
423 423
         
424 424
         $number = $this->getNumber();
425 425
         $value = $number * $percent->getNumber() / 100;
426 426
         
427
-        if($operation == '-') {
427
+        if ($operation == '-') {
428 428
             $number = $number - $value;
429 429
         } else {
430 430
             $number = $number + $value;
431 431
         }
432 432
         
433
-        if($this->isUnitInteger()) {
433
+        if ($this->isUnitInteger()) {
434 434
             $number = intval($number);
435 435
         }
436 436
         
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
         
482 482
         $key = $this->createValueKey($value);
483 483
 
484
-        if(array_key_exists($key, $cache)) {
484
+        if (array_key_exists($key, $cache)) {
485 485
             return $cache[$key];
486 486
         }
487 487
         
@@ -491,13 +491,13 @@  discard block
 block discarded – undo
491 491
             'number' => null
492 492
         );
493 493
         
494
-        if($key === '_EMPTY_') 
494
+        if ($key === '_EMPTY_') 
495 495
         {
496 496
             $cache[$key]['empty'] = true;
497 497
             return $cache[$key];
498 498
         }
499 499
         
500
-        if($value === 0 || $value === '0') 
500
+        if ($value === 0 || $value === '0') 
501 501
         {
502 502
             $cache[$key]['number'] = 0;
503 503
             $cache[$key] = $this->filterInfo($cache[$key]);
@@ -506,20 +506,20 @@  discard block
 block discarded – undo
506 506
         
507 507
         $test = trim((string)$value);
508 508
         
509
-        if($test === '') 
509
+        if ($test === '') 
510 510
         {
511 511
             $cache[$key]['empty'] = true;
512 512
             return $cache[$key];
513 513
         }
514 514
         
515 515
         // replace comma notation (which is only possible if it's a string)
516
-        if(is_string($value))
516
+        if (is_string($value))
517 517
         {
518 518
             $test = $this->preProcess($test, $cache, $value);
519 519
         }
520 520
         
521 521
         // convert to a number if it's numeric
522
-        if(is_numeric($test)) 
522
+        if (is_numeric($test)) 
523 523
         {
524 524
             $cache[$key]['number'] = $test * 1;
525 525
             $cache[$key] = $this->filterInfo($cache[$key]);
@@ -545,19 +545,19 @@  discard block
 block discarded – undo
545 545
         $empty = false;
546 546
         
547 547
         $found = $this->findUnits($test);
548
-        if($found !== null) 
548
+        if ($found !== null) 
549 549
         {
550 550
             $number = $found['number'];
551 551
             $units = $found['units'];
552 552
         }
553 553
         
554 554
         // the filters have to restore the value
555
-        if($this->postProcess)
555
+        if ($this->postProcess)
556 556
         {
557 557
             $number = $this->postProcess($number, $test);
558 558
         }
559 559
         // empty number
560
-        else if($number === '' || $number === null || is_bool($number))
560
+        else if ($number === '' || $number === null || is_bool($number))
561 561
         {
562 562
             $number = null;
563 563
             $empty = true;
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
             $number = trim($number);
569 569
             
570 570
             // may be an arbitrary string in some cases
571
-            if(!is_numeric($number))
571
+            if (!is_numeric($number))
572 572
             {
573 573
                 $number = null;
574 574
                 $empty = true;
@@ -600,17 +600,17 @@  discard block
 block discarded – undo
600 600
         $vlength = strlen($value);
601 601
         $names = array_keys($this->knownUnits);
602 602
         
603
-        foreach($names as $unit)
603
+        foreach ($names as $unit)
604 604
         {
605 605
             $ulength = strlen($unit);
606
-            $start = $vlength-$ulength;
607
-            if($start < 0) {
606
+            $start = $vlength - $ulength;
607
+            if ($start < 0) {
608 608
                 continue;
609 609
             }
610 610
             
611 611
             $search = substr($value, $start, $ulength);
612 612
             
613
-            if($search==$unit) 
613
+            if ($search == $unit) 
614 614
             {
615 615
                 return array(
616 616
                     'units' => $unit,
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
     */
631 631
     private function createValueKey($value) : string
632 632
     {
633
-        if(!is_string($value) && !is_numeric($value))
633
+        if (!is_string($value) && !is_numeric($value))
634 634
         {
635 635
             return '_EMPTY_';
636 636
         }
@@ -696,12 +696,12 @@  discard block
 block discarded – undo
696 696
     protected function filterInfo(array $info) : array
697 697
     {
698 698
         $useUnits = 'px';
699
-        if($info['units'] !== null) {
699
+        if ($info['units'] !== null) {
700 700
             $useUnits = $info['units'];
701 701
         }
702 702
         
703 703
         // the units are non-decimal: convert decimal values
704
-        if($useUnits !== null && $this->knownUnits[$useUnits] === false && !$info['empty'] && is_numeric($info['number']))
704
+        if ($useUnits !== null && $this->knownUnits[$useUnits] === false && !$info['empty'] && is_numeric($info['number']))
705 705
         {
706 706
             $info['number'] = intval($info['number']);
707 707
         }
Please login to merge, or discard this patch.
src/URLInfo.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -156,26 +156,26 @@  discard block
 block discarded – undo
156 156
 
157 157
         $this->filterParsed();
158 158
         
159
-        if($this->detectEmail()) {
159
+        if ($this->detectEmail()) {
160 160
             return;
161 161
         }
162 162
         
163
-        if($this->detectFragmentLink()) {
163
+        if ($this->detectFragmentLink()) {
164 164
             return;
165 165
         }
166 166
         
167
-        if($this->detectPhoneLink()) {
167
+        if ($this->detectPhoneLink()) {
168 168
             return;
169 169
         }
170 170
         
171
-        if(!$this->isValid) {
171
+        if (!$this->isValid) {
172 172
             return;
173 173
         }
174 174
         
175 175
         // no scheme found: it may be an email address without the mailto:
176 176
         // It can't be a variable, since without the scheme it would already
177 177
         // have been recognized as a vaiable only link.
178
-        if(!isset($this->info['scheme'])) {
178
+        if (!isset($this->info['scheme'])) {
179 179
             $this->setError(
180 180
                 self::ERROR_MISSING_SCHEME,
181 181
                 t('Cannot determine the link\'s scheme, e.g. %1$s.', 'http')
@@ -184,10 +184,10 @@  discard block
 block discarded – undo
184 184
             return;
185 185
         }
186 186
         
187
-        if(!in_array($this->info['scheme'], $this->knownSchemes)) {
187
+        if (!in_array($this->info['scheme'], $this->knownSchemes)) {
188 188
             $this->setError(
189 189
                 self::ERROR_INVALID_SCHEME,
190
-                t('The scheme %1$s is not supported for links.', $this->info['scheme']) . ' ' .
190
+                t('The scheme %1$s is not supported for links.', $this->info['scheme']).' '.
191 191
                 t('Valid schemes are: %1$s.', implode(', ', $this->knownSchemes))
192 192
             );
193 193
             $this->isValid = false;
@@ -197,17 +197,17 @@  discard block
 block discarded – undo
197 197
         // every link needs a host. This case can happen for ex, if
198 198
         // the link starts with a typo with only one slash, like:
199 199
         // "http:/hostname"
200
-        if(!isset($this->info['host'])) {
200
+        if (!isset($this->info['host'])) {
201 201
             $this->setError(
202 202
                 self::ERROR_MISSING_HOST,
203
-                t('Cannot determine the link\'s host name.') . ' ' .
203
+                t('Cannot determine the link\'s host name.').' '.
204 204
                 t('This usually happens when there\'s a typo somewhere.')
205 205
             );
206 206
             $this->isValid = false;
207 207
             return;
208 208
         }
209 209
 
210
-        if(!empty($this->info['query'])) 
210
+        if (!empty($this->info['query'])) 
211 211
         {
212 212
             $this->params = \AppUtils\ConvertHelper::parseQueryString($this->info['query']);
213 213
             ksort($this->params);
@@ -252,30 +252,30 @@  discard block
 block discarded – undo
252 252
     */
253 253
     protected function filterParsed()
254 254
     {
255
-        foreach($this->info as $key => $val)
255
+        foreach ($this->info as $key => $val)
256 256
         {
257
-            if(is_string($val)) {
257
+            if (is_string($val)) {
258 258
                 $this->info[$key] = trim($val);
259 259
             }
260 260
         }
261 261
         
262
-        if(isset($this->info['host'])) {
262
+        if (isset($this->info['host'])) {
263 263
             $this->info['host'] = str_replace(' ', '', $this->info['host']);
264 264
         }
265 265
         
266
-        if(isset($this->info['path'])) {
266
+        if (isset($this->info['path'])) {
267 267
             $this->info['path'] = str_replace(' ', '', $this->info['path']);
268 268
         }
269 269
     }
270 270
     
271 271
     protected function detectEmail()
272 272
     {
273
-        if(isset($this->info['scheme']) && $this->info['scheme'] == 'mailto') {
273
+        if (isset($this->info['scheme']) && $this->info['scheme'] == 'mailto') {
274 274
             $this->isEmail = true;
275 275
             return true;
276 276
         }
277 277
         
278
-        if(isset($this->info['path']) && preg_match(\AppUtils\RegexHelper::REGEX_EMAIL, $this->info['path'])) 
278
+        if (isset($this->info['path']) && preg_match(\AppUtils\RegexHelper::REGEX_EMAIL, $this->info['path'])) 
279 279
         {
280 280
             $this->info['scheme'] = 'email';
281 281
             $this->isEmail = true;
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     
288 288
     protected function detectFragmentLink()
289 289
     {
290
-        if(isset($this->info['fragment']) && !isset($this->info['scheme'])) {
290
+        if (isset($this->info['fragment']) && !isset($this->info['scheme'])) {
291 291
             $this->isFragment = true;
292 292
             return true;
293 293
         }
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
     
298 298
     protected function detectPhoneLink()
299 299
     {
300
-        if(isset($this->info['scheme']) && $this->info['scheme'] == 'tel') {
300
+        if (isset($this->info['scheme']) && $this->info['scheme'] == 'tel') {
301 301
             $this->isPhone = true;
302 302
             return true;
303 303
         }
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
      */
312 312
     public function isSecure()
313 313
     {
314
-        if(isset($this->info['scheme']) && $this->info['scheme']=='https') {
314
+        if (isset($this->info['scheme']) && $this->info['scheme'] == 'https') {
315 315
             return true;
316 316
         }
317 317
         
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
     public function getPort() : int
387 387
     {
388 388
         $port = $this->getInfoKey('port');
389
-        if(!empty($port)) {
389
+        if (!empty($port)) {
390 390
             return (int)$port;
391 391
         }
392 392
         
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
     
467 467
     protected function getInfoKey(string $name) : string
468 468
     {
469
-        if(isset($this->info[$name])) {
469
+        if (isset($this->info[$name])) {
470 470
             return (string)$this->info[$name];
471 471
         }
472 472
         
@@ -475,34 +475,34 @@  discard block
 block discarded – undo
475 475
     
476 476
     public function getNormalized() : string
477 477
     {
478
-        if(!$this->isValid) {
478
+        if (!$this->isValid) {
479 479
             return '';
480 480
         }
481 481
         
482
-        if($this->isFragment === true)
482
+        if ($this->isFragment === true)
483 483
         {
484 484
             return '#'.$this->getFragment();
485 485
         }
486
-        else if($this->isPhone === true)
486
+        else if ($this->isPhone === true)
487 487
         {
488 488
             return 'tel://'.$this->getHost();
489 489
         }
490
-        else if($this->isEmail === true)
490
+        else if ($this->isEmail === true)
491 491
         {
492 492
             return 'mailto:'.$this->getPath();
493 493
         }
494 494
         
495 495
         $normalized = $this->info['scheme'].'://'.$this->info['host'];
496
-        if(isset($this->info['path'])) {
496
+        if (isset($this->info['path'])) {
497 497
             $normalized .= $this->info['path'];
498 498
         }
499 499
         
500 500
         $params = $this->getParams();
501
-        if(!empty($params)) {
501
+        if (!empty($params)) {
502 502
             $normalized .= '?'.http_build_query($params);
503 503
         }
504 504
         
505
-        if(isset($this->info['fragment'])) {
505
+        if (isset($this->info['fragment'])) {
506 506
             $normalized .= '#'.$this->info['fragment'];
507 507
         }
508 508
         
@@ -530,11 +530,11 @@  discard block
 block discarded – undo
530 530
     */
531 531
     public function getHighlighted() : string
532 532
     {
533
-        if(!$this->isValid) {
533
+        if (!$this->isValid) {
534 534
             return '';
535 535
         }
536 536
         
537
-        if($this->isEmail) {
537
+        if ($this->isEmail) {
538 538
             return sprintf(
539 539
                 '<span class="link-scheme scheme-mailto">mailto:</span>'.
540 540
                 '<span class="link-host">%s</span>',
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
             );
543 543
         }
544 544
         
545
-        if($this->isFragment) {
545
+        if ($this->isFragment) {
546 546
             return sprintf(
547 547
                 '<span class="link-fragment-sign">#</span>'.
548 548
                 '<span class="link-fragment-value">%s</span>',
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
         
553 553
         $result = '';
554 554
         
555
-        if($this->hasScheme())
555
+        if ($this->hasScheme())
556 556
         {
557 557
             $result = sprintf(
558 558
                 '<span class="link-scheme scheme-%1$s">'.
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 
565 565
         $result .= '<span class="link-component double-slashes">//</span>';
566 566
         
567
-        if($this->hasUsername())
567
+        if ($this->hasUsername())
568 568
         {
569 569
             $result .= sprintf(
570 570
                 '<span class="link-credentials">%s</span>'.
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
             );
577 577
         }
578 578
         
579
-        if($this->hasHost()) 
579
+        if ($this->hasHost()) 
580 580
         {
581 581
             $result .=
582 582
             sprintf(
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
             );
586 586
         }
587 587
         
588
-        if($this->hasPort()) 
588
+        if ($this->hasPort()) 
589 589
         {
590 590
             $result .= sprintf(
591 591
                 '<span class="link-component port-separator">:</span>'.
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
             );
595 595
         }
596 596
         
597
-        if($this->hasPath()) 
597
+        if ($this->hasPath()) 
598 598
         {
599 599
             $path = str_replace(array(';', '='), array(';<wbr>', '=<wbr>'), $this->getPath());
600 600
             $tokens = explode('/', $path);
@@ -605,11 +605,11 @@  discard block
 block discarded – undo
605 605
             );
606 606
         }
607 607
         
608
-        if(!empty($this->params))
608
+        if (!empty($this->params))
609 609
         {
610 610
             $tokens = array();
611 611
             
612
-            foreach($this->params as $param => $value)
612
+            foreach ($this->params as $param => $value)
613 613
             {
614 614
                 $parts = sprintf(
615 615
                     '<span class="link-param-name">%s</span>'.
@@ -627,10 +627,10 @@  discard block
 block discarded – undo
627 627
                 $tag = '';
628 628
                 
629 629
                 // is parameter exclusion enabled, and is this an excluded parameter?
630
-                if($this->paramExclusion && isset($this->excludedParams[$param]))
630
+                if ($this->paramExclusion && isset($this->excludedParams[$param]))
631 631
                 {
632 632
                     // display the excluded parameter, but highlight it
633
-                    if($this->highlightExcluded)
633
+                    if ($this->highlightExcluded)
634 634
                     {
635 635
                         $tooltip = $this->excludedParams[$param];
636 636
                         
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
             '<span class="link-component query-sign">?</span>'.implode('<span class="link-component param-separator">&amp;</span>', $tokens);
661 661
         }
662 662
         
663
-        if(isset($this->info['fragment'])) {
663
+        if (isset($this->info['fragment'])) {
664 664
             $result .= sprintf(
665 665
                 '<span class="link-fragment-sign">#</span>'.
666 666
                 '<span class="link-fragment">%s</span>',
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
     
684 684
     public function getErrorMessage() : string
685 685
     {
686
-        if(isset($this->error)) {
686
+        if (isset($this->error)) {
687 687
             return $this->error['message'];
688 688
         }
689 689
         
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
     
693 693
     public function getErrorCode() : int
694 694
     {
695
-        if(isset($this->error)) {
695
+        if (isset($this->error)) {
696 696
             return $this->error['code'];
697 697
         }
698 698
         
@@ -722,13 +722,13 @@  discard block
 block discarded – undo
722 722
     */
723 723
     public function getParams() : array
724 724
     {
725
-        if(!$this->paramExclusion || empty($this->excludedParams)) {
725
+        if (!$this->paramExclusion || empty($this->excludedParams)) {
726 726
             return $this->params;
727 727
         }
728 728
         
729 729
         $keep = array();
730
-        foreach($this->params as $name => $value) {
731
-            if(!isset($this->excludedParams[$name])) {
730
+        foreach ($this->params as $name => $value) {
731
+            if (!isset($this->excludedParams[$name])) {
732 732
                 $keep[$name] = $value;
733 733
             }
734 734
         }
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
     */
755 755
     public function getParam(string $name) : string
756 756
     {
757
-        if(isset($this->params[$name])) {
757
+        if (isset($this->params[$name])) {
758 758
             return $this->params[$name];
759 759
         }
760 760
         
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
     */
774 774
     public function excludeParam(string $name, string $reason) : URLInfo
775 775
     {
776
-        if(!isset($this->excludedParams[$name]))
776
+        if (!isset($this->excludedParams[$name]))
777 777
         {
778 778
             $this->excludedParams[$name] = $reason;
779 779
             $this->setParamExclusion();
@@ -794,15 +794,15 @@  discard block
 block discarded – undo
794 794
      */
795 795
     public function getType() : string
796 796
     {
797
-        if($this->isEmail) {
797
+        if ($this->isEmail) {
798 798
             return self::TYPE_EMAIL;
799 799
         }
800 800
         
801
-        if($this->isFragment) {
801
+        if ($this->isFragment) {
802 802
             return self::TYPE_FRAGMENT;
803 803
         }
804 804
         
805
-        if($this->isPhone) {
805
+        if ($this->isPhone) {
806 806
             return self::TYPE_PHONE;
807 807
         }
808 808
         
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
     
812 812
     public function getTypeLabel() : string
813 813
     {
814
-        if(!isset(self::$typeLabels))
814
+        if (!isset(self::$typeLabels))
815 815
         {
816 816
             self::$typeLabels = array(
817 817
                 self::TYPE_EMAIL => t('Email'),
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
         
824 824
         $type = $this->getType();
825 825
         
826
-        if(!isset(self::$typeLabels[$type]))
826
+        if (!isset(self::$typeLabels[$type]))
827 827
         {
828 828
             throw new BaseException(
829 829
                 sprintf('Unknown URL type label for type [%s].', $type),
@@ -843,7 +843,7 @@  discard block
 block discarded – undo
843 843
     * @param bool $highlight
844 844
     * @return URLInfo
845 845
     */
846
-    public function setHighlightExcluded(bool $highlight=true) : URLInfo
846
+    public function setHighlightExcluded(bool $highlight = true) : URLInfo
847 847
     {
848 848
         $this->highlightExcluded = $highlight;
849 849
         return $this;
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
      * @see URLInfo::isParamExclusionEnabled()
892 892
      * @see URLInfo::setHighlightExcluded()
893 893
      */
894
-    public function setParamExclusion(bool $enabled=true) : URLInfo
894
+    public function setParamExclusion(bool $enabled = true) : URLInfo
895 895
     {
896 896
         $this->paramExclusion = $enabled;
897 897
         return $this;
@@ -917,13 +917,13 @@  discard block
 block discarded – undo
917 917
     */
918 918
     public function containsExcludedParams() : bool
919 919
     {
920
-        if(empty($this->excludedParams)) {
920
+        if (empty($this->excludedParams)) {
921 921
             return false;
922 922
         }
923 923
         
924 924
         $names = array_keys($this->params);
925
-        foreach($names as $name) {
926
-            if(isset($this->excludedParams[$name])) {
925
+        foreach ($names as $name) {
926
+            if (isset($this->excludedParams[$name])) {
927 927
                 return true;
928 928
             }
929 929
         }
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
 
940 940
     public function offsetSet($offset, $value) 
941 941
     {
942
-        if(in_array($offset, $this->infoKeys)) {
942
+        if (in_array($offset, $this->infoKeys)) {
943 943
             $this->info[$offset] = $value;
944 944
         }
945 945
     }
@@ -956,11 +956,11 @@  discard block
 block discarded – undo
956 956
     
957 957
     public function offsetGet($offset) 
958 958
     {
959
-        if($offset === 'port') {
959
+        if ($offset === 'port') {
960 960
             return $this->getPort();
961 961
         }
962 962
         
963
-        if(in_array($offset, $this->infoKeys)) {
963
+        if (in_array($offset, $this->infoKeys)) {
964 964
             return $this->getInfoKey($offset);
965 965
         }
966 966
         
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
     {
972 972
         $cssFolder = realpath(__DIR__.'/../css');
973 973
         
974
-        if($cssFolder === false) {
974
+        if ($cssFolder === false) {
975 975
             throw new BaseException(
976 976
                 'Cannot find package CSS folder.',
977 977
                 null,
Please login to merge, or discard this patch.