Skip to content

Commit

Permalink
Merge pull request #5 from php-etl/feature/actions
Browse files Browse the repository at this point in the history
Added an attribute and interfaces to manage actions
  • Loading branch information
gplanchat authored Apr 19, 2023
2 parents f17ac6f + 5568dc0 commit 9c576e4
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "0.7.x-dev"
"dev-main": "0.8.x-dev"
}
}
}
15 changes: 15 additions & 0 deletions src/Action.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

namespace Kiboko\Contract\Configurator;

#[\Attribute(\Attribute::TARGET_CLASS)]
final class Action
{
public function __construct(
public string $name,
public array $dependencies = [],
) {
}
}
11 changes: 11 additions & 0 deletions src/ActionConfigurationInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace Kiboko\Contract\Configurator;

use Symfony\Component\Config\Definition\ConfigurationInterface;

interface ActionConfigurationInterface extends ConfigurationInterface
{
}
14 changes: 14 additions & 0 deletions src/ActionInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace Kiboko\Contract\Configurator;

use Symfony\Component\ExpressionLanguage\ExpressionLanguage;

interface ActionInterface extends FactoryInterface
{
public function interpreter(): ExpressionLanguage;

public function configuration(): ActionConfigurationInterface;
}
2 changes: 2 additions & 0 deletions src/RuntimeConfigurationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ interface RuntimeConfigurationInterface extends ConfigurationInterface
public function addPlugin(string $name, PluginConfigurationInterface $plugin): self;

public function addFeature(string $name, FeatureConfigurationInterface $feature): self;

public function addAction(string $name, ActionConfigurationInterface $action): self;
}

0 comments on commit 9c576e4

Please sign in to comment.