@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * A tiny custom preparser as ground to start from |
19 | 19 | */ |
20 | -class MyAwesomeParserExtension implements ParserExtensionInterface{ |
|
20 | +class MyAwesomeParserExtension implements ParserExtensionInterface { |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Pre-parser |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @return string preparsed bbcode |
31 | 31 | */ |
32 | - public function pre($bbcode){ |
|
32 | + public function pre($bbcode) { |
|
33 | 33 | |
34 | 34 | $search = [ |
35 | 35 | "\t", // lets convert all tabs into 4 spaces |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * |
62 | 62 | * @return string postparsed bbcode |
63 | 63 | */ |
64 | - public function post($bbcode){ |
|
64 | + public function post($bbcode) { |
|
65 | 65 | return $bbcode; |
66 | 66 | } |
67 | 67 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * The base module implements the basic functionality for each module (custom HTML5) |
20 | 20 | */ |
21 | -class MyAwesomeBaseModule extends BaseModule implements BaseModuleInterface{ |
|
21 | +class MyAwesomeBaseModule extends BaseModule implements BaseModuleInterface { |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Holds an array of FQN strings to the current base module's children |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | * |
46 | 46 | * @return string |
47 | 47 | */ |
48 | - public function sanitize($content){ |
|
49 | - return htmlspecialchars($content, ENT_NOQUOTES|ENT_HTML5, 'UTF-8', false); |
|
48 | + public function sanitize($content) { |
|
49 | + return htmlspecialchars($content, ENT_NOQUOTES | ENT_HTML5, 'UTF-8', false); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * Transforms several simple text tags into HTML5 (custom) |
20 | 20 | */ |
21 | -class MyAwesomeModule extends MyAwesomeBaseModule implements ModuleInterface{ |
|
21 | +class MyAwesomeModule extends MyAwesomeBaseModule implements ModuleInterface { |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * An array of tags the module is able to process |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | * @see \chillerlan\bbcode\Modules\BaseModuleInterface::transform() |
36 | 36 | * @internal |
37 | 37 | */ |
38 | - public function _transform(){ |
|
39 | - if(empty($this->content)){ |
|
38 | + public function _transform() { |
|
39 | + if (empty($this->content)) { |
|
40 | 40 | return ''; |
41 | 41 | } |
42 | 42 |
@@ -87,10 +87,10 @@ |
||
87 | 87 | public function addNamespace($prefix, $base_dir, $prepend = false) |
88 | 88 | { |
89 | 89 | // normalize namespace prefix |
90 | - $prefix = trim($prefix, '\\') . '\\'; |
|
90 | + $prefix = trim($prefix, '\\').'\\'; |
|
91 | 91 | |
92 | 92 | // normalize the base directory with a trailing separator |
93 | - $base_dir = rtrim($base_dir, DIRECTORY_SEPARATOR) . '/'; |
|
93 | + $base_dir = rtrim($base_dir, DIRECTORY_SEPARATOR).'/'; |
|
94 | 94 | |
95 | 95 | // initialize the namespace prefix array |
96 | 96 | if (isset($this->prefixes[$prefix]) === false) { |
@@ -56,7 +56,7 @@ |
||
56 | 56 | |
57 | 57 | echo $content.PHP_EOL; |
58 | 58 | |
59 | -echo '<!-- bbcode: '.round((microtime(true)-$timer), 5).'s -->'.PHP_EOL; |
|
59 | +echo '<!-- bbcode: '.round((microtime(true) - $timer), 5).'s -->'.PHP_EOL; |
|
60 | 60 | |
61 | 61 | ?> |
62 | 62 | <!-- let's assume you use a common js framework in your project --> |
@@ -44,4 +44,4 @@ |
||
44 | 44 | |
45 | 45 | echo $content.PHP_EOL; |
46 | 46 | |
47 | -echo PHP_EOL.'bbcode: '.round((microtime(true)-$timer), 6).'s'; |
|
47 | +echo PHP_EOL.'bbcode: '.round((microtime(true) - $timer), 6).'s'; |
@@ -17,6 +17,6 @@ |
||
17 | 17 | /** |
18 | 18 | * Placeholder |
19 | 19 | */ |
20 | -class BBCodeException extends Exception{ |
|
20 | +class BBCodeException extends Exception { |
|
21 | 21 | |
22 | 22 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | * @see \chillerlan\bbcode\Parser::__parse() |
21 | 21 | * @see \chillerlan\bbcode\Modules\BaseModule::setBBTemp() |
22 | 22 | */ |
23 | -class BBTemp{ |
|
23 | +class BBTemp { |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * The current bbcode tag |
@@ -15,7 +15,7 @@ |
||
15 | 15 | /** |
16 | 16 | * |
17 | 17 | */ |
18 | -class Chinese extends LanguageBase implements LanguageInterface{ |
|
18 | +class Chinese extends LanguageBase implements LanguageInterface { |
|
19 | 19 | |
20 | 20 | public $parserExceptionCallback = ''; |
21 | 21 | public $parserExceptionMatchall = ''; |