for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* (c) Lukasz D. Tulikowski <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace App\EventSubscriber;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents;
class ExceptionSubscriber implements EventSubscriberInterface
{
/**
* {@inheritdoc}
public static function getSubscribedEvents()
// return the subscribed events, their methods and priorities
return [
KernelEvents::EXCEPTION => [
['processException', 10],
],
];
}
public function processException()
$dispatcher = new EventDispatcher();
$dispatcher->dispatch('onKernelRequest');