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 23.7k 7.8k

  2. 🔩 Provides enumerations for PHP & frameworks integrations

    PHP 173 12

2,330 contributions in the last year

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

Contribution activity

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

You can’t perform that action at this time.