Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

Commit

Permalink
bug #1511 Fix deprecation notice with symfony/twig-bridge 3.2+ in Twi…
Browse files Browse the repository at this point in the history
…gServiceProvider (skalpa)

This PR was merged into the 2.1.x-dev branch.

Discussion
----------

Fix deprecation notice with symfony/twig-bridge 3.2+ in TwigServiceProvider

Fixes the deprecation triggered when instantiating `FormExtension` twig-bridge with 3.2+.

I check for the existence of `Symfony\Bridge\Twig\Extension\HttpKernelRuntime` to determine if we're using 3.2 as it was added in 3.2.0-beta1.

Commits
-------

6615118 Fix deprecation notice with symfony/twig-bridge 3.2+ in TwigServiceProvider
  • Loading branch information
fabpot committed May 3, 2017
2 parents 1b2f039 + 6615118 commit 1a0b1e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Silex/Provider/TwigServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function register(Container $app)
return new TwigRenderer($app['twig.form.engine'], $csrfTokenManager);
};

$twig->addExtension(new FormExtension($app['twig.form.renderer']));
$twig->addExtension(new FormExtension(class_exists(HttpKernelRuntime::class) ? null : $app['twig.form.renderer']));

// add loader for Symfony built-in form templates
$reflected = new \ReflectionClass('Symfony\Bridge\Twig\Extension\FormExtension');
Expand Down

0 comments on commit 1a0b1e1

Please sign in to comment.