Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#158 Add dependency to symfony/service-contract #161

Merged
merged 1 commit into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand Down
8 changes: 7 additions & 1 deletion src/Model/AbstractConfigurableTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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) {
Expand Down
Loading