@@ -101,7 +101,6 @@ |
||
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 |
@@ -12,8 +12,8 @@ |
||
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 |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | protected function flashPlayer(string $video_url):string{ |
100 | 100 | |
101 | 101 | return '<div'.$this->getCssClass($this->cssclass).'>' |
102 | - .'<object type="application/x-shockwave-flash" data="'.$video_url.'">' |
|
103 | - .'<param name="allowfullscreen" value="true">' |
|
104 | - .'<param name="wmode" value="opaque" />' |
|
105 | - .'<param name="movie" value="'.$video_url.'" />' |
|
106 | - .'</object></div>'; |
|
102 | + .'<object type="application/x-shockwave-flash" data="'.$video_url.'">' |
|
103 | + .'<param name="allowfullscreen" value="true">' |
|
104 | + .'<param name="wmode" value="opaque" />' |
|
105 | + .'<param name="movie" value="'.$video_url.'" />' |
|
106 | + .'</object></div>'; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | protected function embedPlayer(string $video_url):string{ |
115 | 115 | |
116 | 116 | return '<div'.$this->getCssClass($this->cssclass).'>' |
117 | - .'<iframe src="'.$video_url.'" allowfullscreen></iframe></div>'; |
|
117 | + .'<iframe src="'.$video_url.'" allowfullscreen></iframe></div>'; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | protected function html5Player():string{ |
124 | 124 | |
125 | 125 | return '<video src="'.$this->checkUrl($this->content).'"' |
126 | - .$this->getCssClass($this->cssclass).' preload="auto" controls="true"></video>'; |
|
126 | + .$this->getCssClass($this->cssclass).' preload="auto" controls="true"></video>'; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -25,7 +25,7 @@ |
||
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 | * |
@@ -11,8 +11,8 @@ |
||
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 |
@@ -32,7 +32,8 @@ |
||
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 |
@@ -40,7 +40,7 @@ |
||
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'; |
@@ -41,9 +41,9 @@ |
||
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]; |
@@ -127,7 +127,7 @@ |
||
127 | 127 | */ |
128 | 128 | protected function getCssClass(array $additional_classes = []){ |
129 | 129 | $classes = $this->getAttribute('class', '').' '.implode(' ', $additional_classes); |
130 | - $classes =preg_replace('/[^a-z\d\- ]/i', '', $classes); |
|
130 | + $classes = preg_replace('/[^a-z\d\- ]/i', '', $classes); |
|
131 | 131 | $classes = trim($classes); |
132 | 132 | |
133 | 133 | return !empty($classes) ? ' class="'.$classes.'"' : ''; |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Class MarkupBaseModule |
|
4 | - * |
|
5 | - * @filesource MarkupBaseModule.php |
|
6 | - * @created 18.10.2015 |
|
7 | - * @package chillerlan\bbcode\Modules\Markdown |
|
8 | - * @author Smiley <[email protected]> |
|
9 | - * @copyright 2015 Smiley |
|
10 | - * @license MIT |
|
11 | - */ |
|
3 | + * Class MarkupBaseModule |
|
4 | + * |
|
5 | + * @filesource MarkupBaseModule.php |
|
6 | + * @created 18.10.2015 |
|
7 | + * @package chillerlan\bbcode\Modules\Markdown |
|
8 | + * @author Smiley <[email protected]> |
|
9 | + * @copyright 2015 Smiley |
|
10 | + * @license MIT |
|
11 | + */ |
|
12 | 12 | |
13 | 13 | namespace chillerlan\bbcode\Modules\Markup; |
14 | 14 |
@@ -23,6 +23,7 @@ |
||
23 | 23 | * ParserExtensionInterface constructor. |
24 | 24 | * |
25 | 25 | * @param \chillerlan\bbcode\ParserOptions|null $options |
26 | + * @return void |
|
26 | 27 | */ |
27 | 28 | public function __construct(ParserOptions $options = null); |
28 | 29 |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | /** |
204 | 204 | * strng regexp bbcode killer |
205 | 205 | * |
206 | - * @param string|array $bbcode BBCode as string or matches as array - callback from preg_replace_callback() |
|
206 | + * @param string $bbcode BBCode as string or matches as array - callback from preg_replace_callback() |
|
207 | 207 | * |
208 | 208 | * @return string |
209 | 209 | * @throws \chillerlan\bbcode\BBCodeException |
@@ -355,9 +355,9 @@ discard block |
||
355 | 355 | /** |
356 | 356 | * testing... |
357 | 357 | * |
358 | - * @param $preg_error |
|
358 | + * @param integer $preg_error |
|
359 | 359 | * |
360 | - * @param null $tag |
|
360 | + * @param string|null $tag |
|
361 | 361 | * |
362 | 362 | * @throws \chillerlan\bbcode\BBCodeException |
363 | 363 | * @link https://github.com/chillerlan/bbcode/issues/1 |
@@ -136,7 +136,7 @@ |
||
136 | 136 | * @throws \chillerlan\bbcode\BBCodeException |
137 | 137 | */ |
138 | 138 | public function setOptions(ParserOptions $options){ |
139 | - $this->parserOptions = $options; |
|
139 | + $this->parserOptions = $options; |
|
140 | 140 | |
141 | 141 | $this->loadInterfaces(); |
142 | 142 | $this->loadModules(); |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | protected function table():string{ |
74 | 74 | |
75 | 75 | return '<table'.$this->getCssClass(['bb-table']) |
76 | - .$this->getStyle(['width' => $this->getAttribute('width')]) |
|
77 | - .'>'.$this->eol($this->content).'</table>'; |
|
76 | + .$this->getStyle(['width' => $this->getAttribute('width')]) |
|
77 | + .'>'.$this->eol($this->content).'</table>'; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | return '<'.$this->tag.$colspan.$rowspan.$abbr.$this->getCellStyle().'>' |
143 | - .$this->eol($this->content, $this->eol_token) |
|
144 | - .'</'.$this->tag.'>'; |
|
143 | + .$this->eol($this->content, $this->eol_token) |
|
144 | + .'</'.$this->tag.'>'; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |