class Kernel extends SymfonyKernel implements EventSubscriberInterface
{
use MicroKernelTrait;
public function bowtiesAction(): Response
{
return new Response('I wear a fez now. Fezzes are cool!');
}
public function dangerousAction(): Response
{
throw new Danger('🔥🔥 😈🐷 🔱🔺 🔥🔥');
}
public function onKernelException(ExceptionEvent $event): void
{
if ($event->getThrowable() instanceof Danger) {
$event->setResponse(new Response("👴🏻: It's dangerous to go alone. Take this: 🗡️"));
}
}
protected function configureRoutes(RoutingConfigurator $routes): void
{
$routes->add('bowties', '/bowties')->controller('kernel::bowtiesAction');
$routes->add('danger', '/danger')->controller('kernel::dangerousAction');
}
public static function getSubscribedEvents(): array
{
return [KernelEvents::EXCEPTION => 'onKernelException'];
}
}Highlights
- Arctic Code Vault Contributor
Pinned
2,876 contributions in the last year
Less
More
Activity overview
Contribution activity
March 2021
Created 20 commits in 2 repositories
Opened 2 pull requests in 1 repository
StenopePHP/Stenope
2
merged
Reviewed 10 pull requests in 3 repositories
manala/manala-recipes 6 pull requests
symfony/symfony 2 pull requests
symfony/recipes 2 pull requests
Created an issue in kanga333/variable-mapper that received 1 comment
"Error: Failed to get key index" when the regex contains an escaping backslash
In case of such an expression: "^staging(-[\\w/-]*)?$": { ... } We get: Error: Failed to get key index of ^staging(-[\w/-]*)?$ Which I guess is rel…
1
comment
Opened 1 other issue in 1 repository
StenopePHP/Stenope
1
open
416
contributions
in private repositories
Mar 1 – Mar 25