8000 [TwigBridge] cleaner implementation of the TwigRenderer by Tobion · Pull Request #23435 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[TwigBridge] cleaner implementation of the TwigRenderer #23435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[TwigBridge] cleaner implementation of the TwigRenderer
  • Loading branch information
Tobion committed Jul 6, 2017
commit c7c5ba894600e9e859c33ee28ecd04626da241a3
17 changes: 10 additions & 7 deletions src/Symfony/Bridge/Twig/Form/TwigRenderer.php
Original file line number Diff line number Diff line change
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is added so that static code analysis and autocomplete works (which I assume is the also the only reason the private engine property was overwritten)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO adding autocomplete for deprecated method isn't worth it. It seems autocomplete for it never worked.

*/
public function getEngine()
{
return parent::getEngine();
}

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