Skip to content

MessageSubscriberInterface deprecated in Symfony 6.2 and removed in 7 #3

@mgrundkoetter

Description

@mgrundkoetter

In the HandlersLocatorFactory class, there is code which will cause an exception in Symfony 7+:

$messageHandlerClasses = $this->reflectionService
    ->getAllImplementationClassNamesForInterface(MessageSubscriberInterface::class);

foreach ($messageHandlerClasses as $messageHandlerClass) {
    foreach ($messageHandlerClass::getHandledMessages() as $messageName => $config) {
        if (! \is_array($config)) {
            throw new \InvalidArgumentException(
                'different from doctrine, we (currently) need subscribers to always have an option array'
            );
        }
        if (isset($config['bus']) && $config['bus'] !== $busName) {
            continue;
        }
        $handlerDescriptors[$messageName][] = new HandlerDescriptor(
            $this->objectManager->get($messageHandlerClass),
            $config
        );
    }
}

It can just be removed completely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions