File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
DependencyInjection/Compiler Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1414use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
1515use Symfony \Component \DependencyInjection \Compiler \ServiceLocatorTagPass ;
1616use Symfony \Component \DependencyInjection \ContainerBuilder ;
17+ use Symfony \Component \DependencyInjection \Definition ;
1718use Symfony \Component \DependencyInjection \Reference ;
1819
1920/**
@@ -29,9 +30,10 @@ public function process(ContainerBuilder $container)
2930
3031 $ privateServices = array ();
3132 $ definitions = $ container ->getDefinitions ();
33+ $ hasErrors = method_exists (Definition::class, 'hasErrors ' ) ? 'hasErrors ' : 'getErrors ' ;
3234
3335 foreach ($ definitions as $ id => $ definition ) {
34- if ($ id && '. ' !== $ id [0 ] && (!$ definition ->isPublic () || $ definition ->isPrivate ()) && !$ definition ->hasErrors () && !$ definition ->isAbstract ()) {
36+ if ($ id && '. ' !== $ id [0 ] && (!$ definition ->isPublic () || $ definition ->isPrivate ()) && !$ definition ->$ hasErrors () && !$ definition ->isAbstract ()) {
3537 $ privateServices [$ id ] = new Reference ($ id , ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE );
3638 }
3739 }
@@ -43,7 +45,7 @@ public function process(ContainerBuilder $container)
4345 while (isset ($ aliases [$ target = (string ) $ alias ])) {
4446 $ alias = $ aliases [$ target ];
4547 }
46- if (isset ($ definitions [$ target ]) && !$ definitions [$ target ]->hasErrors () && !$ definitions [$ target ]->isAbstract ()) {
48+ if (isset ($ definitions [$ target ]) && !$ definitions [$ target ]->$ hasErrors () && !$ definitions [$ target ]->isAbstract ()) {
4749 $ privateServices [$ id ] = new Reference ($ target , ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE );
4850 }
4951 }
You can’t perform that action at this time.
0 commit comments