Closed
Description
Symfony version(s) affected: 5.0.x
Description
we are in the process of migrating from 4.4 to 5.0
however some of the registered event listeners, don't return a priorty - aka null
this happens around here:
as the $this->listeners[$eventName]
is nested one more times.
it results in a final exception:
due to https://sourcegraph.com/github.com/symfony/symfony@20bf17f6ad38011f90cfe9b2dc7c30c8901163e5/-/blob/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php#L55 - beeing type hinted with int
introduced with: 2bc9472
my event definition:
services:
krn.demo:
class: App\EventSubscriber\Demo
public: false
shared: false
tags:
- { name: kernel.event_listener, event: krn.demo, method: onEvent }
How to reproduce
clone: https://github.com/hjanuschka/demo
composer install
bin/console debug:event-dispatcher krn.demo
where it should show 0
Possible Solution
return 0;
instead of return null
in getListenerPriority
PR: #35260
any help?