@@ -618,33 +618,33 @@ you a central place to manage the text.
618
618
This is a simple example; in production you may prefer to use the :doc: `Translation </components/translation >`
619
619
component to manage messages in one place::
620
620
621
- namespace App\L istener\W orkflow\T ask;
621
+ namespace App\Listener\Workflow\Task;
622
622
623
- use Symfony\C omponent\E ventDispatcher\E ventSubscriberInterface;
624
- use Symfony\C omponent\W orkflow\E vent\G uardEvent;
625
- use Symfony\C omponent\W orkflow\T ransitionBlocker;
623
+ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
624
+ use Symfony\Component\Workflow\Event\GuardEvent;
625
+ use Symfony\Component\Workflow\TransitionBlocker;
626
626
627
- class OverdueGuard implements EventSubscriberInterface
628
- {
629
- public function guardPublish(GuardEvent $event)
627
+ class OverdueGuard implements EventSubscriberInterface
630
628
{
631
- $timeLimit = $event->getMetadata('time_limit', $event->getTransition());
629
+ public function guardPublish(GuardEvent $event)
630
+ {
631
+ $timeLimit = $event->getMetadata('time_limit', $event->getTransition());
632
632
633
- if (date('Hi') <= $timeLimit) {
634
- return;
635
- }
633
+ if (date('Hi') <= $timeLimit) {
634
+ return;
635
+ }
636
636
637
- $explanation = $event->getMetadata('explanation', $event->getTransition());
638
- $event->addTransitionBlocker(new TransitionBlocker($explanation , 0));
639
- }
637
+ $explanation = $event->getMetadata('explanation', $event->getTransition());
638
+ $event->addTransitionBlocker(new TransitionBlocker($explanation , 0));
639
+ }
640
640
641
- public static function getSubscribedEvents()
642
- {
643
- return [
644
- 'workflow.task.guard.done' => 'guardPublish',
645
- ];
641
+ public static function getSubscribedEvents()
642
+ {
643
+ return [
644
+ 'workflow.task.guard.done' => 'guardPublish',
645
+ ];
646
+ }
646
647
}
647
- }
648
648
649
649
.. versionadded :: 4.1
650
650
0 commit comments