Skip to content
Permalink
Browse files

Twig setEnvironment not required, removed circular dependencies

  • Loading branch information...
andrewshell committed Sep 26, 2016
1 parent fdb973b commit 6ca6a7b6e14269439c821cfaaef4e5d128d318b0
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/Config.php
@@ -73,9 +73,14 @@ public function define(Container $di)
'options' => ['debug' => true],
];
$di->setters[Twig_Environment::class]['setExtensions'] = new LazyArray([
$di->lazyNew(TranslationExtension::class),
$di->lazyNew(Twig_Extension_Debug::class),
$di->lazyNew(FormExtension::class),
]);
/** TwigRendererEngine */
$di->params[TwigRendererEngine::class]['defaultThemes'] = [self::DEFAULT_FORM_THEME];
$di->setters[TwigRendererEngine::class]['setEnvironment'] = $di->lazyNew(Twig_Environment::class);
/** TwigRenderer */
$di->params[TwigRenderer::class]['engine'] = $di->lazyNew(TwigRendererEngine::class);
@@ -122,9 +127,6 @@ public function define(Container $di)
public function modify(Container $di)
{
$twig = $di->get('twig:environment');
$twig->addExtension($di->newInstance(TranslationExtension::class));
$twig->addExtension($di->newInstance(Twig_Extension_Debug::class));
$twig->addExtension($di->newInstance(FormExtension::class));
}
}

0 comments on commit 6ca6a7b

Please sign in to comment.
You can’t perform that action at this time.