Commit 3b1ba69b authored by Fabien Potencier's avatar Fabien Potencier

removed conditions about the request stack as Symfony 2.4+ is required now

parent cd044b6f
...@@ -117,9 +117,7 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte ...@@ -117,9 +117,7 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte
}); });
$this['request_stack'] = $this->share(function () use ($app) { $this['request_stack'] = $this->share(function () use ($app) {
if (class_exists('Symfony\Component\HttpFoundation\RequestStack')) { return new RequestStack();
return new RequestStack();
}
}); });
$this['request_context'] = $this->share(function () use ($app) { $this['request_context'] = $this->share(function () use ($app) {
......
...@@ -23,18 +23,12 @@ use Symfony\Component\HttpKernel\UriSigner; ...@@ -23,18 +23,12 @@ use Symfony\Component\HttpKernel\UriSigner;
/** /**
* HttpKernel Fragment integration for Silex. * HttpKernel Fragment integration for Silex.
* *
* This service provider requires Symfony 2.4+.
*
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class HttpFragmentServiceProvider implements ServiceProviderInterface class HttpFragmentServiceProvider implements ServiceProviderInterface
{ {
public function register(Application $app) public function register(Application $app)
{ {
if (!class_exists('Symfony\Component\HttpFoundation\RequestStack')) {
throw new \LogicException('The HTTP Fragment service provider only works with Symfony 2.4+.');
}
$app['fragment.handler'] = $app->share(function ($app) { $app['fragment.handler'] = $app->share(function ($app) {
return new FragmentHandler($app['fragment.renderers'], $app['debug'], $app['request_stack']); return new FragmentHandler($app['fragment.renderers'], $app['debug'], $app['request_stack']);
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment