for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace NamespaceProtector\Event;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\EventDispatcher\ListenerProviderInterface;
final class EventDispatcher implements EventDispatcherInterface
{
public function __construct(private ListenerProviderInterface $listenerProvider)
}
public function dispatch(object $event)
$this->listenerProvider->getListenersForEvent($event);
/** @var array<callable> */
$listeners = $this->listenerProvider->getListenersForEvent($event);
array_map(
function (callable $listener) use ($event): void {
$listener($event);
},
$listeners
iterable
array
$array
array_map()
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
ignore-type
/** @scrutinizer ignore-type */ $listeners
);
return $event;