@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | * Class Variable |
56 | 56 | * @package Platine\Template\Parser |
57 | 57 | */ |
58 | -class Variable |
|
59 | -{ |
|
58 | +class Variable { |
|
60 | 59 | /** |
61 | 60 | * The variable markup |
62 | 61 | * @var string |
@@ -86,8 +85,7 @@ discard block |
||
86 | 85 | * @param string $markup |
87 | 86 | * @param Parser $parser |
88 | 87 | */ |
89 | - public function __construct(string $markup, Parser $parser) |
|
90 | - { |
|
88 | + public function __construct(string $markup, Parser $parser) { |
|
91 | 89 | $this->markup = $markup; |
92 | 90 | $this->parser = $parser; |
93 | 91 | |
@@ -185,8 +183,7 @@ discard block |
||
185 | 183 | * @param Context $context |
186 | 184 | * @return mixed |
187 | 185 | */ |
188 | - public function render(Context $context) |
|
189 | - { |
|
186 | + public function render(Context $context) { |
|
190 | 187 | $output = $context->get($this->name); |
191 | 188 | foreach ($this->filters as $filter) { |
192 | 189 | list($filterName, $filterArgKeys) = $filter; |
@@ -53,8 +53,7 @@ discard block |
||
53 | 53 | * Class Lexer |
54 | 54 | * @package Platine\Template\Parser |
55 | 55 | */ |
56 | -class Lexer |
|
57 | -{ |
|
56 | +class Lexer { |
|
58 | 57 | /** |
59 | 58 | * The lexer pattern |
60 | 59 | * @var string |
@@ -71,8 +70,7 @@ discard block |
||
71 | 70 | * Create new instance |
72 | 71 | * @param string $pattern |
73 | 72 | */ |
74 | - public function __construct(string $pattern) |
|
75 | - { |
|
73 | + public function __construct(string $pattern) { |
|
76 | 74 | $this->pattern = (substr($pattern, 0, 1) !== '/') |
77 | 75 | ? '/' . $this->quote($pattern) . '/' |
78 | 76 | : $pattern; |
@@ -150,8 +148,7 @@ discard block |
||
150 | 148 | * @param int $index |
151 | 149 | * @return array<int, mixed> |
152 | 150 | */ |
153 | - public function getArrayMatch(int $index = -1) |
|
154 | - { |
|
151 | + public function getArrayMatch(int $index = -1) { |
|
155 | 152 | if ($index === -1) { |
156 | 153 | return $this->matches; |
157 | 154 | } |
@@ -182,8 +179,7 @@ discard block |
||
182 | 179 | * @param int $index |
183 | 180 | * @return mixed |
184 | 181 | */ |
185 | - public function getMixedMatch(int $index) |
|
186 | - { |
|
182 | + public function getMixedMatch(int $index) { |
|
187 | 183 | if (array_key_exists($index, $this->matches)) { |
188 | 184 | return $this->matches[$index]; |
189 | 185 | } |
@@ -53,13 +53,11 @@ |
||
53 | 53 | * Class NullCache |
54 | 54 | * @package Platine\Template\Cache |
55 | 55 | */ |
56 | -class NullCache extends AbstractCache |
|
57 | -{ |
|
56 | +class NullCache extends AbstractCache { |
|
58 | 57 | /** |
59 | 58 | * {@inheritdoc} |
60 | 59 | */ |
61 | - public function read(string $key, bool $unserialize = false) |
|
62 | - { |
|
60 | + public function read(string $key, bool $unserialize = false) { |
|
63 | 61 | return false; |
64 | 62 | } |
65 | 63 |
@@ -53,8 +53,7 @@ discard block |
||
53 | 53 | * Class MemoryCache |
54 | 54 | * @package Platine\Template\Cache |
55 | 55 | */ |
56 | -class MemoryCache extends AbstractCache |
|
57 | -{ |
|
56 | +class MemoryCache extends AbstractCache { |
|
58 | 57 | /** |
59 | 58 | * The cache data |
60 | 59 | * @var array<string, mixed> |
@@ -64,8 +63,7 @@ discard block |
||
64 | 63 | /** |
65 | 64 | * {@inheritdoc} |
66 | 65 | */ |
67 | - public function read(string $key, bool $unserialize = false) |
|
68 | - { |
|
66 | + public function read(string $key, bool $unserialize = false) { |
|
69 | 67 | if (!$this->exists($key)) { |
70 | 68 | return false; |
71 | 69 | } |
@@ -55,16 +55,14 @@ |
||
55 | 55 | * Class HtmlFilter |
56 | 56 | * @package Platine\Template\Filter |
57 | 57 | */ |
58 | -class HtmlFilter extends AbstractFilter |
|
59 | -{ |
|
58 | +class HtmlFilter extends AbstractFilter { |
|
60 | 59 | |
61 | 60 | /** |
62 | 61 | * Put all letter to lower case |
63 | 62 | * @param mixed $variable |
64 | 63 | * @return string|mixed |
65 | 64 | */ |
66 | - public static function nl2br($variable) |
|
67 | - { |
|
65 | + public static function nl2br($variable) { |
|
68 | 66 | if (!is_string($variable)) { |
69 | 67 | return $variable; |
70 | 68 | } |
@@ -59,8 +59,7 @@ discard block |
||
59 | 59 | * Class CaptureTag |
60 | 60 | * @package Platine\Template\Tag |
61 | 61 | */ |
62 | -class CaptureTag extends AbstractBlock |
|
63 | -{ |
|
62 | +class CaptureTag extends AbstractBlock { |
|
64 | 63 | /** |
65 | 64 | * The name of the variable |
66 | 65 | * @var string |
@@ -70,8 +69,7 @@ discard block |
||
70 | 69 | /** |
71 | 70 | * {@inheritdoc} |
72 | 71 | */ |
73 | - public function __construct(string $markup, &$tokens, Parser $parser) |
|
74 | - { |
|
72 | + public function __construct(string $markup, &$tokens, Parser $parser) { |
|
75 | 73 | $lexer = new Lexer('/(\w+)/'); |
76 | 74 | if ($lexer->match($markup)) { |
77 | 75 | $this->variableName = $lexer->getStringMatch(1); |
@@ -56,8 +56,7 @@ |
||
56 | 56 | * Class ContinueTag |
57 | 57 | * @package Platine\Template\Tag |
58 | 58 | */ |
59 | -class ContinueTag extends AbstractTag |
|
60 | -{ |
|
59 | +class ContinueTag extends AbstractTag { |
|
61 | 60 | /** |
62 | 61 | * {@inheritdoc} |
63 | 62 | */ |
@@ -56,8 +56,7 @@ |
||
56 | 56 | * Class BreakTag |
57 | 57 | * @package Platine\Template\Tag |
58 | 58 | */ |
59 | -class BreakTag extends AbstractTag |
|
60 | -{ |
|
59 | +class BreakTag extends AbstractTag { |
|
61 | 60 | /** |
62 | 61 | * {@inheritdoc} |
63 | 62 | */ |
@@ -53,14 +53,12 @@ |
||
53 | 53 | * Class IfnotTag |
54 | 54 | * @package Platine\Template\Tag |
55 | 55 | */ |
56 | -class IfnotTag extends IfTag |
|
57 | -{ |
|
56 | +class IfnotTag extends IfTag { |
|
58 | 57 | |
59 | 58 | /** |
60 | 59 | * {@inheritdoc} |
61 | 60 | */ |
62 | - protected function negateCondition($value) |
|
63 | - { |
|
61 | + protected function negateCondition($value) { |
|
64 | 62 | return !$value; |
65 | 63 | } |
66 | 64 | } |