vendor/shopware/core/Content/Flow/Dispatching/Action/StopFlowAction.php line 48

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Content\Flow\Dispatching\Action;
  3. use Shopware\Core\Content\Flow\Dispatching\DelayableAction;
  4. use Shopware\Core\Content\Flow\Dispatching\StorableFlow;
  5. use Shopware\Core\Framework\Event\FlowEvent;
  6. use Shopware\Core\Framework\Feature;
  7. /**
  8.  * @deprecated tag:v6.5.0 - reason:remove-subscriber - FlowActions won't be executed over the event system anymore,
  9.  * therefore the actions won't implement the EventSubscriberInterface anymore.
  10.  */
  11. class StopFlowAction extends FlowAction implements DelayableAction
  12. {
  13.     public static function getName(): string
  14.     {
  15.         return 'action.stop.flow';
  16.     }
  17.     /**
  18.      * @deprecated tag:v6.5.0 - reason:remove-subscriber - Will be removed
  19.      *
  20.      * @return array<string, string|array{0: string, 1: int}|list<array{0: string, 1?: int}>>
  21.      */
  22.     public static function getSubscribedEvents()
  23.     {
  24.         if (Feature::isActive('v6.5.0.0')) {
  25.             return [];
  26.         }
  27.         return [
  28.             self::getName() => 'handle',
  29.         ];
  30.     }
  31.     /**
  32.      * @return array<int, string|null>
  33.      */
  34.     public function requirements(): array
  35.     {
  36.         return [];
  37.     }
  38.     /**
  39.      * @deprecated tag:v6.5.0 Will be removed, implement handleFlow instead
  40.      */
  41.     public function handle(FlowEvent $event): void
  42.     {
  43.         Feature::triggerDeprecationOrThrow(
  44.             'v6.5.0.0',
  45.             Feature::deprecatedMethodMessage(__CLASS____METHOD__'v6.5.0.0')
  46.         );
  47.         $event->stop();
  48.     }
  49.     public function handleFlow(StorableFlow $flow): void
  50.     {
  51.         $flow->stop();
  52.     }
  53. }