@@ -70,8 +70,8 @@ discard block |
||
| 70 | 70 | protected string $name; |
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | - * {@inheritdoc} |
|
| 74 | - */ |
|
| 73 | + * {@inheritdoc} |
|
| 74 | + */ |
|
| 75 | 75 | public function __construct(string $markup, &$tokens, Parser $parser) |
| 76 | 76 | { |
| 77 | 77 | $lexer = new Lexer('/(' . Token::VARIABLE_NAME . ')/'); |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | - * {@inheritdoc} |
|
| 90 | - */ |
|
| 89 | + * {@inheritdoc} |
|
| 90 | + */ |
|
| 91 | 91 | public function render(Context $context): string |
| 92 | 92 | { |
| 93 | 93 | // if the value is not set in the environment check to see if it |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | * Class DecrementTag |
| 61 | 61 | * @package Platine\Template\Tag |
| 62 | 62 | */ |
| 63 | -class DecrementTag extends AbstractTag |
|
| 64 | -{ |
|
| 63 | +class DecrementTag extends AbstractTag { |
|
| 65 | 64 | /** |
| 66 | 65 | * Name of the variable to decrement |
| 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); |
@@ -59,8 +59,8 @@ |
||
| 59 | 59 | class ContinueTag extends AbstractTag |
| 60 | 60 | { |
| 61 | 61 | /** |
| 62 | - * {@inheritdoc} |
|
| 63 | - */ |
|
| 62 | + * {@inheritdoc} |
|
| 63 | + */ |
|
| 64 | 64 | public function render(Context $context): string |
| 65 | 65 | { |
| 66 | 66 | $context->setRegister('continue', true); |
@@ -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 | */ |
@@ -59,8 +59,8 @@ |
||
| 59 | 59 | class BreakTag extends AbstractTag |
| 60 | 60 | { |
| 61 | 61 | /** |
| 62 | - * {@inheritdoc} |
|
| 63 | - */ |
|
| 62 | + * {@inheritdoc} |
|
| 63 | + */ |
|
| 64 | 64 | public function render(Context $context): string |
| 65 | 65 | { |
| 66 | 66 | $context->setRegister('break', true); |
@@ -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 | */ |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | protected $right = null; |
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | - * {@inheritdoc} |
|
| 94 | - */ |
|
| 93 | + * {@inheritdoc} |
|
| 94 | + */ |
|
| 95 | 95 | public function __construct(string $markup, &$tokens, Parser $parser) |
| 96 | 96 | { |
| 97 | 97 | parent::__construct($markup, $tokens, $parser); |
@@ -108,16 +108,16 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | - * {@inheritdoc} |
|
| 112 | - */ |
|
| 111 | + * {@inheritdoc} |
|
| 112 | + */ |
|
| 113 | 113 | protected function endTag(): void |
| 114 | 114 | { |
| 115 | 115 | $this->pushNodeList(); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | - * {@inheritdoc} |
|
| 120 | - */ |
|
| 119 | + * {@inheritdoc} |
|
| 120 | + */ |
|
| 121 | 121 | protected function unknownTag(string $tag, string $param, array $tokens): void |
| 122 | 122 | { |
| 123 | 123 | $whenLexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/'); |
@@ -150,8 +150,8 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** |
| 153 | - * {@inheritdoc} |
|
| 154 | - */ |
|
| 153 | + * {@inheritdoc} |
|
| 154 | + */ |
|
| 155 | 155 | public function render(Context $context): string |
| 156 | 156 | { |
| 157 | 157 | $output = ''; |
@@ -62,8 +62,7 @@ discard block |
||
| 62 | 62 | * Class CaseTag |
| 63 | 63 | * @package Platine\Template\Tag |
| 64 | 64 | */ |
| 65 | -class CaseTag extends AbstractCondition |
|
| 66 | -{ |
|
| 65 | +class CaseTag extends AbstractCondition { |
|
| 67 | 66 | /** |
| 68 | 67 | * Stack of node list |
| 69 | 68 | * @var array<int, array<int, mixed>> |
@@ -91,8 +90,7 @@ discard block |
||
| 91 | 90 | /** |
| 92 | 91 | * {@inheritdoc} |
| 93 | 92 | */ |
| 94 | - public function __construct(string $markup, &$tokens, Parser $parser) |
|
| 95 | - { |
|
| 93 | + public function __construct(string $markup, &$tokens, Parser $parser) { |
|
| 96 | 94 | parent::__construct($markup, $tokens, $parser); |
| 97 | 95 | |
| 98 | 96 | $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/'); |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | protected string $variableName; |
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | - * {@inheritdoc} |
|
| 80 | - */ |
|
| 79 | + * {@inheritdoc} |
|
| 80 | + */ |
|
| 81 | 81 | public function __construct(string $markup, &$tokens, Parser $parser) |
| 82 | 82 | { |
| 83 | 83 | $lexer = new Lexer('/(\w+)\s*=\s*(.*)\s*/'); |
@@ -93,8 +93,8 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | - * {@inheritdoc} |
|
| 97 | - */ |
|
| 96 | + * {@inheritdoc} |
|
| 97 | + */ |
|
| 98 | 98 | public function render(Context $context): string |
| 99 | 99 | { |
| 100 | 100 | $output = $this->variable->render($context); |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | * Class SetTag |
| 61 | 61 | * @package Platine\Template\Tag |
| 62 | 62 | */ |
| 63 | -class SetTag extends AbstractTag |
|
| 64 | -{ |
|
| 63 | +class SetTag extends AbstractTag { |
|
| 65 | 64 | /** |
| 66 | 65 | * The variable instance to assign |
| 67 | 66 | * @var Variable |
@@ -77,8 +76,7 @@ discard block |
||
| 77 | 76 | /** |
| 78 | 77 | * {@inheritdoc} |
| 79 | 78 | */ |
| 80 | - public function __construct(string $markup, &$tokens, Parser $parser) |
|
| 81 | - { |
|
| 79 | + public function __construct(string $markup, &$tokens, Parser $parser) { |
|
| 82 | 80 | $lexer = new Lexer('/(\w+)\s*=\s*(.*)\s*/'); |
| 83 | 81 | if ($lexer->match($markup)) { |
| 84 | 82 | $this->variableName = $lexer->getStringMatch(1); |
@@ -69,8 +69,8 @@ |
||
| 69 | 69 | protected string $blockName; |
| 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('/(\w+)/'); |
@@ -58,8 +58,7 @@ discard block |
||
| 58 | 58 | * Class BlockTag |
| 59 | 59 | * @package Platine\Template\Tag |
| 60 | 60 | */ |
| 61 | -class BlockTag extends AbstractBlock |
|
| 62 | -{ |
|
| 61 | +class BlockTag extends AbstractBlock { |
|
| 63 | 62 | /** |
| 64 | 63 | * The name of the block |
| 65 | 64 | * @var string |
@@ -69,8 +68,7 @@ discard block |
||
| 69 | 68 | /** |
| 70 | 69 | * {@inheritdoc} |
| 71 | 70 | */ |
| 72 | - public function __construct(string $markup, &$tokens, Parser $parser) |
|
| 73 | - { |
|
| 71 | + public function __construct(string $markup, &$tokens, Parser $parser) { |
|
| 74 | 72 | $lexer = new Lexer('/(\w+)/'); |
| 75 | 73 | if ($lexer->match($markup)) { |
| 76 | 74 | $this->blockName = $lexer->getStringMatch(1); |
@@ -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 | } |
@@ -56,8 +56,8 @@ |
||
| 56 | 56 | class IfnotTag extends IfTag |
| 57 | 57 | { |
| 58 | 58 | /** |
| 59 | - * {@inheritdoc} |
|
| 60 | - */ |
|
| 59 | + * {@inheritdoc} |
|
| 60 | + */ |
|
| 61 | 61 | protected function negateCondition($value) |
| 62 | 62 | { |
| 63 | 63 | return !$value; |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | protected array $blocks = []; |
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | - * {@inheritdoc} |
|
| 81 | - */ |
|
| 80 | + * {@inheritdoc} |
|
| 81 | + */ |
|
| 82 | 82 | public function __construct(string $markup, &$tokens, Parser $parser) |
| 83 | 83 | { |
| 84 | 84 | //Initialize |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | - * {@inheritdoc} |
|
| 94 | - */ |
|
| 93 | + * {@inheritdoc} |
|
| 94 | + */ |
|
| 95 | 95 | public function render(Context $context): string |
| 96 | 96 | { |
| 97 | 97 | $context->push(); |
@@ -217,8 +217,8 @@ discard block |
||
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
| 220 | - * {@inheritdoc} |
|
| 221 | - */ |
|
| 220 | + * {@inheritdoc} |
|
| 221 | + */ |
|
| 222 | 222 | protected function unknownTag(string $tag, string $param, array $tokens): void |
| 223 | 223 | { |
| 224 | 224 | if ($tag === 'else' || $tag === 'elseif') { |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | * Class IfTag |
| 61 | 61 | * @package Platine\Template\Tag |
| 62 | 62 | */ |
| 63 | -class IfTag extends AbstractCondition |
|
| 64 | -{ |
|
| 63 | +class IfTag extends AbstractCondition { |
|
| 65 | 64 | /** |
| 66 | 65 | * holding the nodes to render for each logical block |
| 67 | 66 | * @var array<int, mixed> |
@@ -78,8 +77,7 @@ discard block |
||
| 78 | 77 | /** |
| 79 | 78 | * {@inheritdoc} |
| 80 | 79 | */ |
| 81 | - public function __construct(string $markup, &$tokens, Parser $parser) |
|
| 82 | - { |
|
| 80 | + public function __construct(string $markup, &$tokens, Parser $parser) { |
|
| 83 | 81 | //Initialize |
| 84 | 82 | $this->nodeListHolders[count($this->blocks)] = []; |
| 85 | 83 | $this->nodeList = & $this->nodeListHolders[count($this->blocks)]; |
@@ -207,8 +205,7 @@ discard block |
||
| 207 | 205 | * @param mixed $value |
| 208 | 206 | * @return mixed |
| 209 | 207 | */ |
| 210 | - protected function negateCondition($value) |
|
| 211 | - { |
|
| 208 | + protected function negateCondition($value) { |
|
| 212 | 209 | // no need to negate a condition in a regular `if` |
| 213 | 210 | // tag (will do that in `ifnot` tag) |
| 214 | 211 | |
@@ -69,8 +69,8 @@ discard block |
||
| 69 | 69 | protected string $value; |
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | - * {@inheritdoc} |
|
| 73 | - */ |
|
| 72 | + * {@inheritdoc} |
|
| 73 | + */ |
|
| 74 | 74 | public function __construct(string $markup, &$tokens, Parser $parser) |
| 75 | 75 | { |
| 76 | 76 | parent::__construct($markup, $tokens, $parser); |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | - * {@inheritdoc} |
|
| 91 | - */ |
|
| 90 | + * {@inheritdoc} |
|
| 91 | + */ |
|
| 92 | 92 | public function render(Context $context): string |
| 93 | 93 | { |
| 94 | 94 | $debugValue = $context->get($this->value); |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | * Class DebugTag |
| 61 | 61 | * @package Platine\Template\Tag |
| 62 | 62 | */ |
| 63 | -class DebugTag extends AbstractTag |
|
| 64 | -{ |
|
| 63 | +class DebugTag extends AbstractTag { |
|
| 65 | 64 | /** |
| 66 | 65 | * Value to debug |
| 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 | parent::__construct($markup, $tokens, $parser); |
| 77 | 75 | |
| 78 | 76 | $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/'); |