@@ -38,6 +38,5 @@ |
||
| 38 | 38 | * Class TemplateException |
| 39 | 39 | * @package Platine\Template\Exception |
| 40 | 40 | */ |
| 41 | -class TemplateException extends Exception |
|
| 42 | -{ |
|
| 41 | +class TemplateException extends Exception { |
|
| 43 | 42 | } |
@@ -41,6 +41,5 @@ |
||
| 41 | 41 | * Class LoaderException |
| 42 | 42 | * @package Platine\Template\Exception |
| 43 | 43 | */ |
| 44 | -class LoaderException extends TemplateException |
|
| 45 | -{ |
|
| 44 | +class LoaderException extends TemplateException { |
|
| 46 | 45 | } |
@@ -39,6 +39,5 @@ |
||
| 39 | 39 | * Class RenderException |
| 40 | 40 | * @package Platine\Template\Exception |
| 41 | 41 | */ |
| 42 | -class RenderException extends TemplateException |
|
| 43 | -{ |
|
| 42 | +class RenderException extends TemplateException { |
|
| 44 | 43 | } |
@@ -39,6 +39,5 @@ |
||
| 39 | 39 | * Class NotFoundException |
| 40 | 40 | * @package Platine\Template\Exception |
| 41 | 41 | */ |
| 42 | -class NotFoundException extends LoaderException |
|
| 43 | -{ |
|
| 42 | +class NotFoundException extends LoaderException { |
|
| 44 | 43 | } |
@@ -39,6 +39,5 @@ |
||
| 39 | 39 | * Class ParseException |
| 40 | 40 | * @package Platine\Template\Exception |
| 41 | 41 | */ |
| 42 | -class ParseException extends TemplateException |
|
| 43 | -{ |
|
| 42 | +class ParseException extends TemplateException { |
|
| 44 | 43 | } |
@@ -57,16 +57,14 @@ |
||
| 57 | 57 | * Class Document |
| 58 | 58 | * @package Platine\Template\Parser |
| 59 | 59 | */ |
| 60 | -class Document extends AbstractBlock |
|
| 61 | -{ |
|
| 60 | +class Document extends AbstractBlock { |
|
| 62 | 61 | |
| 63 | 62 | /** |
| 64 | 63 | * Create new instance |
| 65 | 64 | * @param array<int, string> $tokens |
| 66 | 65 | * @param Parser $parser |
| 67 | 66 | */ |
| 68 | - public function __construct(array &$tokens, Parser $parser) |
|
| 69 | - { |
|
| 67 | + public function __construct(array &$tokens, Parser $parser) { |
|
| 70 | 68 | $this->parser = $parser; |
| 71 | 69 | |
| 72 | 70 | $this->parse($tokens); |
@@ -58,8 +58,7 @@ discard block |
||
| 58 | 58 | * Class Context |
| 59 | 59 | * @package Platine\Template\Parser |
| 60 | 60 | */ |
| 61 | -class Context |
|
| 62 | -{ |
|
| 61 | +class Context { |
|
| 63 | 62 | /** |
| 64 | 63 | * The local scopes |
| 65 | 64 | * @var array<int, array<string, mixed>> |
@@ -103,8 +102,7 @@ discard block |
||
| 103 | 102 | * @param array<string, mixed> $assigns |
| 104 | 103 | * @param array<string, mixed> $registers |
| 105 | 104 | */ |
| 106 | - public function __construct(array $assigns = [], array $registers = []) |
|
| 107 | - { |
|
| 105 | + public function __construct(array $assigns = [], array $registers = []) { |
|
| 108 | 106 | $this->assigns = [$assigns]; |
| 109 | 107 | $this->registers = $registers; |
| 110 | 108 | $this->filters = new FilterCollection(); |
@@ -128,8 +126,7 @@ discard block |
||
| 128 | 126 | * @param callable|null $tickCallback |
| 129 | 127 | * @return $this |
| 130 | 128 | */ |
| 131 | - public function setTickCallback(?callable $tickCallback) |
|
| 132 | - { |
|
| 129 | + public function setTickCallback(?callable $tickCallback) { |
|
| 133 | 130 | $this->tickCallback = $tickCallback; |
| 134 | 131 | |
| 135 | 132 | return $this; |
@@ -154,8 +151,7 @@ discard block |
||
| 154 | 151 | * @param array<int, mixed> $args |
| 155 | 152 | * @return mixed |
| 156 | 153 | */ |
| 157 | - public function invokeFilter(string $name, $value, array $args = []) |
|
| 158 | - { |
|
| 154 | + public function invokeFilter(string $name, $value, array $args = []) { |
|
| 159 | 155 | try { |
| 160 | 156 | return $this->filters->invoke($name, $value, $args); |
| 161 | 157 | } catch (TypeError $ex) { |
@@ -199,8 +195,7 @@ discard block |
||
| 199 | 195 | * @param string $key |
| 200 | 196 | * @return mixed |
| 201 | 197 | */ |
| 202 | - public function get(string $key) |
|
| 203 | - { |
|
| 198 | + public function get(string $key) { |
|
| 204 | 199 | return $this->resolve($key); |
| 205 | 200 | } |
| 206 | 201 | |
@@ -260,8 +255,7 @@ discard block |
||
| 260 | 255 | * @param string $name |
| 261 | 256 | * @return mixed|null |
| 262 | 257 | */ |
| 263 | - public function getRegister(string $name) |
|
| 264 | - { |
|
| 258 | + public function getRegister(string $name) { |
|
| 265 | 259 | if ($this->hasRegister($name)) { |
| 266 | 260 | return $this->registers[$name]; |
| 267 | 261 | } |
@@ -297,8 +291,7 @@ discard block |
||
| 297 | 291 | * @param string $name |
| 298 | 292 | * @return mixed|null |
| 299 | 293 | */ |
| 300 | - public function getEnvironment(string $name) |
|
| 301 | - { |
|
| 294 | + public function getEnvironment(string $name) { |
|
| 302 | 295 | if ($this->hasEnvironment($name)) { |
| 303 | 296 | return $this->environments[$name]; |
| 304 | 297 | } |
@@ -338,8 +331,7 @@ discard block |
||
| 338 | 331 | * @param string $key |
| 339 | 332 | * @return mixed|null |
| 340 | 333 | */ |
| 341 | - protected function resolve(string $key) |
|
| 342 | - { |
|
| 334 | + protected function resolve(string $key) { |
|
| 343 | 335 | if ($key === 'null') { |
| 344 | 336 | return null; |
| 345 | 337 | } |
@@ -377,8 +369,7 @@ discard block |
||
| 377 | 369 | * @param string $key |
| 378 | 370 | * @return mixed|null |
| 379 | 371 | */ |
| 380 | - protected function fetch(string $key) |
|
| 381 | - { |
|
| 372 | + protected function fetch(string $key) { |
|
| 382 | 373 | if (array_key_exists($key, $this->environments)) { |
| 383 | 374 | return $this->environments[$key]; |
| 384 | 375 | } |
@@ -403,8 +394,7 @@ discard block |
||
| 403 | 394 | * @param string $key |
| 404 | 395 | * @return mixed|null |
| 405 | 396 | */ |
| 406 | - protected function variable(string $key) |
|
| 407 | - { |
|
| 397 | + protected function variable(string $key) { |
|
| 408 | 398 | // Support numeric and variable array indicies |
| 409 | 399 | $matches = []; |
| 410 | 400 | if (preg_match('|\[[0-9]+\]|', $key)) { |
@@ -61,8 +61,7 @@ discard block |
||
| 61 | 61 | * If you would like to make data available to the web designers which you don't |
| 62 | 62 | * want loaded unless needed then a drop is a great way to do that. |
| 63 | 63 | */ |
| 64 | -abstract class Drop |
|
| 65 | -{ |
|
| 64 | +abstract class Drop { |
|
| 66 | 65 | /** |
| 67 | 66 | * The context instance to use |
| 68 | 67 | * @var Context |
@@ -96,8 +95,7 @@ discard block |
||
| 96 | 95 | * @param string $method |
| 97 | 96 | * @return mixed |
| 98 | 97 | */ |
| 99 | - public function invokeDrop(string $method) |
|
| 100 | - { |
|
| 98 | + public function invokeDrop(string $method) { |
|
| 101 | 99 | $result = $this->beforeMethod($method); |
| 102 | 100 | if ($result === null && is_callable([$this, $method])) { |
| 103 | 101 | $result = $this->{$method}(); |
@@ -129,8 +127,7 @@ discard block |
||
| 129 | 127 | * @param string $method |
| 130 | 128 | * @return mixed |
| 131 | 129 | */ |
| 132 | - protected function beforeMethod(string $method) |
|
| 133 | - { |
|
| 130 | + protected function beforeMethod(string $method) { |
|
| 134 | 131 | return null; |
| 135 | 132 | } |
| 136 | 133 | } |
@@ -53,7 +53,6 @@ |
||
| 53 | 53 | * Class AbstractFilter |
| 54 | 54 | * @package Platine\Template\Parser |
| 55 | 55 | */ |
| 56 | -abstract class AbstractFilter |
|
| 57 | -{ |
|
| 56 | +abstract class AbstractFilter { |
|
| 58 | 57 | |
| 59 | 58 | } |