@@ -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); |
@@ -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); |
@@ -53,6 +53,5 @@ |
||
53 | 53 | * @class AbstractFilter |
54 | 54 | * @package Platine\Template\Parser |
55 | 55 | */ |
56 | -abstract class AbstractFilter |
|
57 | -{ |
|
56 | +abstract class AbstractFilter { |
|
58 | 57 | } |
@@ -56,8 +56,7 @@ |
||
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 |
@@ -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(); |
@@ -56,13 +56,13 @@ |
||
56 | 56 | * @package Platine\Template\Parser |
57 | 57 | * |
58 | 58 | */ |
59 | - /** |
|
60 | - * A drop is a class which allows you to export DOM like things to template. |
|
61 | - * Methods of drops are callable. |
|
62 | - * The main use for drops is the implement lazy loaded objects. |
|
63 | - * If you would like to make data available to the web designers which you don't |
|
64 | - * want loaded unless needed then a drop is a great way to do that. |
|
65 | - */ |
|
59 | + /** |
|
60 | + * A drop is a class which allows you to export DOM like things to template. |
|
61 | + * Methods of drops are callable. |
|
62 | + * The main use for drops is the implement lazy loaded objects. |
|
63 | + * If you would like to make data available to the web designers which you don't |
|
64 | + * want loaded unless needed then a drop is a great way to do that. |
|
65 | + */ |
|
66 | 66 | abstract class Drop implements Stringable |
67 | 67 | { |
68 | 68 | /** |
@@ -63,8 +63,7 @@ |
||
63 | 63 | * If you would like to make data available to the web designers which you don't |
64 | 64 | * want loaded unless needed then a drop is a great way to do that. |
65 | 65 | */ |
66 | -abstract class Drop implements Stringable |
|
67 | -{ |
|
66 | +abstract class Drop implements Stringable { |
|
68 | 67 | /** |
69 | 68 | * The context instance to use |
70 | 69 | * @var Context |
@@ -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 |
@@ -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 | */ |
@@ -67,7 +67,7 @@ |
||
67 | 67 | |
68 | 68 | /** |
69 | 69 | * {@inheritdoc} |
70 | - */ |
|
70 | + */ |
|
71 | 71 | public function read(string $name): string |
72 | 72 | { |
73 | 73 | if (array_key_exists($name, $this->data) === false) { |
@@ -55,14 +55,12 @@ |
||
55 | 55 | * @class StringLoader |
56 | 56 | * @package Platine\Template\Loader |
57 | 57 | */ |
58 | -class StringLoader implements LoaderInterface |
|
59 | -{ |
|
58 | +class StringLoader implements LoaderInterface { |
|
60 | 59 | /** |
61 | 60 | * Create new instance |
62 | 61 | * @param array<string, string> $data The string hash data |
63 | 62 | */ |
64 | - public function __construct(protected array $data) |
|
65 | - { |
|
63 | + public function __construct(protected array $data) { |
|
66 | 64 | } |
67 | 65 | |
68 | 66 | /** |