Skip to content
Avatar

Highlights

  • Arctic Code Vault Contributor

Organizations

@symfony @Elao @manala

Sponsors

@pyrech
ogizanagi/README.md
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'];
    }
}

Pinned

  1. The Symfony PHP framework

    PHP 24.1k 7.9k

  2. 🔩 Provides enumerations for PHP & frameworks integrations

    PHP 177 11

2,466 contributions in the last year

Nov Dec Jan Feb Mar Apr May Jun Jul Aug Sep Oct Mon Wed Fri
Activity overview
Contributed to symfony/symfony, StenopePHP/Stenope, Elao/PhpEnums and 5 other repositories
Loading

Contribution activity

November 2020

2 contributions in private repositories Nov 2

Seeing something unexpected? Take a look at the GitHub profile guide.

You can’t perform that action at this time.