@@ -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 | |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | */ |
469 | 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 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @param bool $verifySSL |
48 | 48 | * @return URLInfo_ConnectionTester |
49 | 49 | */ |
50 | - public function setVerifySSL(bool $verifySSL=true) : URLInfo_ConnectionTester |
|
50 | + public function setVerifySSL(bool $verifySSL = true) : URLInfo_ConnectionTester |
|
51 | 51 | { |
52 | 52 | $this->setOption('verify-ssl', $verifySSL); |
53 | 53 | return $this; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | return $this->getBoolOption('verify-ssl'); |
59 | 59 | } |
60 | 60 | |
61 | - public function setVerboseMode(bool $enabled=true) : URLInfo_ConnectionTester |
|
61 | + public function setVerboseMode(bool $enabled = true) : URLInfo_ConnectionTester |
|
62 | 62 | { |
63 | 63 | $this->setOption('curl-verbose', $enabled); |
64 | 64 | return $this; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | $ch = curl_init(); |
77 | 77 | |
78 | - if(!is_resource($ch)) |
|
78 | + if (!is_resource($ch)) |
|
79 | 79 | { |
80 | 80 | throw new BaseException( |
81 | 81 | 'Could not initialize a new cURL instance.', |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | ); |
85 | 85 | } |
86 | 86 | |
87 | - if($this->isVerboseModeEnabled()) |
|
87 | + if ($this->isVerboseModeEnabled()) |
|
88 | 88 | { |
89 | 89 | curl_setopt($ch, CURLOPT_VERBOSE, true); |
90 | 90 | } |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | curl_setopt($ch, CURLOPT_TIMEOUT, 10); |
95 | 95 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
96 | 96 | |
97 | - if(!$this->isVerifySSLEnabled()) |
|
97 | + if (!$this->isVerifySSLEnabled()) |
|
98 | 98 | { |
99 | 99 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); |
100 | 100 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); |
101 | 101 | } |
102 | 102 | |
103 | - if($this->url->hasUsername()) |
|
103 | + if ($this->url->hasUsername()) |
|
104 | 104 | { |
105 | 105 | curl_setopt($ch, CURLOPT_USERNAME, $this->url->getUsername()); |
106 | 106 | curl_setopt($ch, CURLOPT_PASSWORD, $this->url->getPassword()); |