Symfony Deprecated : Return type of Knp

153 Views Asked by At

When switching to prod mode in .env (with DEBUG=0), I have this error :

Error picture

I can't neither solve it nor remove it. I'm in version 5.3.16 for Symfony, 8.1.3 for php and in composer.json I have: knplabs/knp-paginator-bundle": "v5.8.0"

Can anyone help me?

1

There are 1 best solutions below

0
IndyDevGuy On

Unfortunately the deprecation notices you see are from the third party KNP bundle you are using. The only true way to make these permanently go away (without any tricks) is for the code to be updated.

You should at least be able to suppress these notices with PHP error_reporting or like you mentioned with logs.

You could fork their repo on github, fix the code and then create a merge request.

Hope this helps!