@@ -702,33 +702,33 @@ you a central place to manage the text.
702702 This is a simple example; in production you may prefer to use the :doc: `Translation </components/translation >`
703703 component to manage messages in one place::
704704
705- namespace App\L istener\W orkflow\T ask;
705+ namespace App\Listener\Workflow\Task;
706706
707- use Symfony\C omponent\E ventDispatcher\E ventSubscriberInterface;
708- use Symfony\C omponent\W orkflow\E vent\G uardEvent;
709- use Symfony\C omponent\W orkflow\T ransitionBlocker;
707+ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
708+ use Symfony\Component\Workflow\Event\GuardEvent;
709+ use Symfony\Component\Workflow\TransitionBlocker;
710710
711- class OverdueGuard implements EventSubscriberInterface
712- {
713- public function guardPublish(GuardEvent $event)
711+ class OverdueGuard implements EventSubscriberInterface
714712 {
715- $timeLimit = $event->getMetadata('time_limit', $event->getTransition());
713+ public function guardPublish(GuardEvent $event)
714+ {
715+ $timeLimit = $event->getMetadata('time_limit', $event->getTransition());
716716
717- if (date('Hi') <= $timeLimit) {
718- return;
719- }
717+ if (date('Hi') <= $timeLimit) {
718+ return;
719+ }
720720
721- $explanation = $event->getMetadata('explanation', $event->getTransition());
722- $event->addTransitionBlocker(new TransitionBlocker($explanation , 0));
723- }
721+ $explanation = $event->getMetadata('explanation', $event->getTransition());
722+ $event->addTransitionBlocker(new TransitionBlocker($explanation , 0));
723+ }
724724
725- public static function getSubscribedEvents()
726- {
727- return [
728- 'workflow.task.guard.done' => 'guardPublish',
729- ];
725+ public static function getSubscribedEvents()
726+ {
727+ return [
728+ 'workflow.task.guard.done' => 'guardPublish',
729+ ];
730+ }
730731 }
731- }
732732
733733.. versionadded :: 4.1
734734
0 commit comments