File tree 1 file changed +4
-2
lines changed
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 14
14
use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
15
15
use Symfony \Component \DependencyInjection \Compiler \ServiceLocatorTagPass ;
16
16
use Symfony \Component \DependencyInjection \ContainerBuilder ;
17
+ use Symfony \Component \DependencyInjection \Definition ;
17
18
use Symfony \Component \DependencyInjection \Reference ;
18
19
19
20
/**
@@ -29,9 +30,10 @@ public function process(ContainerBuilder $container)
29
30
30
31
$ privateServices = array ();
31
32
$ definitions = $ container ->getDefinitions ();
33
+ $ hasErrors = method_exists (Definition::class, 'hasErrors ' ) ? 'hasErrors ' : 'getErrors ' ;
32
34
33
35
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 ()) {
35
37
$ privateServices [$ id ] = new Reference ($ id , ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE );
36
38
}
37
39
}
@@ -43,7 +45,7 @@ public function process(ContainerBuilder $container)
43
45
while (isset ($ aliases [$ target = (string ) $ alias ])) {
44
46
$ alias = $ aliases [$ target ];
45
47
}
46
- if (isset ($ definitions [$ target ]) && !$ definitions [$ target ]->hasErrors () && !$ definitions [$ target ]->isAbstract ()) {
48
+ if (isset ($ definitions [$ target ]) && !$ definitions [$ target ]->$ hasErrors () && !$ definitions [$ target ]->isAbstract ()) {
47
49
$ privateServices [$ id ] = new Reference ($ target , ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE );
48
50
}
49
51
}
You can’t perform that action at this time.
0 commit comments