@@ -34,19 +34,24 @@ |
||
| 34 | 34 | string $data, |
| 35 | 35 | array $options |
| 36 | 36 | ): void { |
| 37 | - if ($node === null) { |
|
| 37 | + if ($node === null) |
|
| 38 | + { |
|
| 38 | 39 | return; |
| 39 | 40 | } |
| 40 | 41 | |
| 41 | - if ($node instanceof CodeNode) { |
|
| 42 | + if ($node instanceof CodeNode) |
|
| 43 | + { |
|
| 42 | 44 | $node->setLanguage(trim($data)); |
| 43 | 45 | $node->setOptions($options); |
| 44 | 46 | } |
| 45 | 47 | |
| 46 | - if ($variable !== '') { |
|
| 48 | + if ($variable !== '') |
|
| 49 | + { |
|
| 47 | 50 | $environment = $parser->getEnvironment(); |
| 48 | 51 | $environment->setVariable($variable, $node); |
| 49 | - } else { |
|
| 52 | + } |
|
| 53 | + else |
|
| 54 | + { |
|
| 50 | 55 | $document = $parser->getDocument(); |
| 51 | 56 | $document->addNode($node); |
| 52 | 57 | } |
@@ -43,7 +43,8 @@ |
||
| 43 | 43 | |
| 44 | 44 | $url = $environment->relativeUrl($data); |
| 45 | 45 | |
| 46 | - if ($url === null) { |
|
| 46 | + if ($url === null) |
|
| 47 | + { |
|
| 47 | 48 | throw new \RuntimeException(sprintf('Could not get relative url for %s', $data)); |
| 48 | 49 | } |
| 49 | 50 | |
@@ -144,7 +144,7 @@ |
||
| 144 | 144 | // IteratorAggregate implementation |
| 145 | 145 | /// |
| 146 | 146 | |
| 147 | - public function getIterator(): \Traversable|\ArrayIterator |
|
| 147 | + public function getIterator(): \Traversable | \ArrayIterator |
|
| 148 | 148 | { |
| 149 | 149 | return new \ArrayIterator($this->data); |
| 150 | 150 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | /** |
| 114 | 114 | * Get the current File object. |
| 115 | 115 | */ |
| 116 | - public function current(): File|Folder |
|
| 116 | + public function current(): File | Folder |
|
| 117 | 117 | { |
| 118 | 118 | /** @var \SplFileInfo $current */ |
| 119 | 119 | $current = parent::current(); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | return new File($path); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - public function getChildren(): FileExplorer|\RecursiveFilterIterator|null |
|
| 130 | + public function getChildren(): FileExplorer | \RecursiveFilterIterator | null |
|
| 131 | 131 | { |
| 132 | 132 | $explorer = new self( |
| 133 | 133 | $this->getInnerIterator()->getChildren(), $this->includes, $this->excludes, $this->flags |
@@ -176,7 +176,7 @@ |
||
| 176 | 176 | return __::get($this->configuration, 'twig.autoescape'); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - public function getRedirectTemplate(): bool|string |
|
| 179 | + public function getRedirectTemplate(): bool | string |
|
| 180 | 180 | { |
| 181 | 181 | return __::get($this->configuration, 'templates.redirect'); |
| 182 | 182 | } |