diff --git a/docs/bundle/config_reference.md b/docs/bundle/config_reference.md index 579bc72b6..e12be7b4a 100644 --- a/docs/bundle/config_reference.md +++ b/docs/bundle/config_reference.md @@ -57,6 +57,7 @@ enqueue: # The factory service should be a class that implements "Enqueue\Monitoring\StatsStorageFactory" interface storage_factory_class: ~ + job: false async_commands: enabled: false extensions: diff --git a/pkg/enqueue-bundle/DependencyInjection/Configuration.php b/pkg/enqueue-bundle/DependencyInjection/Configuration.php index 260a50e9e..d7b3ba3a1 100644 --- a/pkg/enqueue-bundle/DependencyInjection/Configuration.php +++ b/pkg/enqueue-bundle/DependencyInjection/Configuration.php @@ -3,6 +3,8 @@ namespace Enqueue\Bundle\DependencyInjection; use Enqueue\AsyncCommand\RunCommandProcessor; +use Enqueue\AsyncEventDispatcher\DependencyInjection\AsyncEventDispatcherExtension; +use Enqueue\JobQueue\Job; use Enqueue\Monitoring\Symfony\DependencyInjection\MonitoringFactory; use Enqueue\Symfony\Client\DependencyInjection\ClientFactory; use Enqueue\Symfony\DependencyInjection\TransportFactory; @@ -35,6 +37,8 @@ public function getConfigTreeBuilder(): TreeBuilder ->append(ClientFactory::getConfiguration($this->debug)) ->append($this->getMonitoringConfiguration()) ->append($this->getAsyncCommandsConfiguration()) + ->append($this->getJobConfiguration()) + ->append($this->getAsyncEventsConfiguration()) ->arrayNode('extensions')->addDefaultsIfNotSet()->children() ->booleanNode('doctrine_ping_connection_extension')->defaultFalse()->end() ->booleanNode('doctrine_clear_identity_map_extension')->defaultFalse()->end() @@ -45,14 +49,6 @@ public function getConfigTreeBuilder(): TreeBuilder ->end() ; -// $rootNode->children() -// ->booleanNode('job')->defaultFalse()->end() -// ->arrayNode('async_events') -// ->addDefaultsIfNotSet() -// ->canBeEnabled() -// ->end() -// ; - return $tb; } @@ -76,4 +72,28 @@ private function getAsyncCommandsConfiguration(): ArrayNodeDefinition ->canBeEnabled() ; } + + private function getJobConfiguration(): ArrayNodeDefinition + { + if (false === class_exists(Job::class)) { + return MissingComponentFactory::getConfiguration('job', ['enqueue/job-queue']); + } + + return (new ArrayNodeDefinition('job')) + ->addDefaultsIfNotSet() + ->canBeEnabled() + ; + } + + private function getAsyncEventsConfiguration(): ArrayNodeDefinition + { + if (false == class_exists(AsyncEventDispatcherExtension::class)) { + return MissingComponentFactory::getConfiguration('async_events', ['enqueue/async-event-dispatcher']); + } + + return (new ArrayNodeDefinition('async_events')) + ->addDefaultsIfNotSet() + ->canBeEnabled() + ; + } } diff --git a/pkg/enqueue-bundle/DependencyInjection/EnqueueExtension.php b/pkg/enqueue-bundle/DependencyInjection/EnqueueExtension.php index 81c356688..043039fa9 100644 --- a/pkg/enqueue-bundle/DependencyInjection/EnqueueExtension.php +++ b/pkg/enqueue-bundle/DependencyInjection/EnqueueExtension.php @@ -16,6 +16,7 @@ use Enqueue\Symfony\Client\DependencyInjection\ClientFactory; use Enqueue\Symfony\DependencyInjection\TransportFactory; use Enqueue\Symfony\DiUtils; +use Interop\Queue\Context; use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -35,7 +36,7 @@ public function load(array $configs, ContainerBuilder $container): void // find default configuration $defaultName = null; - foreach ($config as $name => $configs) { + foreach ($config as $name => $modules) { // set first as default if (null === $defaultName) { $defaultName = $name; @@ -49,40 +50,65 @@ public function load(array $configs, ContainerBuilder $container): void $transportNames = []; $clientNames = []; - foreach ($config as $name => $configs) { + foreach ($config as $name => $modules) { // transport & consumption $transportNames[] = $name; - $transportFactory = (new TransportFactory($name)); - $transportFactory->buildConnectionFactory($container, $configs['transport']); + $transportFactory = (new TransportFactory($name, $defaultName === $name)); + $transportFactory->buildConnectionFactory($container, $modules['transport']); $transportFactory->buildContext($container, []); - $transportFactory->buildQueueConsumer($container, $configs['consumption']); + $transportFactory->buildQueueConsumer($container, $modules['consumption']); $transportFactory->buildRpcClient($container, []); // client - if (isset($configs['client'])) { + if (isset($modules['client'])) { $clientNames[] = $name; - $clientConfig = $configs['client']; + $clientConfig = $modules['client']; // todo - $clientConfig['transport'] = $configs['transport']; - $clientConfig['consumption'] = $configs['consumption']; + $clientConfig['transport'] = $modules['transport']; + $clientConfig['consumption'] = $modules['consumption']; - $clientFactory = new ClientFactory($name); - $clientFactory->build($container, $clientConfig, $defaultName === $name); - $clientFactory->createDriver($container, $configs['transport']); + $clientFactory = new ClientFactory($name, $defaultName === $name); + $clientFactory->build($container, $clientConfig); + $clientFactory->createDriver($container, $modules['transport']); $clientFactory->createFlushSpoolProducerListener($container); } // monitoring - if (isset($configs['monitoring'])) { + if (isset($modules['monitoring'])) { $monitoringFactory = new MonitoringFactory($name); - $monitoringFactory->buildStorage($container, $configs['monitoring']); - $monitoringFactory->buildConsumerExtension($container, $configs['monitoring']); + $monitoringFactory->buildStorage($container, $modules['monitoring']); + $monitoringFactory->buildConsumerExtension($container, $modules['monitoring']); + + if (isset($modules['client'])) { + $monitoringFactory->buildClientExtension($container, $modules['monitoring']); + } + } + + // job-queue + if (false == empty($modules['job']['enabled'])) { + if (false === isset($modules['client'])) { + throw new \LogicException('Client is required for job-queue.'); + } - if (isset($configs['client'])) { - $monitoringFactory->buildClientExtension($container, $configs['monitoring']); + if ($name !== $defaultName) { + throw new \LogicException('Job-queue supports only default configuration.'); } + + $loader->load('job.yml'); + } + + // async events + if (false == empty($modules['async_events']['enabled'])) { + if ($name !== $defaultName) { + throw new \LogicException('Async events supports only default configuration.'); + } + + $extension = new AsyncEventDispatcherExtension(); + $extension->load([[ + 'context_service' => Context::class, + ]], $container); } } @@ -112,25 +138,6 @@ public function load(array $configs, ContainerBuilder $container): void $this->loadDoctrineClearIdentityMapExtension($config, $container); $this->loadSignalExtension($config, $container); $this->loadReplyExtension($config, $container); - -// if ($config['job']) { -// if (!class_exists(Job::class)) { -// throw new \LogicException('Seems "enqueue/job-queue" is not installed. Please fix this issue.'); -// } -// -// $loader->load('job.yml'); -// } -// -// if ($config['async_events']['enabled']) { -// if (false == class_exists(AsyncEventDispatcherExtension::class)) { -// throw new \LogicException('The "enqueue/async-event-dispatcher" package has to be installed.'); -// } -// -// $extension = new AsyncEventDispatcherExtension(); -// $extension->load([[ -// 'context_service' => 'enqueue.transport.default.context', -// ]], $container); -// } } public function getConfiguration(array $config, ContainerBuilder $container): Configuration diff --git a/pkg/enqueue-bundle/Resources/config/job.yml b/pkg/enqueue-bundle/Resources/config/job.yml index 2f55f3f70..0a368aebc 100644 --- a/pkg/enqueue-bundle/Resources/config/job.yml +++ b/pkg/enqueue-bundle/Resources/config/job.yml @@ -20,7 +20,7 @@ services: public: true arguments: - '@Enqueue\JobQueue\Doctrine\JobStorage' - - '@enqueue.client.default.producer' + - '@Enqueue\Client\ProducerInterface' # Deprecated. To be removed in 0.10. enqueue.job.processor: @@ -55,7 +55,7 @@ services: arguments: - '@Enqueue\JobQueue\Doctrine\JobStorage' - '@Enqueue\JobQueue\CalculateRootJobStatusService' - - '@enqueue.client.default.producer' + - '@Enqueue\Client\ProducerInterface' - '@logger' tags: - { name: 'enqueue.command_subscriber', client: 'default' } @@ -70,7 +70,7 @@ services: public: true arguments: - '@Enqueue\JobQueue\Doctrine\JobStorage' - - '@enqueue.client.default.producer' + - '@Enqueue\Client\ProducerInterface' - '@logger' tags: - { name: 'enqueue.topic_subscriber', client: 'default' } diff --git a/pkg/enqueue-bundle/Tests/Functional/App/config/config.yml b/pkg/enqueue-bundle/Tests/Functional/App/config/config.yml index 8a99208cb..718990333 100644 --- a/pkg/enqueue-bundle/Tests/Functional/App/config/config.yml +++ b/pkg/enqueue-bundle/Tests/Functional/App/config/config.yml @@ -26,9 +26,9 @@ enqueue: transport: 'null:' client: traceable_producer: true + job: true + async_events: true async_commands: true -# job: true -# async_commands: true services: test_enqueue.client.default.traceable_producer: @@ -115,7 +115,7 @@ services: - {name: 'enqueue.event_transformer', eventName: 'test_async_subscriber', transformerName: 'test_async' } # overwrite async listener with one based on client producer. so we can use traceable producer. -# enqueue.events.async_listener: -# class: 'Enqueue\Bundle\Tests\Functional\App\AsyncListener' -# public: true -# arguments: ['@enqueue.client.default.producer', '@enqueue.events.registry'] \ No newline at end of file + enqueue.events.async_listener: + class: 'Enqueue\Bundle\Tests\Functional\App\AsyncListener' + public: true + arguments: ['@enqueue.client.default.producer', '@enqueue.events.registry'] \ No newline at end of file diff --git a/pkg/enqueue-bundle/Tests/Functional/Events/AsyncListenerTest.php b/pkg/enqueue-bundle/Tests/Functional/Events/AsyncListenerTest.php index 8436181b1..6e952ab28 100644 --- a/pkg/enqueue-bundle/Tests/Functional/Events/AsyncListenerTest.php +++ b/pkg/enqueue-bundle/Tests/Functional/Events/AsyncListenerTest.php @@ -18,8 +18,6 @@ class AsyncListenerTest extends WebTestCase { public function setUp() { - $this->markTestSkipped('Configuration for async_events is not yet ready'); - parent::setUp(); /** @var AsyncListener $asyncListener */ diff --git a/pkg/enqueue-bundle/Tests/Functional/Events/AsyncProcessorTest.php b/pkg/enqueue-bundle/Tests/Functional/Events/AsyncProcessorTest.php index 75ed3ad73..101e5ecec 100644 --- a/pkg/enqueue-bundle/Tests/Functional/Events/AsyncProcessorTest.php +++ b/pkg/enqueue-bundle/Tests/Functional/Events/AsyncProcessorTest.php @@ -20,8 +20,6 @@ class AsyncProcessorTest extends WebTestCase { public function setUp() { - $this->markTestSkipped('Configuration for async_events is not yet ready'); - parent::setUp(); /** @var AsyncListener $asyncListener */ diff --git a/pkg/enqueue-bundle/Tests/Functional/Events/AsyncSubscriberTest.php b/pkg/enqueue-bundle/Tests/Functional/Events/AsyncSubscriberTest.php index 081da0734..6e00eafca 100644 --- a/pkg/enqueue-bundle/Tests/Functional/Events/AsyncSubscriberTest.php +++ b/pkg/enqueue-bundle/Tests/Functional/Events/AsyncSubscriberTest.php @@ -18,8 +18,6 @@ class AsyncSubscriberTest extends WebTestCase { public function setUp() { - $this->markTestSkipped('Configuration for async_events is not yet ready'); - parent::setUp(); /** @var AsyncListener $asyncListener */ diff --git a/pkg/enqueue-bundle/Tests/Functional/Job/CalculateRootJobStatusProcessorTest.php b/pkg/enqueue-bundle/Tests/Functional/Job/CalculateRootJobStatusProcessorTest.php index 0749b8354..01346ad8c 100644 --- a/pkg/enqueue-bundle/Tests/Functional/Job/CalculateRootJobStatusProcessorTest.php +++ b/pkg/enqueue-bundle/Tests/Functional/Job/CalculateRootJobStatusProcessorTest.php @@ -12,8 +12,6 @@ class CalculateRootJobStatusProcessorTest extends WebTestCase { public function testCouldBeConstructedByContainer() { - $this->markTestSkipped('Configuration for jobs is not yet ready'); - $instance = static::$container->get(CalculateRootJobStatusProcessor::class); $this->assertInstanceOf(CalculateRootJobStatusProcessor::class, $instance); diff --git a/pkg/enqueue-bundle/Tests/Functional/Job/DependentJobServiceTest.php b/pkg/enqueue-bundle/Tests/Functional/Job/DependentJobServiceTest.php index adee418ec..1aec06410 100644 --- a/pkg/enqueue-bundle/Tests/Functional/Job/DependentJobServiceTest.php +++ b/pkg/enqueue-bundle/Tests/Functional/Job/DependentJobServiceTest.php @@ -12,8 +12,6 @@ class DependentJobServiceTest extends WebTestCase { public function testCouldBeConstructedByContainer() { - $this->markTestSkipped('Configuration for jobs is not yet ready'); - $instance = static::$container->get(DependentJobService::class); $this->assertInstanceOf(DependentJobService::class, $instance); diff --git a/pkg/enqueue-bundle/Tests/Functional/Job/JobRunnerTest.php b/pkg/enqueue-bundle/Tests/Functional/Job/JobRunnerTest.php index c27b48218..4aa647f77 100644 --- a/pkg/enqueue-bundle/Tests/Functional/Job/JobRunnerTest.php +++ b/pkg/enqueue-bundle/Tests/Functional/Job/JobRunnerTest.php @@ -12,8 +12,6 @@ class JobRunnerTest extends WebTestCase { public function testCouldBeConstructedByContainer() { - $this->markTestSkipped('Configuration for jobs is not yet ready'); - $instance = static::$container->get(JobRunner::class); $this->assertInstanceOf(JobRunner::class, $instance); diff --git a/pkg/enqueue-bundle/Tests/Functional/Job/JobStorageTest.php b/pkg/enqueue-bundle/Tests/Functional/Job/JobStorageTest.php index 4d4a83316..650326ad8 100644 --- a/pkg/enqueue-bundle/Tests/Functional/Job/JobStorageTest.php +++ b/pkg/enqueue-bundle/Tests/Functional/Job/JobStorageTest.php @@ -12,8 +12,6 @@ class JobStorageTest extends WebTestCase { public function testCouldGetJobStorageAsServiceFromContainer() { - $this->markTestSkipped('Configuration for jobs is not yet ready'); - $instance = static::$container->get(JobStorage::class); $this->assertInstanceOf(JobStorage::class, $instance); diff --git a/pkg/enqueue-bundle/Tests/Functional/RoutesCommandTest.php b/pkg/enqueue-bundle/Tests/Functional/RoutesCommandTest.php index 914d771e7..afefe6482 100644 --- a/pkg/enqueue-bundle/Tests/Functional/RoutesCommandTest.php +++ b/pkg/enqueue-bundle/Tests/Functional/RoutesCommandTest.php @@ -26,16 +26,13 @@ public function testShouldDisplayRegisteredTopics() $tester->execute([]); $expected = <<<'OUTPUT' -| topic | theTopic | default (prefixed) | test_topic_subscriber_processor | (hidden) | +| topic | theTopic | default (prefixed) | test_topic_subscriber_processor | (hidden) | OUTPUT; $this->assertSame(0, $tester->getStatusCode()); $this->assertContains($expected, $tester->getDisplay()); } - /** - * @group testit - */ public function testShouldDisplayCommands() { /** @var RoutesCommand $command */ @@ -45,7 +42,7 @@ public function testShouldDisplayCommands() $tester->execute([]); $expected = <<<'OUTPUT' -| command | theCommand | default (prefixed) | test_command_subscriber_processor | (hidden) | +| command | theCommand | default (prefixed) | test_command_subscriber_processor | (hidden) | OUTPUT; $this->assertSame(0, $tester->getStatusCode()); diff --git a/pkg/enqueue-bundle/Tests/Unit/DependencyInjection/ConfigurationTest.php b/pkg/enqueue-bundle/Tests/Unit/DependencyInjection/ConfigurationTest.php index b735bda14..0c41fdcb3 100644 --- a/pkg/enqueue-bundle/Tests/Unit/DependencyInjection/ConfigurationTest.php +++ b/pkg/enqueue-bundle/Tests/Unit/DependencyInjection/ConfigurationTest.php @@ -160,34 +160,40 @@ public function testShouldThrowExceptionIfDefaultProcessorQueueIsEmpty() public function testJobShouldBeDisabledByDefault() { - $this->markTestSkipped('Configuration for jobs is not yet ready'); - $configuration = new Configuration(true); $processor = new Processor(); $config = $processor->processConfiguration($configuration, [[ - 'transport' => [], + 'default' => [ + 'transport' => [], + ], ]]); $this->assertArraySubset([ - 'job' => false, + 'default' => [ + 'job' => [ + 'enabled' => false, + ], + ], ], $config); } public function testCouldEnableJob() { - $this->markTestSkipped('Configuration for jobs is not yet ready'); - $configuration = new Configuration(true); $processor = new Processor(); $config = $processor->processConfiguration($configuration, [[ - 'transport' => [], - 'job' => true, + 'default' => [ + 'transport' => [], + 'job' => true, + ], ]]); $this->assertArraySubset([ - 'job' => true, + 'default' => [ + 'job' => true, + ], ], $config); } @@ -367,51 +373,59 @@ public function testReplyExtensionCouldBeDisabled() public function testShouldDisableAsyncEventsByDefault() { - $this->markTestSkipped('Configuration for async_events is not yet ready'); - $configuration = new Configuration(true); $processor = new Processor(); $config = $processor->processConfiguration($configuration, [[ - 'transport' => [], + 'default' => [ + 'transport' => [], + ], ]]); $this->assertArraySubset([ - 'async_events' => [ - 'enabled' => false, + 'default' => [ + 'async_events' => [ + 'enabled' => false, + ], ], ], $config); } public function testShouldAllowEnableAsyncEvents() { - $this->markTestSkipped('Configuration for async_events is not yet ready'); - $configuration = new Configuration(true); $processor = new Processor(); $config = $processor->processConfiguration($configuration, [[ - 'transport' => [], - 'async_events' => true, + 'default' => [ + 'transport' => [], + 'async_events' => true, + ], ]]); $this->assertArraySubset([ - 'async_events' => [ - 'enabled' => true, + 'default' => [ + 'async_events' => [ + 'enabled' => true, + ], ], ], $config); $config = $processor->processConfiguration($configuration, [[ - 'transport' => [], - 'async_events' => [ - 'enabled' => true, + 'default' => [ + 'transport' => [], + 'async_events' => [ + 'enabled' => true, + ], ], ]]); $this->assertArraySubset([ - 'async_events' => [ - 'enabled' => true, + 'default' => [ + 'async_events' => [ + 'enabled' => true, + ], ], ], $config); } diff --git a/pkg/enqueue-bundle/Tests/Unit/DependencyInjection/EnqueueExtensionTest.php b/pkg/enqueue-bundle/Tests/Unit/DependencyInjection/EnqueueExtensionTest.php index 9fd7c2e98..b17d6a949 100644 --- a/pkg/enqueue-bundle/Tests/Unit/DependencyInjection/EnqueueExtensionTest.php +++ b/pkg/enqueue-bundle/Tests/Unit/DependencyInjection/EnqueueExtensionTest.php @@ -255,31 +255,49 @@ public function testShouldNotLoadDelayRedeliveredMessageExtensionIfRedeliveredDe public function testShouldLoadJobServicesIfEnabled() { - $this->markTestSkipped('Configuration for jobs is not yet ready'); - $container = $this->getContainerBuilder(true); $extension = new EnqueueExtension(); $extension->load([[ - 'transport' => [], - 'job' => true, + 'default' => [ + 'transport' => [], + 'client' => null, + 'job' => true, + ], ]], $container); self::assertTrue($container->hasDefinition(JobRunner::class)); } - public function testShouldNotLoadJobServicesIfDisabled() + public function testShouldThrowExceptionIfClientIsNotEnabledOnJobLoad() { - $this->markTestSkipped('Configuration for jobs is not yet ready'); + $this->expectException(\LogicException::class); + $this->expectExceptionMessage('Client is required for job-queue.'); + + $container = $this->getContainerBuilder(true); + + $extension = new EnqueueExtension(); + + $extension->load([[ + 'default' => [ + 'transport' => [], + 'job' => true, + ], + ]], $container); + } + public function testShouldNotLoadJobServicesIfDisabled() + { $container = $this->getContainerBuilder(true); $extension = new EnqueueExtension(); $extension->load([[ - 'transport' => [], - 'job' => false, + 'default' => [ + 'transport' => [], + 'job' => false, + ], ]], $container); self::assertFalse($container->hasDefinition(JobRunner::class)); diff --git a/pkg/enqueue/Symfony/Client/DependencyInjection/ClientFactory.php b/pkg/enqueue/Symfony/Client/DependencyInjection/ClientFactory.php index 9a2392d54..47d8e8ee5 100644 --- a/pkg/enqueue/Symfony/Client/DependencyInjection/ClientFactory.php +++ b/pkg/enqueue/Symfony/Client/DependencyInjection/ClientFactory.php @@ -41,13 +41,19 @@ final class ClientFactory */ private $name; - public function __construct(string $name) + /** + * @var bool + */ + private $default; + + public function __construct(string $name, bool $default = false) { if (empty($name)) { throw new \InvalidArgumentException('The name could not be empty.'); } $this->name = $name; + $this->default = $default; } public static function getConfiguration(bool $debug, string $name = 'client'): NodeDefinition @@ -69,7 +75,7 @@ public static function getConfiguration(bool $debug, string $name = 'client'): N return $builder; } - public function build(ContainerBuilder $container, array $config, bool $default = false): void + public function build(ContainerBuilder $container, array $config): void { $container->register($this->format('context'), Context::class) ->setFactory([$this->reference('driver'), 'getContext']) @@ -176,7 +182,7 @@ public function build(ContainerBuilder $container, array $config, bool $default ->addTag('enqueue.consumption_extension', ['priority' => 10, 'client' => $this->name]) ; - $container->getDefinition('enqueue.client.default.delay_redelivered_message_extension') + $container->getDefinition($this->format('delay_redelivered_message_extension')) ->replaceArgument(1, $config['redelivered_delay_time']) ; } @@ -192,7 +198,7 @@ public function build(ContainerBuilder $container, array $config, bool $default ])); } - if ($default) { + if ($this->default) { $container->setAlias(ProducerInterface::class, $this->format('producer')); $container->setAlias(SpoolProducer::class, $this->format('spool_producer')); } diff --git a/pkg/enqueue/Symfony/DependencyInjection/TransportFactory.php b/pkg/enqueue/Symfony/DependencyInjection/TransportFactory.php index 5d98d3f8d..eb9454b3a 100644 --- a/pkg/enqueue/Symfony/DependencyInjection/TransportFactory.php +++ b/pkg/enqueue/Symfony/DependencyInjection/TransportFactory.php @@ -32,13 +32,19 @@ final class TransportFactory */ private $name; - public function __construct(string $name) + /** + * @var bool + */ + private $default; + + public function __construct(string $name, bool $default = false) { if (empty($name)) { throw new \InvalidArgumentException('The name could not be empty.'); } $this->name = $name; + $this->default = $default; } public static function getConfiguration(string $name = 'transport'): NodeDefinition @@ -149,7 +155,7 @@ public function buildConnectionFactory(ContainerBuilder $container, array $confi ; } - if ('default' === $this->name) { + if ($this->default) { $container->setAlias(ConnectionFactory::class, $this->format('connection_factory')); } } @@ -167,7 +173,7 @@ public function buildContext(ContainerBuilder $container, array $config): void $this->addServiceToLocator($container, 'context'); - if ('default' === $this->name) { + if ($this->default) { $container->setAlias(Context::class, $this->format('context')); } } @@ -201,7 +207,7 @@ public function buildQueueConsumer(ContainerBuilder $container, array $config): $this->addServiceToLocator($container, 'queue_consumer'); $this->addServiceToLocator($container, 'processor_registry'); - if ('default' === $this->name) { + if ($this->default) { $container->setAlias(QueueConsumerInterface::class, $this->format('queue_consumer')); } } @@ -220,7 +226,7 @@ public function buildRpcClient(ContainerBuilder $container, array $config): void ->addArgument(new Reference($this->format('rpc_factory'))) ; - if ('default' === $this->name) { + if ($this->default) { $container->setAlias(RpcClient::class, $this->format('rpc_client')); } }