Completed
Push — master ( 2c6b7a...b6434d )
by smiley
02:27
created
src/Modules/BaseModule.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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){
Please login to merge, or discard this patch.
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,6 @@
 block discarded – undo
101 101
 
102 102
 	/**
103 103
 	 * Checks if an attribute exists and if it exists as key in a whitelist
104
-
105 104
 	 * @param string $name      the desired attributes name
106 105
 	 * @param array  $whitelist an array with whitelisted key -> value pairs
107 106
 	 * @param mixed  $default   [optional] a default value in case the attribute isn't set, defaults to false
Please login to merge, or discard this patch.
src/Parser.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -259,7 +259,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Modules/BaseModuleInterface.php 2 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,6 @@
 block discarded – undo
101 101
 
102 102
 	/**
103 103
 	 * Checks if an attribute exists and if it exists as key in a whitelist
104
-
105 104
 	 * @param string $name      the desired attributes name
106 105
 	 * @param array  $whitelist an array with whitelisted key -> value pairs
107 106
 	 * @param mixed  $default   [optional] a default value in case the attribute isn't set, defaults to false
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
 	 * @param string $name     the desired attributes name
85 85
 	 * @param mixed  $default  [optional] a default value in case the attribute isn't set, defaults to false
86 86
 	 *
87
-	 * @return mixed the attribute's value in case it exists, otherwise $default
87
+	 * @return string the attribute's value in case it exists, otherwise $default
88 88
 	 */
89 89
 	public function getAttribute(string $name, $default = false);
90 90
 
Please login to merge, or discard this patch.
src/Modules/Html5/Video.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,10 +72,10 @@
 block discarded – undo
72 72
 
73 73
 				if($this->flash){
74 74
 					$player = '<object type="application/x-shockwave-flash" data="'.$video_url.'">'
75
-					          .'<param name="allowfullscreen" value="true">'
76
-					          .'<param name="wmode" value="opaque" />'
77
-					          .'<param name="movie" value="'.$video_url.'" />'
78
-					          .'</object>';
75
+							  .'<param name="allowfullscreen" value="true">'
76
+							  .'<param name="wmode" value="opaque" />'
77
+							  .'<param name="movie" value="'.$video_url.'" />'
78
+							  .'</object>';
79 79
 				}
80 80
 
81 81
 				return '<div'.$cssclass.'>'.$player.'</div>';
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\bbcode\Modules\Html5;
14 14
 
15
-use chillerlan\bbcode\Modules\ModuleInterface;
16 15
 use chillerlan\TinyCurl\Traits\RequestTrait;
16
+use chillerlan\bbcode\Modules\ModuleInterface;
17 17
 
18 18
 /**
19 19
  * Transforms several video tags into HTML5
Please login to merge, or discard this patch.
src/Traits/ClassLoaderTrait.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 	 * @param string $class     FQCN
26 26
 	 * @param string $interface FQCN
27 27
 	 *
28
-	 * @param mixed  $params    [optional] the following arguments are optional and will be passed to the class constructor if present.
28
+	 * @param \chillerlan\bbcode\ParserOptions  $params    [optional] the following arguments are optional and will be passed to the class constructor if present.
29 29
 	 *
30 30
 	 * @link https://github.com/chillerlan/framework/blob/master/src/Core/Traits/ClassLoaderTrait.php
31 31
 	 *
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@
 block discarded – undo
11 11
 
12 12
 namespace chillerlan\bbcode\Traits;
13 13
 
14
-use chillerlan\bbcode\BBCodeException;
15 14
 use ReflectionClass;
15
+use chillerlan\bbcode\BBCodeException;
16 16
 
17 17
 /**
18 18
  * Trait ClassLoaderTrait
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,8 @@
 block discarded – undo
32 32
 	 * @return object of type $interface
33 33
 	 * @throws \chillerlan\bbcode\BBCodeException
34 34
 	 */
35
-	protected function __loadClass(string $class, string $interface, ...$params){ // phpDocumentor stumbles across the ... syntax
35
+	protected function __loadClass(string $class, string $interface, ...$params){
36
+// phpDocumentor stumbles across the ... syntax
36 37
 		if(class_exists($class)){
37 38
 			$reflectionClass = new ReflectionClass($class);
38 39
 
Please login to merge, or discard this patch.
src/Modules/Html5/Links.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
 			return '';
41 41
 		}
42 42
 
43
-		$url = $this->checkUrl($this->bbtag() ? : $this->content);
43
+		$url = $this->checkUrl($this->bbtag() ?: $this->content);
44 44
 		$host = parse_url($url, PHP_URL_HOST);
45 45
 		$target = (!empty($host) && (isset($_SERVER['SERVER_NAME']) && $host === $_SERVER['SERVER_NAME']))
46 46
 			|| empty($host) ? 'self' : 'blank';
Please login to merge, or discard this patch.
src/Modules/Html5/Tables.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@
 block discarded – undo
151 151
 		$span = '';
152 152
 		foreach(['colspan', 'rowspan'] as $s){
153 153
 			$_span = $this->getAttribute($s);
154
-			$span .=  $_span ? ' '.$s.'="'.intval($_span).'"' : '';
154
+			$span .= $_span ? ' '.$s.'="'.intval($_span).'"' : '';
155 155
 		}
156 156
 
157 157
 		$abbr  = '';
Please login to merge, or discard this patch.
src/Modules/Markdown/Links.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@
 block discarded – undo
40 40
 		if(!empty($this->content)){
41 41
 			return $url && $this->checkUrl($url)
42 42
 				? '['.$this->content.']('.$url.')'
43
-				: $this->checkUrl($this->content) ? : $this->content;
43
+				: $this->checkUrl($this->content) ?: $this->content;
44 44
 		}
45 45
 
46
-		return $this->checkUrl($url) ? : '';
46
+		return $this->checkUrl($url) ?: '';
47 47
 	}
48 48
 
49 49
 }
Please login to merge, or discard this patch.
src/Modules/Markdown/StyledText.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@
 block discarded – undo
41 41
 
42 42
 		$str = [
43 43
 			'b'      => '**', // bold
44
-			'c'      => '`',  // inline code
44
+			'c'      => '`', // inline code
45 45
 			'del'    => '~~', // strikethrough
46
-			'i'      => '_',  // italic
46
+			'i'      => '_', // italic
47 47
 			's'      => '~~', // strikethrough
48 48
 			'strong' => '**', // bold
49 49
 		][$this->tag];
Please login to merge, or discard this patch.