diff --git a/composer.json b/composer.json index 5286b57a..37916dab 100644 --- a/composer.json +++ b/composer.json @@ -70,7 +70,8 @@ "symfony/serializer": "^6.4|^7.1", "symfony/stopwatch": "^6.4|^7.1", "symfony/validator": "^6.4|^7.1", - "symfony/yaml": "^6.4|^7.1" + "symfony/yaml": "^6.4|^7.1", + "symfony/service-contracts": ">=1.0.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "*", diff --git a/src/Model/AbstractConfigurableTask.php b/src/Model/AbstractConfigurableTask.php index 149eae24..5228cec6 100644 --- a/src/Model/AbstractConfigurableTask.php +++ b/src/Model/AbstractConfigurableTask.php @@ -14,11 +14,12 @@ namespace CleverAge\ProcessBundle\Model; use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Contracts\Service\ResetInterface; /** * Allow the task to configure it's options, set default basic options for errors handling. */ -abstract class AbstractConfigurableTask implements InitializableTaskInterface +abstract class AbstractConfigurableTask implements InitializableTaskInterface, ResetInterface { protected ?array $options = null; @@ -30,6 +31,11 @@ public function initialize(ProcessState $state): void $this->getOptions($state); } + public function reset(): void + { + $this->options = null; + } + protected function getOptions(ProcessState $state): ?array { if (null === $this->options) {