@@ -123,9 +123,9 @@ discard block |
||
123 | 123 | * @param bool $enabled |
124 | 124 | * @return URLInfo |
125 | 125 | */ |
126 | - public function setUTFEncoding(bool $enabled=true) : URLInfo |
|
126 | + public function setUTFEncoding(bool $enabled = true) : URLInfo |
|
127 | 127 | { |
128 | - if($this->encodeUTFChars !== $enabled) |
|
128 | + if ($this->encodeUTFChars !== $enabled) |
|
129 | 129 | { |
130 | 130 | $this->encodeUTFChars = $enabled; |
131 | 131 | $this->parse(); // re-parse the URL to apply the changes |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | { |
230 | 230 | $port = $this->getInfoKey('port'); |
231 | 231 | |
232 | - if(!empty($port)) { |
|
232 | + if (!empty($port)) { |
|
233 | 233 | return (int)$port; |
234 | 234 | } |
235 | 235 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | |
310 | 310 | protected function getInfoKey(string $name) : string |
311 | 311 | { |
312 | - if(isset($this->info[$name])) { |
|
312 | + if (isset($this->info[$name])) { |
|
313 | 313 | return (string)$this->info[$name]; |
314 | 314 | } |
315 | 315 | |
@@ -338,13 +338,13 @@ discard block |
||
338 | 338 | return $this->normalize(false); |
339 | 339 | } |
340 | 340 | |
341 | - protected function normalize(bool $auth=true) : string |
|
341 | + protected function normalize(bool $auth = true) : string |
|
342 | 342 | { |
343 | - if(!$this->isValid()) { |
|
343 | + if (!$this->isValid()) { |
|
344 | 344 | return ''; |
345 | 345 | } |
346 | 346 | |
347 | - if(!isset($this->normalizer)) { |
|
347 | + if (!isset($this->normalizer)) { |
|
348 | 348 | $this->normalizer = new URLInfo_Normalizer($this); |
349 | 349 | } |
350 | 350 | |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | */ |
375 | 375 | public function getHighlighted() : string |
376 | 376 | { |
377 | - if(!$this->isValid()) { |
|
377 | + if (!$this->isValid()) { |
|
378 | 378 | return ''; |
379 | 379 | } |
380 | 380 | |
@@ -416,14 +416,14 @@ discard block |
||
416 | 416 | */ |
417 | 417 | public function getParams() : array |
418 | 418 | { |
419 | - if(!$this->paramExclusion || empty($this->excludedParams)) { |
|
419 | + if (!$this->paramExclusion || empty($this->excludedParams)) { |
|
420 | 420 | return $this->info['params']; |
421 | 421 | } |
422 | 422 | |
423 | 423 | $keep = array(); |
424 | - foreach($this->info['params'] as $name => $value) |
|
424 | + foreach ($this->info['params'] as $name => $value) |
|
425 | 425 | { |
426 | - if(!isset($this->excludedParams[$name])) { |
|
426 | + if (!isset($this->excludedParams[$name])) { |
|
427 | 427 | $keep[$name] = $value; |
428 | 428 | } |
429 | 429 | } |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | */ |
450 | 450 | public function getParam(string $name) : string |
451 | 451 | { |
452 | - if(isset($this->info['params'][$name])) { |
|
452 | + if (isset($this->info['params'][$name])) { |
|
453 | 453 | return $this->info['params'][$name]; |
454 | 454 | } |
455 | 455 | |
@@ -466,9 +466,9 @@ discard block |
||
466 | 466 | * @param string $reason A human readable explanation why this is excluded - used when highlighting links. |
467 | 467 | * @return URLInfo |
468 | 468 | */ |
469 | - public function excludeParam(string $name, string $reason='') : URLInfo |
|
469 | + public function excludeParam(string $name, string $reason = '') : URLInfo |
|
470 | 470 | { |
471 | - if(!isset($this->excludedParams[$name])) |
|
471 | + if (!isset($this->excludedParams[$name])) |
|
472 | 472 | { |
473 | 473 | $this->excludedParams[$name] = $reason; |
474 | 474 | $this->setParamExclusion(); |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | |
495 | 495 | public function getTypeLabel() : string |
496 | 496 | { |
497 | - if(!isset(self::$typeLabels)) |
|
497 | + if (!isset(self::$typeLabels)) |
|
498 | 498 | { |
499 | 499 | self::$typeLabels = array( |
500 | 500 | self::TYPE_EMAIL => t('Email'), |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | |
507 | 507 | $type = $this->getType(); |
508 | 508 | |
509 | - if(!isset(self::$typeLabels[$type])) |
|
509 | + if (!isset(self::$typeLabels[$type])) |
|
510 | 510 | { |
511 | 511 | throw new BaseException( |
512 | 512 | sprintf('Unknown URL type label for type [%s].', $type), |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | * @param bool $highlight |
527 | 527 | * @return URLInfo |
528 | 528 | */ |
529 | - public function setHighlightExcluded(bool $highlight=true) : URLInfo |
|
529 | + public function setHighlightExcluded(bool $highlight = true) : URLInfo |
|
530 | 530 | { |
531 | 531 | $this->highlightExcluded = $highlight; |
532 | 532 | return $this; |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | * @see URLInfo::isParamExclusionEnabled() |
575 | 575 | * @see URLInfo::setHighlightExcluded() |
576 | 576 | */ |
577 | - public function setParamExclusion(bool $enabled=true) : URLInfo |
|
577 | + public function setParamExclusion(bool $enabled = true) : URLInfo |
|
578 | 578 | { |
579 | 579 | $this->paramExclusion = $enabled; |
580 | 580 | return $this; |
@@ -600,13 +600,13 @@ discard block |
||
600 | 600 | */ |
601 | 601 | public function containsExcludedParams() : bool |
602 | 602 | { |
603 | - if(empty($this->excludedParams)) { |
|
603 | + if (empty($this->excludedParams)) { |
|
604 | 604 | return false; |
605 | 605 | } |
606 | 606 | |
607 | 607 | $names = array_keys($this->info['params']); |
608 | - foreach($names as $name) { |
|
609 | - if(isset($this->excludedParams[$name])) { |
|
608 | + foreach ($names as $name) { |
|
609 | + if (isset($this->excludedParams[$name])) { |
|
610 | 610 | return true; |
611 | 611 | } |
612 | 612 | } |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | |
623 | 623 | public function offsetSet($offset, $value) |
624 | 624 | { |
625 | - if(in_array($offset, $this->infoKeys)) { |
|
625 | + if (in_array($offset, $this->infoKeys)) { |
|
626 | 626 | $this->info[$offset] = $value; |
627 | 627 | } |
628 | 628 | } |
@@ -639,11 +639,11 @@ discard block |
||
639 | 639 | |
640 | 640 | public function offsetGet($offset) |
641 | 641 | { |
642 | - if($offset === 'port') { |
|
642 | + if ($offset === 'port') { |
|
643 | 643 | return $this->getPort(); |
644 | 644 | } |
645 | 645 | |
646 | - if(in_array($offset, $this->infoKeys)) { |
|
646 | + if (in_array($offset, $this->infoKeys)) { |
|
647 | 647 | return $this->getInfoKey($offset); |
648 | 648 | } |
649 | 649 | |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | * @return bool |
676 | 676 | * @throws BaseException |
677 | 677 | */ |
678 | - public function tryConnect(bool $verifySSL=true) : bool |
|
678 | + public function tryConnect(bool $verifySSL = true) : bool |
|
679 | 679 | { |
680 | 680 | return $this->createConnectionTester() |
681 | 681 | ->setVerifySSL($verifySSL) |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | */ |
719 | 719 | public function removeParam(string $param) : URLInfo |
720 | 720 | { |
721 | - if(isset($this->info['params'][$param])) |
|
721 | + if (isset($this->info['params'][$param])) |
|
722 | 722 | { |
723 | 723 | unset($this->info['params'][$param]); |
724 | 724 | } |