Skip to content

Commit ec09cdf

Browse files
committed
minor #2506 [TwigComponent] Remove obsolete TemplateNameParser (sneakyvv)
This PR was merged into the 2.x branch. Discussion ---------- [TwigComponent] Remove obsolete TemplateNameParser It no longer parses (and should not have been stripping namespaces as it did before) | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Issues | | License | MIT As discussed in #1772 (comment), the code added in #1070 (& expanded in #1082) was not needed (even incorrect, based upon a decorator TemplateIterator of Shopware). Commits ------- 99cb909 Remove obsolete TemplateNameParser
2 parents fdc13a5 + 99cb909 commit ec09cdf

File tree

4 files changed

+2
-85
lines changed

4 files changed

+2
-85
lines changed

src/TwigComponent/src/Twig/ComponentNode.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function compile(Compiler $compiler): void
112112
->raw('), ')
113113
->raw($this->getAttribute('only') ? '[]' : '$context')
114114
->raw(', ')
115-
->string(TemplateNameParser::parse($this->getAttribute('embedded_template')))
115+
->string($this->getAttribute('embedded_template'))
116116
->raw(', ')
117117
->raw($this->getAttribute('embedded_index'))
118118
->raw(");\n");

src/TwigComponent/src/Twig/ComponentTokenParser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function parse(Token $token): Node
6363
$this->parser->embedTemplate($module);
6464

6565
// override the embedded index with a deterministic value, so it can be loaded in a controlled manner
66-
$module->setAttribute('index', $this->generateEmbeddedTemplateIndex(TemplateNameParser::parse($stream->getSourceContext()->getName()), $token->getLine()));
66+
$module->setAttribute('index', $this->generateEmbeddedTemplateIndex($stream->getSourceContext()->getName(), $token->getLine()));
6767

6868
$stream->expect(Token::BLOCK_END_TYPE);
6969

src/TwigComponent/src/Twig/TemplateNameParser.php

-36
This file was deleted.

src/TwigComponent/tests/Unit/Twig/TemplateNameParserTest.php

-47
This file was deleted.

0 commit comments

Comments
 (0)