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

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