Skip to content

Commit 62fdf9c

Browse files
minor #23435 [TwigBridge] cleaner implementation of the TwigRenderer (Tobion)
This PR was merged into the 2.7 branch. Discussion ---------- [TwigBridge] cleaner implementation of the TwigRenderer | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no <!-- don't forget updating src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget updating UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | #23432 (comment) | License | MIT | Doc PR | <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the 3.4, legacy code removals go to the master branch. - Please fill in this template according to the PR you're about to submit. - Replace this comment by a description of what your PR is solving. --> Commits ------- c7c5ba8 [TwigBridge] cleaner implementation of the TwigRenderer
2 parents 87a6845 + c7c5ba8 commit 62fdf9c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/Symfony/Bridge/Twig/Form/TwigRenderer.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,26 @@
1919
*/
2020
class TwigRenderer extends FormRenderer implements TwigRendererInterface
2121
{
22-
/**
23-
* @var TwigRendererEngineInterface
24-
*/
25-
private $engine;
26-
2722
public function __construct(TwigRendererEngineInterface $engine, $csrfTokenManager = null)
2823
{
2924
parent::__construct($engine, $csrfTokenManager);
25+
}
3026

31-
$this->engine = $engine;
27+
/**
28+
* Returns the engine used by this renderer.
29+
*
30+
* @return TwigRendererEngineInterface The renderer engine
31+
*/
32+
public function getEngine()
33+
{
34+
return parent::getEngine();
3235
}
3336

3437
/**
3538
* {@inheritdoc}
3639
*/
3740
public function setEnvironment(Environment $environment)
3841
{
39-
$this->engine->setEnvironment($environment);
42+
$this->getEngine()->setEnvironment($environment);
4043
}
4144
}

0 commit comments

Comments
 (0)