File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1212namespace FOS \RestBundle \DependencyInjection ;
1313
1414use Symfony \Component \Config \FileLocator ;
15+ use Symfony \Component \DependencyInjection \Extension \PrependExtensionInterface ;
1516use Symfony \Component \HttpKernel \DependencyInjection \Extension ;
1617use Symfony \Component \DependencyInjection \ContainerBuilder ;
1718use Symfony \Component \DependencyInjection \Loader \XmlFileLoader ;
1819use Symfony \Component \DependencyInjection \DefinitionDecorator ;
1920use Symfony \Component \DependencyInjection \Reference ;
2021use FOS \RestBundle \Util \Codes ;
2122
22- class FOSRestExtension extends Extension
23+ class FOSRestExtension extends Extension implements PrependExtensionInterface
2324{
25+ /**
26+ * Default sensio_framework_extra { view: { annotations: false } }
27+ *
28+ * {@inheritDoc}
29+ */
30+ public function prepend (ContainerBuilder $ container )
31+ {
32+ $ configs = $ container ->getExtensionConfig ($ this ->getAlias ());
33+ $ parameterBag = $ container ->getParameterBag ();
34+ $ configs = $ parameterBag ->resolveValue ($ configs );
35+ $ config = $ this ->processConfiguration (new Configuration (), $ configs );
36+
37+ if (!empty ($ config ['view ' ]['view_response_listener ' ])) {
38+ $ container ->prependExtensionConfig ('sensio_framework_extra ' , array ('view ' => array ('annotations ' => false )));
39+ }
40+ }
2441 /**
2542 * Loads the services based on your application configuration.
2643 *
You can’t perform that action at this time.
0 commit comments