-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathUnleashClientBundle.php
34 lines (30 loc) · 1.29 KB
/
UnleashClientBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace Unleash\Client\Bundle;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Unleash\Client\Bootstrap\BootstrapProvider;
use Unleash\Client\Bundle\DependencyInjection\Compiler\BootstrapResolver;
use Unleash\Client\Bundle\DependencyInjection\Compiler\CacheServiceResolverCompilerPass;
use Unleash\Client\Bundle\DependencyInjection\Compiler\HttpServicesResolverCompilerPass;
use Unleash\Client\Strategy\StrategyHandler;
final class UnleashClientBundle extends Bundle
{
public function build(ContainerBuilder $container): void
{
$container->registerForAutoconfiguration(StrategyHandler::class)
->addTag('unleash.client.strategy_handler');
$container->registerForAutoconfiguration(BootstrapProvider::class)
->addTag('unleash.client.bootstrap_provider');
$container->addCompilerPass(
new HttpServicesResolverCompilerPass(),
PassConfig::TYPE_BEFORE_OPTIMIZATION,
-100_000
);
$container->addCompilerPass(
new CacheServiceResolverCompilerPass(),
PassConfig::TYPE_OPTIMIZE
);
$container->addCompilerPass(new BootstrapResolver());
}
}