@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | { |
| 199 | 199 | $port = $this->getInfoKey('port'); |
| 200 | 200 | |
| 201 | - if(!empty($port)) { |
|
| 201 | + if (!empty($port)) { |
|
| 202 | 202 | return (int)$port; |
| 203 | 203 | } |
| 204 | 204 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | |
| 279 | 279 | protected function getInfoKey(string $name) : string |
| 280 | 280 | { |
| 281 | - if(isset($this->info[$name])) { |
|
| 281 | + if (isset($this->info[$name])) { |
|
| 282 | 282 | return (string)$this->info[$name]; |
| 283 | 283 | } |
| 284 | 284 | |
@@ -287,11 +287,11 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | public function getNormalized() : string |
| 289 | 289 | { |
| 290 | - if(!$this->isValid()) { |
|
| 290 | + if (!$this->isValid()) { |
|
| 291 | 291 | return ''; |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | - if(!isset($this->normalizer)) { |
|
| 294 | + if (!isset($this->normalizer)) { |
|
| 295 | 295 | $this->normalizer = new URLInfo_Normalizer($this); |
| 296 | 296 | } |
| 297 | 297 | |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | */ |
| 320 | 320 | public function getHighlighted() : string |
| 321 | 321 | { |
| 322 | - if(!$this->isValid()) { |
|
| 322 | + if (!$this->isValid()) { |
|
| 323 | 323 | return ''; |
| 324 | 324 | } |
| 325 | 325 | |
@@ -361,14 +361,14 @@ discard block |
||
| 361 | 361 | */ |
| 362 | 362 | public function getParams() : array |
| 363 | 363 | { |
| 364 | - if(!$this->paramExclusion || empty($this->excludedParams)) { |
|
| 364 | + if (!$this->paramExclusion || empty($this->excludedParams)) { |
|
| 365 | 365 | return $this->info['params']; |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | $keep = array(); |
| 369 | - foreach($this->info['params'] as $name => $value) |
|
| 369 | + foreach ($this->info['params'] as $name => $value) |
|
| 370 | 370 | { |
| 371 | - if(!isset($this->excludedParams[$name])) { |
|
| 371 | + if (!isset($this->excludedParams[$name])) { |
|
| 372 | 372 | $keep[$name] = $value; |
| 373 | 373 | } |
| 374 | 374 | } |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | */ |
| 395 | 395 | public function getParam(string $name) : string |
| 396 | 396 | { |
| 397 | - if(isset($this->info['params'][$name])) { |
|
| 397 | + if (isset($this->info['params'][$name])) { |
|
| 398 | 398 | return $this->info['params'][$name]; |
| 399 | 399 | } |
| 400 | 400 | |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | */ |
| 414 | 414 | public function excludeParam(string $name, string $reason) : URLInfo |
| 415 | 415 | { |
| 416 | - if(!isset($this->excludedParams[$name])) |
|
| 416 | + if (!isset($this->excludedParams[$name])) |
|
| 417 | 417 | { |
| 418 | 418 | $this->excludedParams[$name] = $reason; |
| 419 | 419 | $this->setParamExclusion(); |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | |
| 440 | 440 | public function getTypeLabel() : string |
| 441 | 441 | { |
| 442 | - if(!isset(self::$typeLabels)) |
|
| 442 | + if (!isset(self::$typeLabels)) |
|
| 443 | 443 | { |
| 444 | 444 | self::$typeLabels = array( |
| 445 | 445 | self::TYPE_EMAIL => t('Email'), |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | |
| 452 | 452 | $type = $this->getType(); |
| 453 | 453 | |
| 454 | - if(!isset(self::$typeLabels[$type])) |
|
| 454 | + if (!isset(self::$typeLabels[$type])) |
|
| 455 | 455 | { |
| 456 | 456 | throw new BaseException( |
| 457 | 457 | sprintf('Unknown URL type label for type [%s].', $type), |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | * @param bool $highlight |
| 472 | 472 | * @return URLInfo |
| 473 | 473 | */ |
| 474 | - public function setHighlightExcluded(bool $highlight=true) : URLInfo |
|
| 474 | + public function setHighlightExcluded(bool $highlight = true) : URLInfo |
|
| 475 | 475 | { |
| 476 | 476 | $this->highlightExcluded = $highlight; |
| 477 | 477 | return $this; |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | * @see URLInfo::isParamExclusionEnabled() |
| 520 | 520 | * @see URLInfo::setHighlightExcluded() |
| 521 | 521 | */ |
| 522 | - public function setParamExclusion(bool $enabled=true) : URLInfo |
|
| 522 | + public function setParamExclusion(bool $enabled = true) : URLInfo |
|
| 523 | 523 | { |
| 524 | 524 | $this->paramExclusion = $enabled; |
| 525 | 525 | return $this; |
@@ -545,13 +545,13 @@ discard block |
||
| 545 | 545 | */ |
| 546 | 546 | public function containsExcludedParams() : bool |
| 547 | 547 | { |
| 548 | - if(empty($this->excludedParams)) { |
|
| 548 | + if (empty($this->excludedParams)) { |
|
| 549 | 549 | return false; |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | $names = array_keys($this->info['params']); |
| 553 | - foreach($names as $name) { |
|
| 554 | - if(isset($this->excludedParams[$name])) { |
|
| 553 | + foreach ($names as $name) { |
|
| 554 | + if (isset($this->excludedParams[$name])) { |
|
| 555 | 555 | return true; |
| 556 | 556 | } |
| 557 | 557 | } |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | |
| 568 | 568 | public function offsetSet($offset, $value) |
| 569 | 569 | { |
| 570 | - if(in_array($offset, $this->infoKeys)) { |
|
| 570 | + if (in_array($offset, $this->infoKeys)) { |
|
| 571 | 571 | $this->info[$offset] = $value; |
| 572 | 572 | } |
| 573 | 573 | } |
@@ -584,11 +584,11 @@ discard block |
||
| 584 | 584 | |
| 585 | 585 | public function offsetGet($offset) |
| 586 | 586 | { |
| 587 | - if($offset === 'port') { |
|
| 587 | + if ($offset === 'port') { |
|
| 588 | 588 | return $this->getPort(); |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | - if(in_array($offset, $this->infoKeys)) { |
|
| 591 | + if (in_array($offset, $this->infoKeys)) { |
|
| 592 | 592 | return $this->getInfoKey($offset); |
| 593 | 593 | } |
| 594 | 594 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | 'fragment' |
| 78 | 78 | ); |
| 79 | 79 | |
| 80 | - foreach($parts as $part) |
|
| 80 | + foreach ($parts as $part) |
|
| 81 | 81 | { |
| 82 | 82 | $method = 'render_'.$part; |
| 83 | 83 | $result[] = (string)$this->$method(); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | protected function render_scheme() : string |
| 90 | 90 | { |
| 91 | - if(!$this->info->hasScheme()) { |
|
| 91 | + if (!$this->info->hasScheme()) { |
|
| 92 | 92 | return ''; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | protected function render_username() : string |
| 105 | 105 | { |
| 106 | - if(!$this->info->hasUsername()) { |
|
| 106 | + if (!$this->info->hasUsername()) { |
|
| 107 | 107 | return ''; |
| 108 | 108 | } |
| 109 | 109 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | protected function render_host() : string |
| 121 | 121 | { |
| 122 | - if(!$this->info->hasHost()) { |
|
| 122 | + if (!$this->info->hasHost()) { |
|
| 123 | 123 | return ''; |
| 124 | 124 | } |
| 125 | 125 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | protected function render_port() : string |
| 133 | 133 | { |
| 134 | - if(!$this->info->hasPort()) { |
|
| 134 | + if (!$this->info->hasPort()) { |
|
| 135 | 135 | return ''; |
| 136 | 136 | } |
| 137 | 137 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | protected function render_path() : string |
| 146 | 146 | { |
| 147 | - if(!$this->info->hasPath()) { |
|
| 147 | + if (!$this->info->hasPath()) { |
|
| 148 | 148 | return ''; |
| 149 | 149 | } |
| 150 | 150 | |
@@ -162,19 +162,19 @@ discard block |
||
| 162 | 162 | { |
| 163 | 163 | $params = $this->info->getParams(); |
| 164 | 164 | |
| 165 | - if(empty($params)) { |
|
| 165 | + if (empty($params)) { |
|
| 166 | 166 | return ''; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | $tokens = array(); |
| 170 | 170 | $excluded = array(); |
| 171 | 171 | |
| 172 | - if($this->info->isParamExclusionEnabled()) |
|
| 172 | + if ($this->info->isParamExclusionEnabled()) |
|
| 173 | 173 | { |
| 174 | 174 | $excluded = $this->info->getExcludedParams(); |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - foreach($params as $param => $value) |
|
| 177 | + foreach ($params as $param => $value) |
|
| 178 | 178 | { |
| 179 | 179 | $parts = sprintf( |
| 180 | 180 | '<span class="link-param-name">%s</span>'. |
@@ -192,10 +192,10 @@ discard block |
||
| 192 | 192 | $tag = ''; |
| 193 | 193 | |
| 194 | 194 | // is parameter exclusion enabled, and is this an excluded parameter? |
| 195 | - if(isset($excluded[$param])) |
|
| 195 | + if (isset($excluded[$param])) |
|
| 196 | 196 | { |
| 197 | 197 | // display the excluded parameter, but highlight it |
| 198 | - if($this->info->isHighlightExcludeEnabled()) |
|
| 198 | + if ($this->info->isHighlightExcludeEnabled()) |
|
| 199 | 199 | { |
| 200 | 200 | $tooltip = $excluded[$param]; |
| 201 | 201 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | |
| 229 | 229 | protected function render_fragment() : string |
| 230 | 230 | { |
| 231 | - if(!$this->info->hasFragment()) { |
|
| 231 | + if (!$this->info->hasFragment()) { |
|
| 232 | 232 | return ''; |
| 233 | 233 | } |
| 234 | 234 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | { |
| 244 | 244 | $cssFolder = realpath(__DIR__.'/../../css'); |
| 245 | 245 | |
| 246 | - if($cssFolder === false) { |
|
| 246 | + if ($cssFolder === false) { |
|
| 247 | 247 | throw new BaseException( |
| 248 | 248 | 'Cannot find package CSS folder.', |
| 249 | 249 | null, |
@@ -56,16 +56,16 @@ |
||
| 56 | 56 | { |
| 57 | 57 | $normalized = $this->info->getScheme().'://'.$this->info->getHost(); |
| 58 | 58 | |
| 59 | - if($this->info->hasPath()) { |
|
| 59 | + if ($this->info->hasPath()) { |
|
| 60 | 60 | $normalized .= $this->info->getPath(); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $params = $this->info->getParams(); |
| 64 | - if(!empty($params)) { |
|
| 64 | + if (!empty($params)) { |
|
| 65 | 65 | $normalized .= '?'.http_build_query($params); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - if($this->info->hasFragment()) { |
|
| 68 | + if ($this->info->hasFragment()) { |
|
| 69 | 69 | $normalized .= '#'.$this->info->getFragment(); |
| 70 | 70 | } |
| 71 | 71 | |