@@ -34,7 +34,7 @@ |
||
34 | 34 | * @method string expanderDisplayTrigger($override_language = null) |
35 | 35 | * |
36 | 36 | */ |
37 | -interface LanguageInterface{ |
|
37 | +interface LanguageInterface { |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * It's magic. |
@@ -15,7 +15,7 @@ |
||
15 | 15 | /** |
16 | 16 | * |
17 | 17 | */ |
18 | -class Spanish extends LanguageBase implements LanguageInterface{ |
|
18 | +class Spanish extends LanguageBase implements LanguageInterface { |
|
19 | 19 | |
20 | 20 | public $parserExceptionCallback = ''; |
21 | 21 | public $parserExceptionMatchall = ''; |
@@ -17,7 +17,7 @@ |
||
17 | 17 | * |
18 | 18 | * @see \chillerlan\bbcode\Modules\BaseModule::getInfo() |
19 | 19 | */ |
20 | -class BaseModuleInfo{ |
|
20 | +class BaseModuleInfo { |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Holds an array of FQN strings to the current base module's children |
@@ -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 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | /** |
18 | 18 | * Implements the basic functionality for each module |
19 | 19 | */ |
20 | -interface BaseModuleInterface{ |
|
20 | +interface BaseModuleInterface { |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Sets self::$tag, self::$attributes, self::$content and self::$options |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Class Code |
|
4 | - * |
|
5 | - * @filesource Code.php |
|
6 | - * @created 12.10.2015 |
|
7 | - * @package chillerlan\bbcode\Modules\Html5 |
|
8 | - * @author Smiley <[email protected]> |
|
9 | - * @copyright 2015 Smiley |
|
10 | - * @license MIT |
|
11 | - */ |
|
3 | + * Class Code |
|
4 | + * |
|
5 | + * @filesource Code.php |
|
6 | + * @created 12.10.2015 |
|
7 | + * @package chillerlan\bbcode\Modules\Html5 |
|
8 | + * @author Smiley <[email protected]> |
|
9 | + * @copyright 2015 Smiley |
|
10 | + * @license MIT |
|
11 | + */ |
|
12 | 12 | |
13 | 13 | namespace chillerlan\bbcode\Modules\Html5; |
14 | 14 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * Transforms several code tags into HTML5 |
20 | 20 | */ |
21 | -class Code extends Html5BaseModule implements ModuleInterface{ |
|
21 | +class Code extends Html5BaseModule implements ModuleInterface { |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * An array of tags the module is able to process |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * |
36 | 36 | * @param \chillerlan\bbcode\BBTemp $bbtemp |
37 | 37 | */ |
38 | - public function __construct(BBTemp $bbtemp = null){ |
|
38 | + public function __construct(BBTemp $bbtemp = null) { |
|
39 | 39 | parent::__construct($bbtemp); |
40 | 40 | |
41 | 41 | // set self::$noparse_tags to self::$tags because none of these should be parsed |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | * @see \chillerlan\bbcode\Modules\BaseModuleInterface::transform() |
50 | 50 | * @internal |
51 | 51 | */ |
52 | - public function __transform(){ |
|
52 | + public function __transform() { |
|
53 | 53 | |
54 | - if(empty($this->content)){ |
|
54 | + if (empty($this->content)) { |
|
55 | 55 | return ''; |
56 | 56 | } |
57 | 57 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * Transforms several container tags into HTML5 |
19 | 19 | */ |
20 | -class Containers extends Html5BaseModule implements ModuleInterface{ |
|
20 | +class Containers extends Html5BaseModule implements ModuleInterface { |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * An array of tags the module is able to process |
@@ -35,16 +35,16 @@ discard block |
||
35 | 35 | * @see \chillerlan\bbcode\Modules\BaseModuleInterface::transform() |
36 | 36 | * @internal |
37 | 37 | */ |
38 | - public function __transform(){ |
|
38 | + public function __transform() { |
|
39 | 39 | |
40 | - if(empty($this->content)){ |
|
40 | + if (empty($this->content)) { |
|
41 | 41 | return ''; |
42 | 42 | } |
43 | 43 | |
44 | 44 | $tag = $this->tagIn(['p', 'div'], 'p'); |
45 | 45 | $align = $this->tagIn(self::TEXT_ALIGN, ''); |
46 | 46 | |
47 | - if(!$align){ |
|
47 | + if (!$align) { |
|
48 | 48 | $align = $this->attributeIn('align', self::TEXT_ALIGN, 'left'); |
49 | 49 | } |
50 | 50 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * Transforms several expander tags into HTML5 |
19 | 19 | */ |
20 | -class Expanders extends Html5BaseModule implements ModuleInterface{ |
|
20 | +class Expanders extends Html5BaseModule implements ModuleInterface { |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * An array of tags the module is able to process |
@@ -55,16 +55,16 @@ discard block |
||
55 | 55 | * @see \chillerlan\bbcode\Modules\BaseModuleInterface::transform() |
56 | 56 | * @internal |
57 | 57 | */ |
58 | - public function __transform(){ |
|
58 | + public function __transform() { |
|
59 | 59 | |
60 | - if(empty($this->content)){ |
|
60 | + if (empty($this->content)) { |
|
61 | 61 | return ''; |
62 | 62 | } |
63 | 63 | |
64 | 64 | call_user_func([$this, $this->tag]); |
65 | 65 | $id = $this->randomID(); |
66 | 66 | |
67 | - if(!$this->title){ |
|
67 | + if (!$this->title) { |
|
68 | 68 | $this->title = $this->header; |
69 | 69 | } |
70 | 70 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | /** |
79 | 79 | * Processes [expander] |
80 | 80 | */ |
81 | - protected function expander(){ |
|
81 | + protected function expander() { |
|
82 | 82 | $this->header = $this->languageInterface->expanderDisplayExpander(); |
83 | 83 | $this->display = $this->getAttribute('hide'); |
84 | 84 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | /** |
87 | 87 | * Processes [quote] |
88 | 88 | */ |
89 | - protected function quote(){ |
|
89 | + protected function quote() { |
|
90 | 90 | $name = $this->getAttribute('name'); |
91 | 91 | $url = $this->checkUrl($this->getAttribute('url')); |
92 | 92 | $header = $this->languageInterface->expanderDisplayQuote().($name ? ': '.$name : ''); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | /** |
100 | 100 | * Processes [spoiler] |
101 | 101 | */ |
102 | - protected function spoiler(){ |
|
102 | + protected function spoiler() { |
|
103 | 103 | $desc = $this->getAttribute('desc'); |
104 | 104 | |
105 | 105 | $this->header = $this->languageInterface->expanderDisplaySpoiler().($desc ? ': <span>'.$desc.'</span>' : ''); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | /** |
110 | 110 | * Processes [trigger] |
111 | 111 | */ |
112 | - protected function trigger(){ |
|
112 | + protected function trigger() { |
|
113 | 113 | $desc = $this->getAttribute('desc'); |
114 | 114 | |
115 | 115 | $this->header = $this->languageInterface->expanderDisplayTrigger().($desc ? ': <span>'.$desc.'</span>' : ''); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * The base module implements the basic functionality for each module (HTML5) |
20 | 20 | */ |
21 | -class Html5BaseModule extends MarkupBaseModule implements BaseModuleInterface{ |
|
21 | +class Html5BaseModule extends MarkupBaseModule implements BaseModuleInterface { |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Holds an array of FQN strings to the current base module's children |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * |
57 | 57 | * @return string |
58 | 58 | */ |
59 | - public function sanitize($content){ |
|
59 | + public function sanitize($content) { |
|
60 | 60 | return htmlspecialchars($content, ENT_NOQUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED | ENT_HTML5, 'UTF-8', false); |
61 | 61 | } |
62 | 62 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * Transforms image tags into HTML5 |
19 | 19 | */ |
20 | -class Images extends Html5BaseModule implements ModuleInterface{ |
|
20 | +class Images extends Html5BaseModule implements ModuleInterface { |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * An array of tags the module is able to process |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | * @see \chillerlan\bbcode\Modules\BaseModuleInterface::transform() |
35 | 35 | * @internal |
36 | 36 | */ |
37 | - public function __transform(){ |
|
37 | + public function __transform() { |
|
38 | 38 | |
39 | - if(!$url = $this->checkUrl($this->content)){ |
|
39 | + if (!$url = $this->checkUrl($this->content)) { |
|
40 | 40 | return ''; |
41 | 41 | } |
42 | 42 |