[TwigBridge] cleaner implementation of the TwigRenderer
This commit is contained in:
parent
3c9958cbc3
commit
c7c5ba8946
@ -19,16 +19,19 @@ use Twig\Environment;
|
||||
*/
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -36,6 +39,6 @@ class TwigRenderer extends FormRenderer implements TwigRendererInterface
|
||||
*/
|
||||
public function setEnvironment(Environment $environment)
|
||||
{
|
||||
$this->engine->setEnvironment($environment);
|
||||
$this->getEngine()->setEnvironment($environment);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user