<?php declare(strict_types=1);
namespace Shopware\Core\Content\Flow\Dispatching\Action;
use Shopware\Core\Content\Flow\Dispatching\DelayableAction;
use Shopware\Core\Content\Flow\Dispatching\StorableFlow;
use Shopware\Core\Framework\Event\FlowEvent;
use Shopware\Core\Framework\Feature;
/**
* @deprecated tag:v6.5.0 - reason:remove-subscriber - FlowActions won't be executed over the event system anymore,
* therefore the actions won't implement the EventSubscriberInterface anymore.
*/
class StopFlowAction extends FlowAction implements DelayableAction
{
public static function getName(): string
{
return 'action.stop.flow';
}
/**
* @deprecated tag:v6.5.0 - reason:remove-subscriber - Will be removed
*
* @return array<string, string|array{0: string, 1: int}|list<array{0: string, 1?: int}>>
*/
public static function getSubscribedEvents()
{
if (Feature::isActive('v6.5.0.0')) {
return [];
}
return [
self::getName() => 'handle',
];
}
/**
* @return array<int, string|null>
*/
public function requirements(): array
{
return [];
}
/**
* @deprecated tag:v6.5.0 Will be removed, implement handleFlow instead
*/
public function handle(FlowEvent $event): void
{
Feature::triggerDeprecationOrThrow(
'v6.5.0.0',
Feature::deprecatedMethodMessage(__CLASS__, __METHOD__, 'v6.5.0.0')
);
$event->stop();
}
public function handleFlow(StorableFlow $flow): void
{
$flow->stop();
}
}