Skip to content

Commit

Permalink
minor #23435 [TwigBridge] cleaner implementation of the TwigRenderer …
Browse files Browse the repository at this point in the history
…(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
  • Loading branch information
nicolas-grekas committed Jul 13, 2017
2 parents 87a6845 + c7c5ba8 commit 62fdf9c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/Symfony/Bridge/Twig/Form/TwigRenderer.php
Expand Up @@ -19,23 +19,26 @@
*/
class TwigRenderer extends FormRenderer implements TwigRendererInterface
{
/**
* @var TwigRendererEngineInterface
*/
private $engine;

public function __construct(TwigRendererEngineInterface $engine, $csrfTokenManager = null)
{
parent::__construct($engine, $csrfTokenManager);
}

$this->engine = $engine;
/**
* Returns the engine used by this renderer.
*
* @return TwigRendererEngineInterface The renderer engine
*/
public function getEngine()
{
return parent::getEngine();
}

/**
* {@inheritdoc}
*/
public function setEnvironment(Environment $environment)
{
$this->engine->setEnvironment($environment);
$this->getEngine()->setEnvironment($environment);
}
}

0 comments on commit 62fdf9c

Please sign in to comment.