- Issue created by @dpi
- Status changed to Closed: duplicate
7 months ago 6:52am 10 May 2024 - 🇮🇹Italy lussoluca Italy
A working patch has been committed in 📌 Use service decorators Needs review
With D11 / D10.3
While testing ✨ Add support for WebProfiler Needs work .
Return type
Fatal error: Declaration of Drupal\tracer\EventDispatcher\TraceableEventDispatcher::addListener($event_name, $listener, $priority = 0) must be compatible with Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::addListener($event_name, $listener, $priority = 0): void in /data/app/modules/contrib/tracer/src/EventDispatcher/TraceableEventDispatcher.php on line 62
PHP fatal: \Drupal\tracer\EventDispatcher\TraceableEventDispatcher::addListener
needs to add a return type since
📌
[11.x] Add void returns for Symfony 7
RTBC
Service class replaced
\Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher
is replaced by \Symfony\Component\EventDispatcher\EventDispatcher
. Since
📌
Replace ContainerAwareEventDispatcher with Symfony EventDispatcher
Fixed
So this service needs to extend, or if possible decorate the original instead. So it always has the correct arguments.
Dependency injection (may ignore per above)
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Drupal\tracer\EventDispatcher\TraceableEventDispatcher::__construct(), 0 passed in /data/app/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and at least 1 expected in /data/app/modules/contrib/tracer/src/EventDispatcher/TraceableEventDispatcher.php:49
The core service event_dispatcher
no longer has any arguments, since
📌
Replace ContainerAwareEventDispatcher with Symfony EventDispatcher
Fixed
Closed: duplicate
1.0
Code
A working patch has been committed in 📌 Use service decorators Needs review