@@ -32,10 +32,12 @@ public function load(array $configs, ContainerBuilder $container)
3232 $ this ->configureRouteNameInflector ($ config , $ container );
3333 $ this ->configureAnnotations ($ config , $ container , $ loader );
3434
35- $ this ->addClassesToCompile (array (
36- 'BeSimple \\I18nRoutingBundle \\Routing \\Router ' ,
37- 'BeSimple \\I18nRoutingBundle \\Routing \\RouteGenerator \\NameInflector \\RouteNameInflectorInterface '
38- ));
35+ if (PHP_VERSION_ID < 70000 ) {
36+ $ this ->addClassesToCompile (array (
37+ 'BeSimple \\I18nRoutingBundle \\Routing \\Router ' ,
38+ 'BeSimple \\I18nRoutingBundle \\Routing \\RouteGenerator \\NameInflector \\RouteNameInflectorInterface '
39+ ));
40+ }
3941 }
4042
4143 /**
@@ -175,16 +177,18 @@ private function configureRouteNameInflector(array $config, ContainerBuilder $co
175177 $ container ->setAlias ('be_simple_i18n_routing.route_name_inflector ' , $ config ['route_name_inflector ' ]);
176178 }
177179
178- // Try and register the route name inflector to compilation/caching
179- try {
180- $ def = $ container ->findDefinition ('be_simple_i18n_routing.route_name_inflector ' );
181- if ($ def ->getClass () !== null ) {
182- $ this ->addClassesToCompile (array ($ def ->getClass ()));
180+ if (PHP_VERSION_ID < 70000 ) {
181+ // Try and register the route name inflector to compilation/caching
182+ try {
183+ $ def = $ container ->findDefinition ('be_simple_i18n_routing.route_name_inflector ' );
184+ if ($ def ->getClass () !== null ) {
185+ $ this ->addClassesToCompile (array ($ def ->getClass ()));
186+ }
187+ } catch (ServiceNotFoundException $ e ) {
188+ // This happens when the alias is set to a external service
189+ } catch (InvalidArgumentException $ e ) {
190+ // This happens when the alias is set to a external service in Symfony 2.3
183191 }
184- } catch (ServiceNotFoundException $ e ) {
185- // This happens when the alias is set to a external service
186- } catch (InvalidArgumentException $ e ) {
187- // This happens when the alias is set to a external service in Symfony 2.3
188192 }
189193 }
190194
0 commit comments