wiki/content/20201117115146-consoleevents_signal.md

640 B

id title
03320caf-dc21-416f-9d74-dc1bc219101e ConsoleEvents::SIGNAL

Description

Event to handle application command signals.

Syntax

// ...
use Symfony\Component\Console\Event\ConsoleSignalEvent;

class SignalSubscriber implements EventSubscriberInterface
{
    // ...

    public function handleSignal(ConsoleSignalEvent $event)
    {
        $signal = $event->getHandlingSignal();

        // ...
    }

    public static function getSubscribedEvents()
    {
        return [
            ConsoleEvents::SIGNAL => 'handleSignal',
        ];
    }
}