16
16
use Symfony \Component \DependencyInjection \Compiler \CheckTypeDeclarationsPass ;
17
17
use Symfony \Component \DependencyInjection \Compiler \PassConfig ;
18
18
use Symfony \Component \DependencyInjection \ContainerBuilder ;
19
+ use Symfony \Component \DependencyInjection \ParameterBag \FrozenParameterBag ;
19
20
use Symfony \Component \HttpKernel \Bundle \Bundle ;
20
21
21
22
class TestBundle extends Bundle
@@ -24,16 +25,18 @@ public function build(ContainerBuilder $container)
24
25
{
25
26
parent ::build ($ container );
26
27
27
- $ container ->setParameter ('container.build_hash ' , 'test_bundle ' );
28
- $ container ->setParameter ('container.build_time ' , time ());
29
- $ container ->setParameter ('container.build_id ' , 'test_bundle ' );
30
-
31
28
/** @var $extension DependencyInjection\TestExtension */
32
29
$ extension = $ container ->getExtension ('test ' );
33
30
31
+ if (!$ container ->getParameterBag () instanceof FrozenParameterBag) {
32
+ $ container ->setParameter ('container.build_hash ' , 'test_bundle ' );
33
+ $ container ->setParameter ('container.build_time ' , time ());
34
+ $ container ->setParameter ('container.build_id ' , 'test_bundle ' );
35
+ }
36
+
34
37
$ extension ->setCustomConfig (new CustomConfig ());
35
38
36
39
$ container ->addCompilerPass (new AnnotationReaderPass (), PassConfig::TYPE_AFTER_REMOVING );
37
- $ container ->addCompilerPass (new CheckTypeDeclarationsPass (true ), PassConfig::TYPE_AFTER_REMOVING , -100 );
40
+ $ container ->addCompilerPass (new CheckTypeDeclarationsPass (true , [ ' http_client ' , ' .debug.http_client ' ] ), PassConfig::TYPE_AFTER_REMOVING , -100 );
38
41
}
39
42
}
0 commit comments