Skip to content

Commit 9c576e4

Browse files
authored
Merge pull request #5 from php-etl/feature/actions
Added an attribute and interfaces to manage actions
2 parents f17ac6f + 5568dc0 commit 9c576e4

File tree

5 files changed

+43
-1
lines changed

5 files changed

+43
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"extra": {
4242
"branch-alias": {
43-
"dev-main": "0.7.x-dev"
43+
"dev-main": "0.8.x-dev"
4444
}
4545
}
4646
}

src/Action.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Kiboko\Contract\Configurator;
6+
7+
#[\Attribute(\Attribute::TARGET_CLASS)]
8+
final class Action
9+
{
10+
public function __construct(
11+
public string $name,
12+
public array $dependencies = [],
13+
) {
14+
}
15+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Kiboko\Contract\Configurator;
6+
7+
use Symfony\Component\Config\Definition\ConfigurationInterface;
8+
9+
interface ActionConfigurationInterface extends ConfigurationInterface
10+
{
11+
}

src/ActionInterface.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Kiboko\Contract\Configurator;
6+
7+
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
8+
9+
interface ActionInterface extends FactoryInterface
10+
{
11+
public function interpreter(): ExpressionLanguage;
12+
13+
public function configuration(): ActionConfigurationInterface;
14+
}

src/RuntimeConfigurationInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ interface RuntimeConfigurationInterface extends ConfigurationInterface
1111
public function addPlugin(string $name, PluginConfigurationInterface $plugin): self;
1212

1313
public function addFeature(string $name, FeatureConfigurationInterface $feature): self;
14+
15+
public function addAction(string $name, ActionConfigurationInterface $action): self;
1416
}

0 commit comments

Comments
 (0)