-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Symfony 6.2 deprecation #303
Conversation
Maybe we should add |
Edit: oh because ecd355f was not released yet.. Also I saw another two deprecation logs but they says the same:
|
Apparently it's not necessary: https://symfony.com/doc/current/messenger.html#manually-configuring-handlers <service id="App\MessageHandler\SmsNotificationHandler">
<!-- handles is only needed if it can't be guessed by type-hint -->
<tag name="messenger.message_handler"
handles="App\Message\SmsNotification"/>
</service> but if they have it I don't know why 🤷♂️ |
When it is declared Symfony does not need to guess what this handler handles, so imho from perf side it would be better even it's unnoticeable |
There is no need then to remove the interface 👍 |
This comment was marked as duplicate.
This comment was marked as duplicate.
Could this get merged? 😊 |
Will fix #307 |
I will take some time to see if something more is required for us to release it, but trying to do it ASAP |
The deprecation about if (Kernel::VERSION_ID >= 60200) {
class DumpSitemapMessageHandler {}
} else {
class DumpSitemapMessageHandler implements MessageHandlerInterface {}
} to avoid triggering it. or check if we need to implement it at all. |
Here we go again with these ugly solutions ^^ |
I leaning to think that |
When using the bundle with Symfony 6.2 there is this deprecation warning:
The "Presta\SitemapBundle\Messenger\DumpSitemapMessageHandler" class implements "Symfony\Component\Messenger\Handler\MessageHandlerInterface" that is deprecated since Symfony 6.2, use the {@see AsMessageHandler} attribute instead.
AFAIK the
MessageHandlerInterface
is just a marker to tell Symfony to autoconfigure the class, but since it's already defined and configured inPrestaSitemapBundle/config/messenger.xml
Lines 7 to 12 in 61e6c07
I think the interface is not necessary.
Technically this is a BC break, but I guess this class is not meant to be extended by the user.Update: Following #303 (comment), it is resolved by adding
handles="Presta\SitemapBundle\Messenger\DumpSitemapMessage"
, there is no need to remove the interface for now.