-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMiddlewareBundle.php
More file actions
36 lines (31 loc) · 1.24 KB
/
MiddlewareBundle.php
File metadata and controls
36 lines (31 loc) · 1.24 KB
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
35
36
<?php
declare(strict_types=1);
namespace Prokl\SymfonyMiddlewareBundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Prokl\SymfonyMiddlewareBundle\DependencyInjection\CompilerPass\ControllerMiddlewarePass;
use Prokl\SymfonyMiddlewareBundle\DependencyInjection\CompilerPass\GlobalMiddlewarePass;
use Prokl\SymfonyMiddlewareBundle\DependencyInjection\CompilerPass\RouteMiddlewarePass;
use Prokl\SymfonyMiddlewareBundle\Middleware\MiddlewareEnum;
/**
* Class MiddlewareBundle
* @package Prokl\SymfonyMiddlewareBundle
*
* @see https://github.com/zholus/symfony-middleware-bundle
*/
class MiddlewareBundle extends Bundle
{
/**
* @inheritDoc
*/
public function build(ContainerBuilder $container): void
{
$container->registerForAutoconfiguration(MiddlewareInterface::class)
->addTag(MiddlewareEnum::ALIAS_SUFFIX);
$container->registerForAutoconfiguration(GlobalMiddlewareInterface::class)
->addTag(MiddlewareEnum::GLOBAL_TAG);
$container->addCompilerPass(new GlobalMiddlewarePass());
$container->addCompilerPass(new ControllerMiddlewarePass());
$container->addCompilerPass(new RouteMiddlewarePass());
}
}