@@ -53,8 +53,7 @@ |
||
| 53 | 53 | * Class LoaderInterface |
| 54 | 54 | * @package Platine\Template\Loader |
| 55 | 55 | */ |
| 56 | -interface LoaderInterface |
|
| 57 | -{ |
|
| 56 | +interface LoaderInterface { |
|
| 58 | 57 | /** |
| 59 | 58 | * Return the template content to be use |
| 60 | 59 | * for parse and rendering |
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | * Class Helper |
| 54 | 54 | * @package Platine\Template\Util |
| 55 | 55 | */ |
| 56 | -class Helper |
|
| 57 | -{ |
|
| 56 | +class Helper { |
|
| 58 | 57 | /** |
| 59 | 58 | * Normalize path |
| 60 | 59 | * @param string $path |
@@ -60,8 +60,8 @@ |
||
| 60 | 60 | class RawTag extends AbstractBlock |
| 61 | 61 | { |
| 62 | 62 | /** |
| 63 | - * {@inheritdoc} |
|
| 64 | - */ |
|
| 63 | + * {@inheritdoc} |
|
| 64 | + */ |
|
| 65 | 65 | public function parse(array &$tokens): void |
| 66 | 66 | { |
| 67 | 67 | $lexer = new Lexer( |
@@ -57,8 +57,7 @@ |
||
| 57 | 57 | * Class RawTag |
| 58 | 58 | * @package Platine\Template\Tag |
| 59 | 59 | */ |
| 60 | -class RawTag extends AbstractBlock |
|
| 61 | -{ |
|
| 60 | +class RawTag extends AbstractBlock { |
|
| 62 | 61 | /** |
| 63 | 62 | * {@inheritdoc} |
| 64 | 63 | */ |
@@ -59,8 +59,8 @@ |
||
| 59 | 59 | class CommentTag extends AbstractBlock |
| 60 | 60 | { |
| 61 | 61 | /** |
| 62 | - * {@inheritdoc} |
|
| 63 | - */ |
|
| 62 | + * {@inheritdoc} |
|
| 63 | + */ |
|
| 64 | 64 | public function render(Context $context): string |
| 65 | 65 | { |
| 66 | 66 | return ''; |
@@ -56,8 +56,7 @@ |
||
| 56 | 56 | * Class CommentTag |
| 57 | 57 | * @package Platine\Template\Tag |
| 58 | 58 | */ |
| 59 | -class CommentTag extends AbstractBlock |
|
| 60 | -{ |
|
| 59 | +class CommentTag extends AbstractBlock { |
|
| 61 | 60 | /** |
| 62 | 61 | * {@inheritdoc} |
| 63 | 62 | */ |
@@ -62,15 +62,15 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | class IncrementTag extends AbstractTag |
| 64 | 64 | { |
| 65 | - /** |
|
| 66 | - * Name of the variable to increment |
|
| 67 | - * @var string |
|
| 68 | - */ |
|
| 65 | + /** |
|
| 66 | + * Name of the variable to increment |
|
| 67 | + * @var string |
|
| 68 | + */ |
|
| 69 | 69 | protected string $name; |
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | - * {@inheritdoc} |
|
| 73 | - */ |
|
| 72 | + * {@inheritdoc} |
|
| 73 | + */ |
|
| 74 | 74 | public function __construct(string $markup, &$tokens, Parser $parser) |
| 75 | 75 | { |
| 76 | 76 | $lexer = new Lexer('/(' . Token::VARIABLE_NAME . ')/'); |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | - * {@inheritdoc} |
|
| 89 | - */ |
|
| 88 | + * {@inheritdoc} |
|
| 89 | + */ |
|
| 90 | 90 | public function render(Context $context): string |
| 91 | 91 | { |
| 92 | 92 | // if the value is not set in the environment check to see if it |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | * Class IncrementTag |
| 61 | 61 | * @package Platine\Template\Tag |
| 62 | 62 | */ |
| 63 | -class IncrementTag extends AbstractTag |
|
| 64 | -{ |
|
| 63 | +class IncrementTag extends AbstractTag { |
|
| 65 | 64 | /** |
| 66 | 65 | * Name of the variable to increment |
| 67 | 66 | * @var string |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | /** |
| 72 | 71 | * {@inheritdoc} |
| 73 | 72 | */ |
| 74 | - public function __construct(string $markup, &$tokens, Parser $parser) |
|
| 75 | - { |
|
| 73 | + public function __construct(string $markup, &$tokens, Parser $parser) { |
|
| 76 | 74 | $lexer = new Lexer('/(' . Token::VARIABLE_NAME . ')/'); |
| 77 | 75 | if ($lexer->match($markup)) { |
| 78 | 76 | $this->name = $lexer->getStringMatch(0); |
@@ -55,8 +55,7 @@ discard block |
||
| 55 | 55 | * Class AbstractCache |
| 56 | 56 | * @package Platine\Template\Cache |
| 57 | 57 | */ |
| 58 | -abstract class AbstractCache |
|
| 59 | -{ |
|
| 58 | +abstract class AbstractCache { |
|
| 60 | 59 | /** |
| 61 | 60 | * The cache expiration in second |
| 62 | 61 | * @var int |
@@ -79,8 +78,7 @@ discard block |
||
| 79 | 78 | * Create new instance |
| 80 | 79 | * @param Configuration|null $config |
| 81 | 80 | */ |
| 82 | - public function __construct(?Configuration $config = null) |
|
| 83 | - { |
|
| 81 | + public function __construct(?Configuration $config = null) { |
|
| 84 | 82 | $this->config = $config ?? new Configuration([]); |
| 85 | 83 | |
| 86 | 84 | $this->expire = $this->config->get('cache_expire'); |
@@ -55,8 +55,7 @@ |
||
| 55 | 55 | * Class Configuration |
| 56 | 56 | * @package Platine\Template |
| 57 | 57 | */ |
| 58 | -class Configuration extends AbstractConfiguration |
|
| 59 | -{ |
|
| 58 | +class Configuration extends AbstractConfiguration { |
|
| 60 | 59 | /** |
| 61 | 60 | * {@inheritdoc} |
| 62 | 61 | */ |
@@ -62,8 +62,7 @@ discard block |
||
| 62 | 62 | * Class FilterCollection |
| 63 | 63 | * @package Platine\Template\Parser |
| 64 | 64 | */ |
| 65 | -class FilterCollection |
|
| 66 | -{ |
|
| 65 | +class FilterCollection { |
|
| 67 | 66 | /** |
| 68 | 67 | * The list of filter with their name and class |
| 69 | 68 | * @var array<string, class-string> |
@@ -73,8 +72,7 @@ discard block |
||
| 73 | 72 | /** |
| 74 | 73 | * Create new instance |
| 75 | 74 | */ |
| 76 | - public function __construct() |
|
| 77 | - { |
|
| 75 | + public function __construct() { |
|
| 78 | 76 | $this->addFilter(ArrayFilter::class); |
| 79 | 77 | $this->addFilter(DatetimeFilter::class); |
| 80 | 78 | $this->addFilter(HtmlFilter::class); |
@@ -114,8 +112,7 @@ discard block |
||
| 114 | 112 | * @param array<int, mixed> $args |
| 115 | 113 | * @return mixed |
| 116 | 114 | */ |
| 117 | - public function invoke(string $name, $value, array $args = []) |
|
| 118 | - { |
|
| 115 | + public function invoke(string $name, $value, array $args = []) { |
|
| 119 | 116 | // workaround for a single standard filter being a reserved |
| 120 | 117 | // keyword - we can't use overloading for static calls |
| 121 | 118 | if ($name === 'default') { |
@@ -56,8 +56,7 @@ discard block |
||
| 56 | 56 | * Class AbstractCondition |
| 57 | 57 | * @package Platine\Template\Parser |
| 58 | 58 | */ |
| 59 | -abstract class AbstractCondition extends AbstractBlock |
|
| 60 | -{ |
|
| 59 | +abstract class AbstractCondition extends AbstractBlock { |
|
| 61 | 60 | /** |
| 62 | 61 | * The current left variable to compare |
| 63 | 62 | * @var mixed |
@@ -75,8 +74,7 @@ discard block |
||
| 75 | 74 | * @param mixed|null $value |
| 76 | 75 | * @return string|mixed|null |
| 77 | 76 | */ |
| 78 | - protected function stringValue($value) |
|
| 79 | - { |
|
| 77 | + protected function stringValue($value) { |
|
| 80 | 78 | if (is_object($value)) { |
| 81 | 79 | if (method_exists($value, '__toString')) { |
| 82 | 80 | return (string) $value; |