Skip to content
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 ExceptionListener @final deprecation #2724

Merged
merged 1 commit into from May 14, 2019

Conversation

yceruto
Copy link
Collaborator

@yceruto yceruto commented May 11, 2019

https://travis-ci.org/EasyCorp/EasyAdminBundle/jobs/531004595#L817

  1x: The "Symfony\Component\HttpKernel\EventListener\ExceptionListener" class is considered final since Symfony 4.3. It may change without further notice as of its next major version. You should not extend it from "EasyCorp\Bundle\EasyAdminBundle\EventListener\ExceptionListener".
    1x in ExceptionListenerTest::testCatchBaseExceptions from EasyCorp\Bundle\EasyAdminBundle\Tests\EventListener
  1x: The "EasyCorp\Bundle\EasyAdminBundle\EventListener\ExceptionListener::onKernelException()" method will require a new "string $eventName" argument in the next major version of its parent class "Symfony\Component\HttpKernel\EventListener\ExceptionListener", not defining it is deprecated.
    1x in ExceptionListenerTest::testCatchBaseExceptions from EasyCorp\Bundle\EasyAdminBundle\Tests\EventListener
  1x: The "EasyCorp\Bundle\EasyAdminBundle\EventListener\ExceptionListener::onKernelException()" method will require a new "EventDispatcherInterface $eventDispatcher" argument in the next major version of its parent class "Symfony\Component\HttpKernel\EventListener\ExceptionListener", not defining it is deprecated.
    1x in ExceptionListenerTest::testCatchBaseExceptions from EasyCorp\Bundle\EasyAdminBundle\Tests\EventListener

I'm not sure we should care about BC here (it can be simplified even more)
The injection of a custom controller to this class seems like a rare extreme case; most of the time you should override the @EasyAdmin/default/exception.html.twig template.

@yceruto
Copy link
Collaborator Author

yceruto commented May 11, 2019

require #2723

@javiereguiluz
Copy link
Collaborator

Thanks.

@javiereguiluz javiereguiluz merged commit 35dbf20 into EasyCorp:master May 14, 2019
javiereguiluz added a commit that referenced this pull request May 14, 2019
This PR was merged into the 2.0.x-dev branch.

Discussion
----------

Fix ExceptionListener @Final deprecation

https://travis-ci.org/EasyCorp/EasyAdminBundle/jobs/531004595#L817
```bash
  1x: The "Symfony\Component\HttpKernel\EventListener\ExceptionListener" class is considered final since Symfony 4.3. It may change without further notice as of its next major version. You should not extend it from "EasyCorp\Bundle\EasyAdminBundle\EventListener\ExceptionListener".
    1x in ExceptionListenerTest::testCatchBaseExceptions from EasyCorp\Bundle\EasyAdminBundle\Tests\EventListener
  1x: The "EasyCorp\Bundle\EasyAdminBundle\EventListener\ExceptionListener::onKernelException()" method will require a new "string $eventName" argument in the next major version of its parent class "Symfony\Component\HttpKernel\EventListener\ExceptionListener", not defining it is deprecated.
    1x in ExceptionListenerTest::testCatchBaseExceptions from EasyCorp\Bundle\EasyAdminBundle\Tests\EventListener
  1x: The "EasyCorp\Bundle\EasyAdminBundle\EventListener\ExceptionListener::onKernelException()" method will require a new "EventDispatcherInterface $eventDispatcher" argument in the next major version of its parent class "Symfony\Component\HttpKernel\EventListener\ExceptionListener", not defining it is deprecated.
    1x in ExceptionListenerTest::testCatchBaseExceptions from EasyCorp\Bundle\EasyAdminBundle\Tests\EventListener
```
I'm not sure we should care about BC here (it can be simplified even more)
The injection of a custom controller to this class seems like a rare extreme case; most of the time you should override the `@EasyAdmin/default/exception.html.twig` template.

Commits
-------

35dbf20 Fix ExceptionListener final deprecation
@yceruto yceruto deleted the fix_final_deprecation branch May 14, 2019 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants