@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | * @param string $name the desired attributes name |
224 | 224 | * @param mixed $default [optional] a default value in case the attribute isn't set, defaults to false |
225 | 225 | * |
226 | - * @return mixed the attribute's value in case it exists, otherwise $default |
|
226 | + * @return string the attribute's value in case it exists, otherwise $default |
|
227 | 227 | */ |
228 | 228 | public function getAttribute($name, $default = false){ |
229 | 229 | return isset($this->attributes[$name]) && !empty($this->attributes[$name]) ? $this->attributes[$name] : $default; |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | * @param string $name the desired attributes name |
251 | 251 | * @param array $whitelist an array with whitelisted key -> value pairs |
252 | - * @param mixed $default [optional] a default value in case the attribute isn't set, defaults to false |
|
252 | + * @param string $default [optional] a default value in case the attribute isn't set, defaults to false |
|
253 | 253 | * |
254 | 254 | * @return mixed boolean if no $default is set, otherwise the whitelist value to the given key in case it exists or $default |
255 | 255 | */ |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | * Checks if the current tag is whitelisted |
264 | 264 | * |
265 | 265 | * @param array $whitelist an array with whitelisted tag names |
266 | - * @param mixed $default [optional] a default value in case the tag isn't whitelisted |
|
266 | + * @param string $default [optional] a default value in case the tag isn't whitelisted |
|
267 | 267 | * |
268 | 268 | * @return mixed boolean if no $default is set, otherwise the whitelisted tag or $default |
269 | 269 | */ |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | * shorthand for self::attributeIn('__BBTAG__', $array) |
315 | 315 | * |
316 | 316 | * @param array $array |
317 | - * @param mixed $default |
|
317 | + * @param string $default |
|
318 | 318 | * |
319 | 319 | * @return mixed |
320 | 320 | */ |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | * |
328 | 328 | * @param string $url the URL to check |
329 | 329 | * |
330 | - * @return bool|string the url if valid, otherwise false |
|
330 | + * @return false|string the url if valid, otherwise false |
|
331 | 331 | */ |
332 | 332 | public function checkUrl($url){ |
333 | 333 | if(filter_var($url, FILTER_VALIDATE_URL) === false){ |
@@ -259,7 +259,7 @@ |
||
259 | 259 | /** |
260 | 260 | * strng regexp bbcode killer |
261 | 261 | * |
262 | - * @param string|array $bbcode BBCode as string or matches as array - callback from preg_replace_callback() |
|
262 | + * @param string $bbcode BBCode as string or matches as array - callback from preg_replace_callback() |
|
263 | 263 | * |
264 | 264 | * @return string |
265 | 265 | * @throws \chillerlan\bbcode\BBCodeException |
@@ -184,8 +184,7 @@ discard block |
||
184 | 184 | $this->allowed_tags[] = $tag; |
185 | 185 | } |
186 | 186 | } |
187 | - } |
|
188 | - else{ |
|
187 | + } else{ |
|
189 | 188 | if($this->parserOptions->allow_all){ |
190 | 189 | $this->allowed_tags = array_keys($this->tagmap); |
191 | 190 | } |
@@ -276,13 +275,11 @@ discard block |
||
276 | 275 | |
277 | 276 | $callback = true; |
278 | 277 | $callback_count++; |
279 | - } |
|
280 | - else if(is_string($bbcode) && !empty($bbcode)){ |
|
278 | + } else if(is_string($bbcode) && !empty($bbcode)){ |
|
281 | 279 | $tag = null; |
282 | 280 | $attributes = []; |
283 | 281 | $content = $bbcode; |
284 | - } |
|
285 | - else{ |
|
282 | + } else{ |
|
286 | 283 | return ''; |
287 | 284 | } |
288 | 285 |
@@ -64,8 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | if($video_url === false){ |
66 | 66 | return '<video src="'.$this->content.'"'.$cssclass.' preload="auto" controls="true"></video>'; |
67 | - } |
|
68 | - else{ |
|
67 | + } else{ |
|
69 | 68 | |
70 | 69 | if(!empty($video_url)){ |
71 | 70 | $player = '<iframe src="'.$video_url.'" allowfullscreen></iframe>'; |
@@ -122,12 +121,10 @@ discard block |
||
122 | 121 | if($host === 'youtube.com'){ |
123 | 122 | parse_str($url['query'], $q); |
124 | 123 | $id = $q['v']; |
125 | - } |
|
126 | - else if($host === 'youtu.be'){ |
|
124 | + } else if($host === 'youtu.be'){ |
|
127 | 125 | $e = explode('/', $url['path'], 2); |
128 | 126 | $id = isset($e[1]) ? $e[1] : false; |
129 | - } |
|
130 | - else{ |
|
127 | + } else{ |
|
131 | 128 | $id = $this->content; |
132 | 129 | } |
133 | 130 | |
@@ -169,11 +166,9 @@ discard block |
||
169 | 166 | |
170 | 167 | if($host === 'dailymotion.com'){ |
171 | 168 | $id = explode('_', str_replace('/video/', '', $url['path']), 2)[0]; |
172 | - } |
|
173 | - else if($host === 'dai.ly'){ |
|
169 | + } else if($host === 'dai.ly'){ |
|
174 | 170 | $id = $url['path']; |
175 | - } |
|
176 | - else{ |
|
171 | + } else{ |
|
177 | 172 | $id = $this->content; |
178 | 173 | } |
179 | 174 |