for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace BrainExe\Core\EventDispatcher;
use BrainExe\Core\Annotations\Listen;
use BrainExe\Core\Annotations\Service;
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
/**
* @Service
*/
class DelayedCallable
{
const FINISHED_EVENT = 'request.finished';
* @var callable[]
private $delayed = [];
* @Listen(DelayedCallableEvent::DELAYED)
*
* @param DelayedCallableEvent $event
public function onDelayedCallable(DelayedCallableEvent $event): void
$this->delayed[] = $event->getCallable();
}
* @Listen(DelayedCallable::FINISHED_EVENT);
* @param FinishRequestEvent $event
public function onRequestEnded(FinishRequestEvent $event): void
$event
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
foreach ($this->delayed as $callable) {
$callable();
$this->delayed = [];
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.