src/Domain/Application/EventSubscriber/ConsoleSubscriber.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Application\EventSubscriber;
  3. use Symfony\Component\Console\ConsoleEvents;
  4. use Symfony\Component\Console\Event\ConsoleCommandEvent;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. class ConsoleSubscriber implements EventSubscriberInterface
  7. {
  8.     public static function getSubscribedEvents()
  9.     {
  10.         return [
  11.             ConsoleEvents::COMMAND => 'onCommand',
  12.         ];
  13.     }
  14.     public function onCommand(ConsoleCommandEvent $event): void
  15.     {
  16.         date_default_timezone_set('Europe/Paris');
  17.     }
  18. }