FOSElasticaBundle
FOSElasticaBundle copied to clipboard
Deprecation Symfony 6.2 - AsyncPersistPageHandler
In my project in Symfony 6, I have had this deprecation for some time:
The "FOS\ElasticaBundle\Message\Handler\AsyncPersistPageHandler" class implements "Symfony\Component\Messenger\Handler\MessageHandlerInterface" that is deprecated since Symfony 6.2, use the {@see AsMessageHandler} attribute instead.
Just use attribute #[AsMessageHandler] and remove implements MessageHandlerInterface
@boskos-q I think the code that generates the deprecation lives within this bundle (src/Message/Handler/AsyncPersistPageHandler.php), not in the app.
Yes the deprecation comes from the bundle, you simply have to replace the line in class AsyncPersistPageHandler:
class AsyncPersistPageHandler implements MessageHandlerInterface
by:
#[AsMessageHandler]
class AsyncPersistPageHandler