FOSElasticaBundle icon indicating copy to clipboard operation
FOSElasticaBundle copied to clipboard

Deprecation Symfony 6.2 - AsyncPersistPageHandler

Open youlead-bow opened this issue 2 years ago • 3 comments

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.

youlead-bow avatar Aug 09 '23 07:08 youlead-bow

Just use attribute #[AsMessageHandler] and remove implements MessageHandlerInterface

boskos-q avatar Aug 18 '23 14:08 boskos-q

@boskos-q I think the code that generates the deprecation lives within this bundle (src/Message/Handler/AsyncPersistPageHandler.php), not in the app.

Lustmored avatar Dec 11 '23 14:12 Lustmored

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

youlead-bow avatar Jan 04 '24 08:01 youlead-bow