Skip to content

Commit 488e827

Browse files
committed
chore: move auto-configrations from config file to bundle
Signed-off-by: azjezz <[email protected]>
1 parent acd7726 commit 488e827

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

resources/config/services.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,5 @@
3434

3535
<tag name="kernel.event_listener" event="kernel.controller" method="__invoke" />
3636
</service>
37-
38-
<instanceof id="Psr\Http\Server\RequestHandlerInterface">
39-
<tag name="controller.service_arguments" />
40-
</instanceof>
41-
42-
<instanceof id="Psr\Http\Server\MiddlewareInterface">
43-
<tag name="elissa.middleware" />
44-
</instanceof>
4537
</services>
4638
</container>

src/ElissaBundle.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
namespace Carthage\ElissaBundle;
66

77
use Carthage\ElissaBundle\DependencyInjection\ElissaExtension;
8+
use Psr\Http\Server\MiddlewareInterface;
9+
use Psr\Http\Server\RequestHandlerInterface;
10+
use Symfony\Component\DependencyInjection\ContainerBuilder;
811
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
912
use Symfony\Component\HttpKernel\Bundle\Bundle;
1013

@@ -17,6 +20,18 @@ public function __construct(
1720
) {
1821
}
1922

23+
public function build(ContainerBuilder $container): void
24+
{
25+
parent::build($container);
26+
27+
$container->registerForAutoconfiguration(RequestHandlerInterface::class)
28+
->addTag('controller.service_arguments');
29+
30+
$container->registerForAutoconfiguration(MiddlewareInterface::class)
31+
->addTag('elissa.middleware')
32+
;
33+
}
34+
2035
public function getContainerExtension(): ExtensionInterface
2136
{
2237
return new ElissaExtension($this->alias);

0 commit comments

Comments
 (0)