@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | */ |
21 | 21 | class URLInfo_Highlighter |
22 | 22 | { |
23 | - /** |
|
24 | - * @var URLInfo |
|
25 | - */ |
|
23 | + /** |
|
24 | + * @var URLInfo |
|
25 | + */ |
|
26 | 26 | protected $info; |
27 | 27 | |
28 | 28 | public function __construct(URLInfo $info) |
@@ -158,13 +158,13 @@ discard block |
||
158 | 158 | ); |
159 | 159 | } |
160 | 160 | |
161 | - /** |
|
162 | - * Fetches all parameters in the URL, regardless of |
|
163 | - * whether parameter exclusion is enabled, so they |
|
164 | - * can be highlighted is need be. |
|
165 | - * |
|
166 | - * @return array |
|
167 | - */ |
|
161 | + /** |
|
162 | + * Fetches all parameters in the URL, regardless of |
|
163 | + * whether parameter exclusion is enabled, so they |
|
164 | + * can be highlighted is need be. |
|
165 | + * |
|
166 | + * @return array |
|
167 | + */ |
|
168 | 168 | protected function resolveParams() : array |
169 | 169 | { |
170 | 170 | $previous = $this->info->isParamExclusionEnabled(); |
@@ -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 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | { |
170 | 170 | $previous = $this->info->isParamExclusionEnabled(); |
171 | 171 | |
172 | - if($previous) |
|
172 | + if ($previous) |
|
173 | 173 | { |
174 | 174 | $this->info->setParamExclusion(false); |
175 | 175 | } |
@@ -185,19 +185,19 @@ discard block |
||
185 | 185 | { |
186 | 186 | $params = $this->resolveParams(); |
187 | 187 | |
188 | - if(empty($params)) { |
|
188 | + if (empty($params)) { |
|
189 | 189 | return ''; |
190 | 190 | } |
191 | 191 | |
192 | 192 | $tokens = array(); |
193 | 193 | $excluded = array(); |
194 | 194 | |
195 | - if($this->info->isParamExclusionEnabled()) |
|
195 | + if ($this->info->isParamExclusionEnabled()) |
|
196 | 196 | { |
197 | 197 | $excluded = $this->info->getExcludedParams(); |
198 | 198 | } |
199 | 199 | |
200 | - foreach($params as $param => $value) |
|
200 | + foreach ($params as $param => $value) |
|
201 | 201 | { |
202 | 202 | $parts = sprintf( |
203 | 203 | '<span class="link-param-name">%s</span>'. |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | $tag = $this->resolveTag($excluded, $param); |
216 | 216 | |
217 | - if(!empty($tag)) |
|
217 | + if (!empty($tag)) |
|
218 | 218 | { |
219 | 219 | $tokens[] = sprintf($tag, $parts); |
220 | 220 | } |
@@ -228,13 +228,13 @@ discard block |
||
228 | 228 | protected function resolveTag(array $excluded, string $paramName) : string |
229 | 229 | { |
230 | 230 | // regular, non-excluded parameter |
231 | - if(!isset($excluded[$paramName])) |
|
231 | + if (!isset($excluded[$paramName])) |
|
232 | 232 | { |
233 | 233 | return '<span class="link-param">%s</span>'; |
234 | 234 | } |
235 | 235 | |
236 | 236 | // highlight excluded parameters is disabled, ignore this parameter |
237 | - if(!$this->info->isHighlightExcludeEnabled()) |
|
237 | + if (!$this->info->isHighlightExcludeEnabled()) |
|
238 | 238 | { |
239 | 239 | return ''; |
240 | 240 | } |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | |
251 | 251 | protected function render_fragment() : string |
252 | 252 | { |
253 | - if(!$this->info->hasFragment()) { |
|
253 | + if (!$this->info->hasFragment()) { |
|
254 | 254 | return ''; |
255 | 255 | } |
256 | 256 | |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | { |
266 | 266 | $cssFolder = realpath(__DIR__.'/../../css'); |
267 | 267 | |
268 | - if($cssFolder === false) { |
|
268 | + if ($cssFolder === false) { |
|
269 | 269 | throw new BaseException( |
270 | 270 | 'Cannot find package CSS folder.', |
271 | 271 | null, |