@@ -702,33 +702,33 @@ you a central place to manage the text.
702
702
This is a simple example; in production you may prefer to use the :doc: `Translation </components/translation >`
703
703
component to manage messages in one place::
704
704
705
- namespace App\L istener\W orkflow\T ask;
705
+ namespace App\Listener\Workflow\Task;
706
706
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;
710
710
711
- class OverdueGuard implements EventSubscriberInterface
712
- {
713
- public function guardPublish(GuardEvent $event)
711
+ class OverdueGuard implements EventSubscriberInterface
714
712
{
715
- $timeLimit = $event->getMetadata('time_limit', $event->getTransition());
713
+ public function guardPublish(GuardEvent $event)
714
+ {
715
+ $timeLimit = $event->getMetadata('time_limit', $event->getTransition());
716
716
717
- if (date('Hi') <= $timeLimit) {
718
- return;
719
- }
717
+ if (date('Hi') <= $timeLimit) {
718
+ return;
719
+ }
720
720
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
+ }
724
724
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
+ }
730
731
}
731
- }
732
732
733
733
.. versionadded :: 4.1
734
734
0 commit comments