@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | $this->escapingEnabled = $this->configuration->isFeatureEnabled(Configuration::FEATURE_ESCAPING); |
| 299 | 299 | if (!$this->configuration->isFeatureEnabled(Configuration::FEATURE_PARSING)) { |
| 300 | 300 | throw (new PassthroughSourceException('Source must be represented as raw string', 1563379852)) |
| 301 | - ->setSource((string)$this->sequenceRemainderAsText()); |
|
| 301 | + ->setSource((string) $this->sequenceRemainderAsText()); |
|
| 302 | 302 | } |
| 303 | 303 | return; |
| 304 | 304 | } |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | // hand equivalent of having written `attr="{attr}"` in the Fluid template. |
| 491 | 491 | $key = $captured; |
| 492 | 492 | } |
| 493 | - } elseif ($namespace !== null || (!isset($namespace, $method) && $this->resolver->isAliasRegistered((string)$captured))) { |
|
| 493 | + } elseif ($namespace !== null || (!isset($namespace, $method) && $this->resolver->isAliasRegistered((string) $captured))) { |
|
| 494 | 494 | $method = $captured; |
| 495 | 495 | |
| 496 | 496 | try { |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | ++$ignoredEndingBraces; |
| 593 | 593 | $countedEscapes = 0; |
| 594 | 594 | if ($captured !== null) { |
| 595 | - $node->addChild(new TextNode((string)$captured)); |
|
| 595 | + $node->addChild(new TextNode((string) $captured)); |
|
| 596 | 596 | } |
| 597 | 597 | } elseif ($this->splitter->context->context === Context::CONTEXT_PROTECTED) { |
| 598 | 598 | // Ignore one ending additional curly brace. Subtracted in the BYTE_INLINE_END case below. |
@@ -735,7 +735,7 @@ discard block |
||
| 735 | 735 | $isArray = $allowArray; |
| 736 | 736 | $callDetected = false; |
| 737 | 737 | |
| 738 | - $text .= $this->source->source[$this->splitter->index - 1]; |
|
| 738 | + $text .= $this->source->source[$this->splitter->index - 1]; |
|
| 739 | 739 | $node = $node ?? new ObjectAccessorNode(); |
| 740 | 740 | if ($potentialAccessor ?? $captured) { |
| 741 | 741 | $node->addChild(new TextNode($potentialAccessor . $captured)); |
@@ -963,7 +963,7 @@ discard block |
||
| 963 | 963 | throw $this->createErrorAtPosition('Unexpected colon or equals sign, no preceding key', 1559250839); |
| 964 | 964 | } |
| 965 | 965 | if ($definitions !== null && !$numeric && !isset($definitions[$key])) { |
| 966 | - throw $this->createUnsupportedArgumentError((string)$key, $definitions); |
|
| 966 | + throw $this->createUnsupportedArgumentError((string) $key, $definitions); |
|
| 967 | 967 | } |
| 968 | 968 | break; |
| 969 | 969 | |
@@ -1027,7 +1027,7 @@ discard block |
||
| 1027 | 1027 | } elseif ($captured !== null) { |
| 1028 | 1028 | $key = $key ?? ($numeric ? ++$itemCount : $captured); |
| 1029 | 1029 | if (!$numeric && $definitions !== null && !isset($definitions[$key])) { |
| 1030 | - throw $this->createUnsupportedArgumentError((string)$key, $definitions); |
|
| 1030 | + throw $this->createUnsupportedArgumentError((string) $key, $definitions); |
|
| 1031 | 1031 | } |
| 1032 | 1032 | $value = is_numeric($captured) ? $captured + 0 : new ObjectAccessorNode($captured); |
| 1033 | 1033 | } |
@@ -1071,7 +1071,7 @@ discard block |
||
| 1071 | 1071 | } |
| 1072 | 1072 | } |
| 1073 | 1073 | if (!$numeric && isset($key, $definitions) && !isset($definitions[$key])) { |
| 1074 | - throw $this->createUnsupportedArgumentError((string)$key, $definitions); |
|
| 1074 | + throw $this->createUnsupportedArgumentError((string) $key, $definitions); |
|
| 1075 | 1075 | } |
| 1076 | 1076 | $this->escapingEnabled = $escapingEnabledBackup; |
| 1077 | 1077 | $this->splitter->switch($restore); |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | $argumentName = $this->resolveContentArgumentName(); |
| 80 | 80 | $arguments = $this->arguments ?? []; |
| 81 | 81 | $self = $this; |
| 82 | - $renderChildrenClosure = function () use ($arguments, $argumentName, $self) { |
|
| 82 | + $renderChildrenClosure = function() use ($arguments, $argumentName, $self) { |
|
| 83 | 83 | return !empty($argumentName) ? ($arguments[$argumentName] ?? $self->renderChildren()) : $self->renderChildren(); |
| 84 | 84 | }; |
| 85 | 85 | return $renderChildrenClosure; |
@@ -22,12 +22,18 @@ |
||
| 22 | 22 | |
| 23 | 23 | protected $file; |
| 24 | 24 | |
| 25 | + /** |
|
| 26 | + * @param string $name |
|
| 27 | + */ |
|
| 25 | 28 | public function setName(?string $name): ComponentInterface |
| 26 | 29 | { |
| 27 | 30 | $this->name = $name; |
| 28 | 31 | return $this; |
| 29 | 32 | } |
| 30 | 33 | |
| 34 | + /** |
|
| 35 | + * @param string $file |
|
| 36 | + */ |
|
| 31 | 37 | public function setFile($file): ComponentInterface |
| 32 | 38 | { |
| 33 | 39 | $this->file = $file; |
@@ -70,6 +70,7 @@ |
||
| 70 | 70 | * |
| 71 | 71 | * @param Source $source Template source instance |
| 72 | 72 | * @param Configuration|null Template parsing configuration to use |
| 73 | + * @param Configuration $configuration |
|
| 73 | 74 | * @return ComponentInterface Parsed template |
| 74 | 75 | * @throws Exception |
| 75 | 76 | */ |