@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | { |
201 | 201 | $port = $this->getInfoKey('port'); |
202 | 202 | |
203 | - if(!empty($port)) { |
|
203 | + if (!empty($port)) { |
|
204 | 204 | return (int)$port; |
205 | 205 | } |
206 | 206 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | protected function getInfoKey(string $name) : string |
282 | 282 | { |
283 | - if(isset($this->info[$name])) { |
|
283 | + if (isset($this->info[$name])) { |
|
284 | 284 | return (string)$this->info[$name]; |
285 | 285 | } |
286 | 286 | |
@@ -289,11 +289,11 @@ discard block |
||
289 | 289 | |
290 | 290 | public function getNormalized() : string |
291 | 291 | { |
292 | - if(!$this->isValid()) { |
|
292 | + if (!$this->isValid()) { |
|
293 | 293 | return ''; |
294 | 294 | } |
295 | 295 | |
296 | - if(!isset($this->normalizer)) { |
|
296 | + if (!isset($this->normalizer)) { |
|
297 | 297 | $this->normalizer = new URLInfo_Normalizer($this); |
298 | 298 | } |
299 | 299 | |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | */ |
322 | 322 | public function getHighlighted() : string |
323 | 323 | { |
324 | - if(!$this->isValid()) { |
|
324 | + if (!$this->isValid()) { |
|
325 | 325 | return ''; |
326 | 326 | } |
327 | 327 | |
@@ -363,14 +363,14 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function getParams() : array |
365 | 365 | { |
366 | - if(!$this->paramExclusion || empty($this->excludedParams)) { |
|
366 | + if (!$this->paramExclusion || empty($this->excludedParams)) { |
|
367 | 367 | return $this->info['params']; |
368 | 368 | } |
369 | 369 | |
370 | 370 | $keep = array(); |
371 | - foreach($this->info['params'] as $name => $value) |
|
371 | + foreach ($this->info['params'] as $name => $value) |
|
372 | 372 | { |
373 | - if(!isset($this->excludedParams[$name])) { |
|
373 | + if (!isset($this->excludedParams[$name])) { |
|
374 | 374 | $keep[$name] = $value; |
375 | 375 | } |
376 | 376 | } |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | */ |
397 | 397 | public function getParam(string $name) : string |
398 | 398 | { |
399 | - if(isset($this->info['params'][$name])) { |
|
399 | + if (isset($this->info['params'][$name])) { |
|
400 | 400 | return $this->info['params'][$name]; |
401 | 401 | } |
402 | 402 | |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | */ |
416 | 416 | public function excludeParam(string $name, string $reason) : URLInfo |
417 | 417 | { |
418 | - if(!isset($this->excludedParams[$name])) |
|
418 | + if (!isset($this->excludedParams[$name])) |
|
419 | 419 | { |
420 | 420 | $this->excludedParams[$name] = $reason; |
421 | 421 | $this->setParamExclusion(); |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | |
442 | 442 | public function getTypeLabel() : string |
443 | 443 | { |
444 | - if(!isset(self::$typeLabels)) |
|
444 | + if (!isset(self::$typeLabels)) |
|
445 | 445 | { |
446 | 446 | self::$typeLabels = array( |
447 | 447 | self::TYPE_EMAIL => t('Email'), |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | |
454 | 454 | $type = $this->getType(); |
455 | 455 | |
456 | - if(!isset(self::$typeLabels[$type])) |
|
456 | + if (!isset(self::$typeLabels[$type])) |
|
457 | 457 | { |
458 | 458 | throw new BaseException( |
459 | 459 | sprintf('Unknown URL type label for type [%s].', $type), |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | * @param bool $highlight |
474 | 474 | * @return URLInfo |
475 | 475 | */ |
476 | - public function setHighlightExcluded(bool $highlight=true) : URLInfo |
|
476 | + public function setHighlightExcluded(bool $highlight = true) : URLInfo |
|
477 | 477 | { |
478 | 478 | $this->highlightExcluded = $highlight; |
479 | 479 | return $this; |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | * @see URLInfo::isParamExclusionEnabled() |
522 | 522 | * @see URLInfo::setHighlightExcluded() |
523 | 523 | */ |
524 | - public function setParamExclusion(bool $enabled=true) : URLInfo |
|
524 | + public function setParamExclusion(bool $enabled = true) : URLInfo |
|
525 | 525 | { |
526 | 526 | $this->paramExclusion = $enabled; |
527 | 527 | return $this; |
@@ -547,13 +547,13 @@ discard block |
||
547 | 547 | */ |
548 | 548 | public function containsExcludedParams() : bool |
549 | 549 | { |
550 | - if(empty($this->excludedParams)) { |
|
550 | + if (empty($this->excludedParams)) { |
|
551 | 551 | return false; |
552 | 552 | } |
553 | 553 | |
554 | 554 | $names = array_keys($this->info['params']); |
555 | - foreach($names as $name) { |
|
556 | - if(isset($this->excludedParams[$name])) { |
|
555 | + foreach ($names as $name) { |
|
556 | + if (isset($this->excludedParams[$name])) { |
|
557 | 557 | return true; |
558 | 558 | } |
559 | 559 | } |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | |
570 | 570 | public function offsetSet($offset, $value) |
571 | 571 | { |
572 | - if(in_array($offset, $this->infoKeys)) { |
|
572 | + if (in_array($offset, $this->infoKeys)) { |
|
573 | 573 | $this->info[$offset] = $value; |
574 | 574 | } |
575 | 575 | } |
@@ -586,11 +586,11 @@ discard block |
||
586 | 586 | |
587 | 587 | public function offsetGet($offset) |
588 | 588 | { |
589 | - if($offset === 'port') { |
|
589 | + if ($offset === 'port') { |
|
590 | 590 | return $this->getPort(); |
591 | 591 | } |
592 | 592 | |
593 | - if(in_array($offset, $this->infoKeys)) { |
|
593 | + if (in_array($offset, $this->infoKeys)) { |
|
594 | 594 | return $this->getInfoKey($offset); |
595 | 595 | } |
596 | 596 | |
@@ -623,12 +623,12 @@ discard block |
||
623 | 623 | * @return bool |
624 | 624 | * @throws BaseException |
625 | 625 | */ |
626 | - public function tryConnect(bool $verifySSL=true) : bool |
|
626 | + public function tryConnect(bool $verifySSL = true) : bool |
|
627 | 627 | { |
628 | 628 | requireCURL(); |
629 | 629 | |
630 | 630 | $ch = curl_init(); |
631 | - if($ch === false) |
|
631 | + if ($ch === false) |
|
632 | 632 | { |
633 | 633 | throw new BaseException( |
634 | 634 | 'Could not initialize a new cURL instance.', |
@@ -644,13 +644,13 @@ discard block |
||
644 | 644 | curl_setopt($ch, CURLOPT_TIMEOUT, 10); |
645 | 645 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
646 | 646 | |
647 | - if(!$verifySSL) |
|
647 | + if (!$verifySSL) |
|
648 | 648 | { |
649 | 649 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); |
650 | 650 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); |
651 | 651 | } |
652 | 652 | |
653 | - if($this->hasUsername()) |
|
653 | + if ($this->hasUsername()) |
|
654 | 654 | { |
655 | 655 | curl_setopt($ch, CURLOPT_USERNAME, $this->getUsername()); |
656 | 656 | curl_setopt($ch, CURLOPT_PASSWORD, $this->getPassword()); |