|
12 | 12 | namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
|
13 | 13 |
|
14 | 14 | use Composer\InstalledVersions;
|
| 15 | +use Doctrine\ORM\Mapping\Entity; |
15 | 16 | use Http\Client\HttpAsyncClient;
|
16 | 17 | use Http\Client\HttpClient;
|
17 | 18 | use phpDocumentor\Reflection\DocBlockFactoryInterface;
|
18 | 19 | use phpDocumentor\Reflection\Types\ContextFactory;
|
19 | 20 | use PhpParser\Parser;
|
20 | 21 | use PHPStan\PhpDocParser\Parser\PhpDocParser;
|
| 22 | +use PHPUnit\Framework\TestCase; |
21 | 23 | use Psr\Cache\CacheItemPoolInterface;
|
22 | 24 | use Psr\Clock\ClockInterface as PsrClockInterface;
|
23 | 25 | use Psr\Container\ContainerInterface as PsrContainerInterface;
|
|
57 | 59 | use Symfony\Component\DependencyInjection\Alias;
|
58 | 60 | use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
|
59 | 61 | use Symfony\Component\DependencyInjection\ChildDefinition;
|
| 62 | +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; |
60 | 63 | use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
|
61 | 64 | use Symfony\Component\DependencyInjection\ContainerBuilder;
|
62 | 65 | use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
99 | 102 | use Symfony\Component\HttpKernel\Controller\ValueResolverInterface;
|
100 | 103 | use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;
|
101 | 104 | use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
| 105 | +use Symfony\Component\HttpKernel\KernelInterface; |
102 | 106 | use Symfony\Component\HttpKernel\Log\DebugLoggerConfigurator;
|
103 | 107 | use Symfony\Component\JsonStreamer\Attribute\JsonStreamable;
|
104 | 108 | use Symfony\Component\JsonStreamer\JsonStreamWriter;
|
|
117 | 121 | use Symfony\Component\Mailer\EventListener\SmimeSignedMessageListener;
|
118 | 122 | use Symfony\Component\Mailer\Mailer;
|
119 | 123 | use Symfony\Component\Mercure\HubRegistry;
|
| 124 | +use Symfony\Component\Messenger\Attribute\AsMessage; |
120 | 125 | use Symfony\Component\Messenger\Attribute\AsMessageHandler;
|
121 | 126 | use Symfony\Component\Messenger\Bridge as MessengerBridge;
|
122 | 127 | use Symfony\Component\Messenger\Handler\BatchHandlerInterface;
|
@@ -757,12 +762,25 @@ static function (ChildDefinition $definition, AsPeriodicTask|AsCronTask $attribu
|
757 | 762 | }
|
758 | 763 | );
|
759 | 764 | }
|
760 |
| - $container->registerAttributeForAutoconfiguration(JsonStreamable::class, static function (ChildDefinition $definition, JsonStreamable $attribute): void { |
761 |
| - $definition->addTag('json_streamer.streamable', [ |
| 765 | + |
| 766 | + $container->registerForAutoconfiguration(CompilerPassInterface::class) |
| 767 | + ->addExcludeTag('container.excluded.compiler_pass'); |
| 768 | + $container->registerForAutoconfiguration(KernelInterface::class) |
| 769 | + ->addExcludeTag('container.excluded.kernel'); |
| 770 | + $container->registerForAutoconfiguration(TestCase::class) |
| 771 | + ->addExcludeTag('container.excluded.test_case'); |
| 772 | + $container->registerAttributeForAutoconfiguration(AsMessage::class, static function (ChildDefinition $definition) { |
| 773 | + $definition->addExcludeTag('container.excluded.messenger.message'); |
| 774 | + }); |
| 775 | + $container->registerAttributeForAutoconfiguration(Entity::class, static function (ChildDefinition $definition) { |
| 776 | + $definition->addExcludeTag('container.excluded.doctrine.entity'); |
| 777 | + }); |
| 778 | + |
| 779 | + $container->registerAttributeForAutoconfiguration(JsonStreamable::class, static function (ChildDefinition $definition, JsonStreamable $attribute) { |
| 780 | + $definition->addExcludeTag('json_streamer.streamable', [ |
762 | 781 | 'object' => $attribute->asObject,
|
763 | 782 | 'list' => $attribute->asList,
|
764 | 783 | ]);
|
765 |
| - $definition->addTag('container.excluded'); |
766 | 784 | });
|
767 | 785 |
|
768 | 786 | if (!$container->getParameter('kernel.debug')) {
|
|
0 commit comments