From 7b95d8782dc9ea1d19a686b82a18cdf888b10a16 Mon Sep 17 00:00:00 2001 From: sebprt Date: Tue, 16 Jan 2024 09:09:00 +0100 Subject: [PATCH 1/5] Fixed the new run command : missing dependencies + added to the satellite executable --- bin/satellite | 1 + src/Console/Command/WorkflowRunCommand.php | 2 +- src/Service.php | 9 ++++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/satellite b/bin/satellite index 7986789a..9bad54e1 100755 --- a/bin/satellite +++ b/bin/satellite @@ -25,6 +25,7 @@ $app->addCommands([ new \Kiboko\Component\Satellite\Console\Command\ValidateCommand(), new \Kiboko\Component\Satellite\Console\Command\PipelineRunCommand(), new \Kiboko\Component\Satellite\Console\Command\WorkflowRunCommand(), + new \Kiboko\Component\Satellite\Console\Command\RunCommand(), ]); $app->run(new Input\ArgvInput(), new Output\ConsoleOutput()); diff --git a/src/Console/Command/WorkflowRunCommand.php b/src/Console/Command/WorkflowRunCommand.php index 9b6d9720..e582c0e7 100644 --- a/src/Console/Command/WorkflowRunCommand.php +++ b/src/Console/Command/WorkflowRunCommand.php @@ -9,7 +9,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[Console\Attribute\AsCommand('run:workflow', 'Run a data flow satellite (pipeline or workflow).', hidden: true)] -final class WorkflowRunCommand extends Console\Command\Command +final class WorkflowRunCommand extends RunCommand { protected function configure(): void { diff --git a/src/Service.php b/src/Service.php index 4dbe781b..1f80032a 100644 --- a/src/Service.php +++ b/src/Service.php @@ -238,6 +238,13 @@ private function compileWorkflow(array $config): Satellite\Builder\Repository\Wo 'php-etl/pipeline-contracts:>=0.5.1 <0.6', 'php-etl/action-contracts:>=0.2.0 <0.3', 'php-etl/workflow:*', + 'php-etl/console-state:*', + 'php-etl/workflow-console-runtime:*', + 'psr/log:*', + 'monolog/monolog:*', + 'symfony/dotenv:^6.0', + 'symfony/console:^6.0', + 'symfony/dependency-injection:^6.0', ); $repository->addFiles( @@ -328,11 +335,11 @@ private function compilePipelineJob(array $config): Satellite\Builder\Repository $repository = new Satellite\Builder\Repository\Pipeline($pipeline); $repository->addPackages( + 'php-etl/satellite-contracts:>=0.1.1 <0.2', 'php-etl/pipeline-contracts:>=0.5.1 <0.6', 'php-etl/pipeline:*', 'php-etl/console-state:*', 'php-etl/pipeline-console-runtime:*', - 'php-etl/workflow-console-runtime:*', 'psr/log:*', 'monolog/monolog:*', 'symfony/console:^6.0', From 35a53d0b5fcc4480f97b3ce8a77867ee75bf2fc9 Mon Sep 17 00:00:00 2001 From: sebprt Date: Tue, 16 Jan 2024 09:13:04 +0100 Subject: [PATCH 2/5] Ran php-cs-fixer --- src/Action/ConfigurationApplier.php | 4 ++-- src/Action/Custom/Factory/Action.php | 4 ++-- src/Adapter/AdapterChoice.php | 2 +- src/Cloud/Pipeline.php | 8 ++++---- src/Cloud/PipelineInterface.php | 2 +- src/ComposerScripts.php | 4 ++-- src/ConfigLoader.php | 2 +- src/Console/Command/BuildCommand.php | 2 +- src/Console/Command/ValidateCommand.php | 2 +- .../Logger/Factory/ElasticSearchFactory.php | 4 ++-- src/Feature/Logger/Factory/GelfFactory.php | 4 ++-- src/Feature/Logger/Factory/StreamFactory.php | 4 ++-- src/Feature/Logger/Factory/SyslogFactory.php | 4 ++-- .../Rejection/Builder/RabbitMQBuilder.php | 16 ++++++++-------- .../Rejection/Factory/RabbitMQFactory.php | 4 ++-- src/Plugin/Custom/Factory/Extractor.php | 4 ++-- src/Plugin/Custom/Factory/Loader.php | 4 ++-- src/Plugin/Custom/Factory/Transformer.php | 4 ++-- src/Plugin/Custom/Service.php | 2 +- src/Plugin/FTP/Builder/Loader.php | 14 +++++++------- src/Plugin/Filtering/Factory/Drop.php | 4 ++-- src/Plugin/Filtering/Factory/Reject.php | 4 ++-- src/Plugin/Filtering/Service.php | 2 +- src/Plugin/SFTP/Factory/Extractor.php | 2 +- src/Plugin/SFTP/Factory/Loader.php | 2 +- src/Runtime/RuntimeChoice.php | 2 +- src/Runtime/Workflow/Configuration.php | 4 ++-- src/Service.php | 2 +- 28 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/Action/ConfigurationApplier.php b/src/Action/ConfigurationApplier.php index 1dcc4011..014be7b1 100644 --- a/src/Action/ConfigurationApplier.php +++ b/src/Action/ConfigurationApplier.php @@ -10,7 +10,7 @@ final class ConfigurationApplier { - private ?Action $action = null; + private ?Satellite\Action\Action $action = null; private array $packages = []; public function __construct( @@ -22,7 +22,7 @@ public function __construct( public function withAction(): self { - $this->action = new Action($this->plugin, clone $this->interpreter); + $this->action = new Satellite\Action\Action($this->plugin, clone $this->interpreter); return $this; } diff --git a/src/Action/Custom/Factory/Action.php b/src/Action/Custom/Factory/Action.php index eb70c1ec..2780917c 100644 --- a/src/Action/Custom/Factory/Action.php +++ b/src/Action/Custom/Factory/Action.php @@ -63,7 +63,7 @@ public function validate(array $config): bool /** * @throws Configurator\ConfigurationExceptionInterface */ - public function compile(array $config): Repository\Action + public function compile(array $config): Custom\Factory\Repository\Action { $containerName = sprintf('ProjectServiceContainer%s', ByteString::fromRandom(8)->toString()); @@ -74,7 +74,7 @@ public function compile(array $config): Repository\Action $container = (new SatelliteDependencyInjection(...$this->providers))($config); - $repository = new Repository\Action($builder); + $repository = new Custom\Factory\Repository\Action($builder); $dumper = new PhpDumper($container); $repository->addFiles( diff --git a/src/Adapter/AdapterChoice.php b/src/Adapter/AdapterChoice.php index 8c5a3f7a..df61e1fa 100644 --- a/src/Adapter/AdapterChoice.php +++ b/src/Adapter/AdapterChoice.php @@ -23,7 +23,7 @@ public function __invoke(array $configuration): Configurator\SatelliteBuilderInt } } - \assert($factory instanceof \Kiboko\Contract\Configurator\Adapter\FactoryInterface, new AdapterNotFoundException('No compatible adapter was found for your satellite configuration.')); + \assert($factory instanceof Configurator\Adapter\FactoryInterface, new AdapterNotFoundException('No compatible adapter was found for your satellite configuration.')); return $factory($configuration); } diff --git a/src/Cloud/Pipeline.php b/src/Cloud/Pipeline.php index 70333a72..52d3e80d 100644 --- a/src/Cloud/Pipeline.php +++ b/src/Cloud/Pipeline.php @@ -83,7 +83,7 @@ function (string $namespace) { ); } - public static function fromApiWithId(Api\Client $client, PipelineId $id, array $configuration): DTO\ReferencedPipeline + public static function fromApiWithId(Api\Client $client, PipelineId $id, array $configuration): ReferencedPipeline { $item = $client->getPipelineItem($id->asString()); @@ -99,7 +99,7 @@ public static function fromApiWithId(Api\Client $client, PipelineId $id, array $ ); } - public static function fromApiWithCode(Api\Client $client, string $code, array $configuration): DTO\ReferencedPipeline + public static function fromApiWithCode(Api\Client $client, string $code, array $configuration): ReferencedPipeline { $collection = $client->getPipelineCollection(['code' => $code]); @@ -199,7 +199,7 @@ public function create(DTO\PipelineInterface $pipeline): DTO\CommandBatch ); } - public function update(DTO\ReferencedPipeline $actual, DTO\PipelineInterface $desired): DTO\CommandBatch + public function update(ReferencedPipeline $actual, DTO\PipelineInterface $desired): DTO\CommandBatch { if ($actual->code() !== $desired->code()) { throw new \RuntimeException('Code does not match between actual and desired pipeline definition.'); @@ -220,7 +220,7 @@ public function update(DTO\ReferencedPipeline $actual, DTO\PipelineInterface $de return new DTO\CommandBatch(...$commands); } - public function remove(DTO\PipelineId $id): DTO\CommandBatch + public function remove(PipelineId $id): DTO\CommandBatch { return new DTO\CommandBatch( new Command\Pipeline\RemovePipelineCommand($id), diff --git a/src/Cloud/PipelineInterface.php b/src/Cloud/PipelineInterface.php index ae03a156..30792e4f 100644 --- a/src/Cloud/PipelineInterface.php +++ b/src/Cloud/PipelineInterface.php @@ -19,5 +19,5 @@ public function create(DTO\PipelineInterface $pipeline): DTO\CommandBatch; public function update(DTO\ReferencedPipeline $actual, DTO\PipelineInterface $desired): DTO\CommandBatch; - public function remove(DTO\PipelineId $id): DTO\CommandBatch; + public function remove(PipelineId $id): DTO\CommandBatch; } diff --git a/src/ComposerScripts.php b/src/ComposerScripts.php index d89e8c4a..e3ef1ccf 100644 --- a/src/ComposerScripts.php +++ b/src/ComposerScripts.php @@ -15,7 +15,7 @@ final class ComposerScripts public static function postInstall(Event $event): void { self::updatePlugins( - $packages = new Composer\Accumulator(), + $packages = new Accumulator(), $repository = $event->getComposer() ->getRepositoryManager() ->getLocalRepository(), @@ -26,7 +26,7 @@ public static function postInstall(Event $event): void public static function postUpdate(Event $event): void { self::updatePlugins( - $packages = new Composer\Accumulator(), + $packages = new Accumulator(), $repository = $event->getComposer() ->getRepositoryManager() ->getLocalRepository(), diff --git a/src/ConfigLoader.php b/src/ConfigLoader.php index 5e4c6f69..f299dfe0 100644 --- a/src/ConfigLoader.php +++ b/src/ConfigLoader.php @@ -8,7 +8,7 @@ use Kiboko\Contract\Configurator\InvalidConfigurationException; use Symfony\Component\Config; -class ConfigLoader implements ConfigLoaderInterface +class ConfigLoader implements Satellite\ConfigLoaderInterface { public function __construct(private readonly string $basePath) { diff --git a/src/Console/Command/BuildCommand.php b/src/Console/Command/BuildCommand.php index 828fb1a6..997eb0a9 100644 --- a/src/Console/Command/BuildCommand.php +++ b/src/Console/Command/BuildCommand.php @@ -126,6 +126,6 @@ public function log($level, $message, array $context = []): void } } - return \Symfony\Component\Console\Command\Command::SUCCESS; + return Console\Command\Command::SUCCESS; } } diff --git a/src/Console/Command/ValidateCommand.php b/src/Console/Command/ValidateCommand.php index 2ae8db02..4490b8e0 100644 --- a/src/Console/Command/ValidateCommand.php +++ b/src/Console/Command/ValidateCommand.php @@ -76,6 +76,6 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O $style->writeln(json_encode($configuration, \JSON_PRETTY_PRINT)); - return \Symfony\Component\Console\Command\Command::SUCCESS; + return Console\Command\Command::SUCCESS; } } diff --git a/src/Feature/Logger/Factory/ElasticSearchFactory.php b/src/Feature/Logger/Factory/ElasticSearchFactory.php index 7e265448..4e681b5a 100644 --- a/src/Feature/Logger/Factory/ElasticSearchFactory.php +++ b/src/Feature/Logger/Factory/ElasticSearchFactory.php @@ -53,7 +53,7 @@ public function validate(array $config): bool return false; } - public function compile(array $config): Repository\ElasticSearchRepository + public function compile(array $config): Logger\Factory\Repository\ElasticSearchRepository { $builder = new Logger\Builder\Monolog\ElasticSearchBuilder($this->interpreter); @@ -69,6 +69,6 @@ public function compile(array $config): Repository\ElasticSearchRepository $builder->withIndex($config['index']); } - return new Repository\ElasticSearchRepository($builder); + return new Logger\Factory\Repository\ElasticSearchRepository($builder); } } diff --git a/src/Feature/Logger/Factory/GelfFactory.php b/src/Feature/Logger/Factory/GelfFactory.php index c7017afe..d510c07d 100644 --- a/src/Feature/Logger/Factory/GelfFactory.php +++ b/src/Feature/Logger/Factory/GelfFactory.php @@ -50,7 +50,7 @@ public function validate(array $config): bool return false; } - public function compile(array $config): Repository\GelfRepository + public function compile(array $config): Logger\Factory\Repository\GelfRepository { $builder = new Logger\Builder\Monolog\GelfBuilder(); @@ -74,6 +74,6 @@ public function compile(array $config): Repository\GelfRepository ); } - return new Repository\GelfRepository($builder); + return new Logger\Factory\Repository\GelfRepository($builder); } } diff --git a/src/Feature/Logger/Factory/StreamFactory.php b/src/Feature/Logger/Factory/StreamFactory.php index 0048058d..2c98d56c 100644 --- a/src/Feature/Logger/Factory/StreamFactory.php +++ b/src/Feature/Logger/Factory/StreamFactory.php @@ -50,7 +50,7 @@ public function validate(array $config): bool return false; } - public function compile(array $config): Repository\StreamRepository + public function compile(array $config): Logger\Factory\Repository\StreamRepository { $builder = new Logger\Builder\Monolog\StreamBuilder($config['path']); @@ -66,6 +66,6 @@ public function compile(array $config): Repository\StreamRepository $builder->withLocking($config['use_locking']); } - return new Repository\StreamRepository($builder); + return new Logger\Factory\Repository\StreamRepository($builder); } } diff --git a/src/Feature/Logger/Factory/SyslogFactory.php b/src/Feature/Logger/Factory/SyslogFactory.php index 9d2ad46c..30d9fd6e 100644 --- a/src/Feature/Logger/Factory/SyslogFactory.php +++ b/src/Feature/Logger/Factory/SyslogFactory.php @@ -50,7 +50,7 @@ public function validate(array $config): bool return false; } - public function compile(array $config): Repository\SyslogRepository + public function compile(array $config): Logger\Factory\Repository\SyslogRepository { $builder = new Logger\Builder\Monolog\SyslogBuilder($config['ident']); @@ -66,6 +66,6 @@ public function compile(array $config): Repository\SyslogRepository $builder->withLogopts($config['logopts']); } - return new Repository\SyslogRepository($builder); + return new Logger\Factory\Repository\SyslogRepository($builder); } } diff --git a/src/Feature/Rejection/Builder/RabbitMQBuilder.php b/src/Feature/Rejection/Builder/RabbitMQBuilder.php index 45eef8d9..145a55cb 100644 --- a/src/Feature/Rejection/Builder/RabbitMQBuilder.php +++ b/src/Feature/Rejection/Builder/RabbitMQBuilder.php @@ -44,25 +44,25 @@ public function withExchange( public function getNode(): Node\Expr { $args = [ - new Node\Arg($this->host, name: new Node\Identifier('host')), - new Node\Arg($this->vhost, name: new Node\Identifier('vhost')), - new Node\Arg($this->topic, name: new Node\Identifier('topic')), - new Node\Arg($this->stepUuid, name: new Node\Identifier('stepUuid')), + new Node\Arg($this->host, name: new Identifier('host')), + new Node\Arg($this->vhost, name: new Identifier('vhost')), + new Node\Arg($this->topic, name: new Identifier('topic')), + new Node\Arg($this->stepUuid, name: new Identifier('stepUuid')), ]; if (null !== $this->exchange) { - $args[] = new Node\Arg($this->exchange, name: new Node\Identifier('exchange')); + $args[] = new Node\Arg($this->exchange, name: new Identifier('exchange')); } if (null !== $this->port) { - $args[] = new Node\Arg($this->port, name: new Node\Identifier('port')); + $args[] = new Node\Arg($this->port, name: new Identifier('port')); } if (null !== $this->user) { array_push( $args, - new Node\Arg($this->user, name: new Node\Identifier('user')), - new Node\Arg($this->password, name: new Node\Identifier('password')), + new Node\Arg($this->user, name: new Identifier('user')), + new Node\Arg($this->password, name: new Identifier('password')), ); return new Node\Expr\StaticCall( diff --git a/src/Feature/Rejection/Factory/RabbitMQFactory.php b/src/Feature/Rejection/Factory/RabbitMQFactory.php index 7de68b4f..66813ca4 100644 --- a/src/Feature/Rejection/Factory/RabbitMQFactory.php +++ b/src/Feature/Rejection/Factory/RabbitMQFactory.php @@ -55,7 +55,7 @@ public function validate(array $config): bool return false; } - public function compile(array $config): Repository\RabbitMQRepository + public function compile(array $config): Rejection\Factory\Repository\RabbitMQRepository { $builder = new Rejection\Builder\RabbitMQBuilder( stepUuid: compileValueWhenExpression($this->interpreter, uniqid()), @@ -76,6 +76,6 @@ public function compile(array $config): Repository\RabbitMQRepository $builder->withExchange(compileValueWhenExpression($this->interpreter, $config['exchange'])); } - return new Repository\RabbitMQRepository($builder); + return new Rejection\Factory\Repository\RabbitMQRepository($builder); } } diff --git a/src/Plugin/Custom/Factory/Extractor.php b/src/Plugin/Custom/Factory/Extractor.php index 5690023d..848688bc 100644 --- a/src/Plugin/Custom/Factory/Extractor.php +++ b/src/Plugin/Custom/Factory/Extractor.php @@ -63,7 +63,7 @@ public function validate(array $config): bool /** * @throws Configurator\ConfigurationExceptionInterface */ - public function compile(array $config): Repository\Extractor + public function compile(array $config): Custom\Factory\Repository\Extractor { $containerName = sprintf('ProjectServiceContainer%s', ByteString::fromRandom(8)->toString()); @@ -74,7 +74,7 @@ public function compile(array $config): Repository\Extractor $container = (new SatelliteDependencyInjection(...$this->providers))($config); - $repository = new Repository\Extractor($builder); + $repository = new Custom\Factory\Repository\Extractor($builder); $dumper = new PhpDumper($container); $repository->addFiles( diff --git a/src/Plugin/Custom/Factory/Loader.php b/src/Plugin/Custom/Factory/Loader.php index 69a17a52..9fd5d1b3 100644 --- a/src/Plugin/Custom/Factory/Loader.php +++ b/src/Plugin/Custom/Factory/Loader.php @@ -63,7 +63,7 @@ public function validate(array $config): bool /** * @throws Configurator\ConfigurationExceptionInterface */ - public function compile(array $config): Repository\Loader + public function compile(array $config): Custom\Factory\Repository\Loader { $containerName = sprintf('ProjectServiceContainer%s', ByteString::fromRandom(8)->toString()); @@ -74,7 +74,7 @@ public function compile(array $config): Repository\Loader $container = (new SatelliteDependencyInjection(...$this->providers))($config); - $repository = new Repository\Loader($builder); + $repository = new Custom\Factory\Repository\Loader($builder); $dumper = new PhpDumper($container); $repository->addFiles( diff --git a/src/Plugin/Custom/Factory/Transformer.php b/src/Plugin/Custom/Factory/Transformer.php index 5beb12e3..e1c29e41 100644 --- a/src/Plugin/Custom/Factory/Transformer.php +++ b/src/Plugin/Custom/Factory/Transformer.php @@ -63,7 +63,7 @@ public function validate(array $config): bool /** * @throws Configurator\ConfigurationExceptionInterface */ - public function compile(array $config): Repository\Transformer + public function compile(array $config): Custom\Factory\Repository\Transformer { $containerName = sprintf('ProjectServiceContainer%s', ByteString::fromRandom(8)->toString()); @@ -74,7 +74,7 @@ public function compile(array $config): Repository\Transformer $container = (new SatelliteDependencyInjection(...$this->providers))($config); - $repository = new Repository\Transformer($builder); + $repository = new Custom\Factory\Repository\Transformer($builder); $dumper = new PhpDumper($container); $repository->addFiles( diff --git a/src/Plugin/Custom/Service.php b/src/Plugin/Custom/Service.php index 0818a8e4..aeac335b 100644 --- a/src/Plugin/Custom/Service.php +++ b/src/Plugin/Custom/Service.php @@ -27,7 +27,7 @@ public function __construct( private ExpressionLanguage $interpreter = new Satellite\ExpressionLanguage() ) { $this->processor = new Processor(); - $this->configuration = new Configuration(); + $this->configuration = new Custom\Configuration(); } public function interpreter(): ExpressionLanguage diff --git a/src/Plugin/FTP/Builder/Loader.php b/src/Plugin/FTP/Builder/Loader.php index f566d653..e4e966ae 100644 --- a/src/Plugin/FTP/Builder/Loader.php +++ b/src/Plugin/FTP/Builder/Loader.php @@ -113,7 +113,7 @@ private function getPutNode($index, $server, $path, $content, $mode): array new Node\Expr\ArrayDimFetch( new Node\Expr\PropertyFetch( new Node\Expr\Variable('this'), - new Node\Identifier('servers') + new Identifier('servers') ), new Node\Scalar\LNumber($index), ), @@ -124,7 +124,7 @@ private function getPutNode($index, $server, $path, $content, $mode): array new Node\Expr\ArrayDimFetch( new Node\Expr\PropertyFetch( new Node\Expr\Variable('this'), - new Node\Identifier('serversMapping') + new Identifier('serversMapping') ), dim: new Node\Scalar\LNumber($index), ), @@ -222,7 +222,7 @@ class: new Node\Stmt\Class_( ], 'stmts' => [ new Node\Stmt\ClassMethod( - name: new Node\Identifier('__construct'), + name: new Identifier('__construct'), subNodes: [ 'flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'params' => [ @@ -255,7 +255,7 @@ class: new Node\Stmt\Class_( new Node\Expr\ArrayDimFetch( new Node\Expr\PropertyFetch( new Node\Expr\Variable('this'), - new Node\Identifier('servers') + new Identifier('servers') ), new Node\Scalar\LNumber($index), ), @@ -269,7 +269,7 @@ class: new Node\Stmt\Class_( ], ), new Node\Stmt\ClassMethod( - name: new Node\Identifier('load'), + name: new Identifier('load'), subNodes: [ 'flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'stmts' => [ @@ -315,7 +315,7 @@ class: new Node\Name\FullyQualified('Kiboko\\Component\\Bucket\\ComplexResultBuc ], ), new Node\Stmt\ClassMethod( - name: new Node\Identifier('createDirectories'), + name: new Identifier('createDirectories'), subNodes: [ 'flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'returnType' => new Node\Expr\ConstFetch(new Node\Name('void')), @@ -528,7 +528,7 @@ public function compileCloseServers(): array new Node\Expr\ArrayDimFetch( var: new Node\Expr\PropertyFetch( var: new Node\Expr\Variable('this'), - name: new Node\Identifier('servers') + name: new Identifier('servers') ), dim: new Node\Scalar\LNumber($key), ), diff --git a/src/Plugin/Filtering/Factory/Drop.php b/src/Plugin/Filtering/Factory/Drop.php index 0736b536..4648a092 100644 --- a/src/Plugin/Filtering/Factory/Drop.php +++ b/src/Plugin/Filtering/Factory/Drop.php @@ -59,13 +59,13 @@ public function validate(array $config): bool /** * @throws Configurator\ConfigurationExceptionInterface */ - public function compile(array $config): Repository\Drop + public function compile(array $config): Filtering\Factory\Repository\Drop { $interpreter = clone $this->interpreter; $builder = new Filtering\Builder\Drop(); - $repository = new Repository\Drop($builder); + $repository = new Filtering\Factory\Repository\Drop($builder); foreach ($config as $condition) { $builder->withExclusions( diff --git a/src/Plugin/Filtering/Factory/Reject.php b/src/Plugin/Filtering/Factory/Reject.php index 73cb67a0..3de1a3c8 100644 --- a/src/Plugin/Filtering/Factory/Reject.php +++ b/src/Plugin/Filtering/Factory/Reject.php @@ -59,13 +59,13 @@ public function validate(array $config): bool /** * @throws Configurator\ConfigurationExceptionInterface */ - public function compile(array $config): Repository\Reject + public function compile(array $config): Filtering\Factory\Repository\Reject { $interpreter = clone $this->interpreter; $builder = new Filtering\Builder\Reject(); - $repository = new Repository\Reject($builder); + $repository = new Filtering\Factory\Repository\Reject($builder); foreach ($config as $condition) { $builder->withExclusions( diff --git a/src/Plugin/Filtering/Service.php b/src/Plugin/Filtering/Service.php index 8c04104b..364773a1 100644 --- a/src/Plugin/Filtering/Service.php +++ b/src/Plugin/Filtering/Service.php @@ -26,7 +26,7 @@ public function __construct( private ExpressionLanguage $interpreter = new Satellite\ExpressionLanguage() ) { $this->processor = new Processor(); - $this->configuration = new Configuration(); + $this->configuration = new Filtering\Configuration(); } public function interpreter(): ExpressionLanguage diff --git a/src/Plugin/SFTP/Factory/Extractor.php b/src/Plugin/SFTP/Factory/Extractor.php index dc4e97ed..0d5ea13d 100644 --- a/src/Plugin/SFTP/Factory/Extractor.php +++ b/src/Plugin/SFTP/Factory/Extractor.php @@ -63,7 +63,7 @@ public function compile(array $config): Repository && \is_array($config['loader']['servers']) ) { foreach ($config['loader']['servers'] as $server) { - $serverFactory = new Server($this->interpreter); + $serverFactory = new SFTP\Factory\Server($this->interpreter); $loader = $serverFactory->compile($server); $serverBuilder = $loader->getBuilder(); diff --git a/src/Plugin/SFTP/Factory/Loader.php b/src/Plugin/SFTP/Factory/Loader.php index e24b3611..6ef47e8b 100644 --- a/src/Plugin/SFTP/Factory/Loader.php +++ b/src/Plugin/SFTP/Factory/Loader.php @@ -63,7 +63,7 @@ public function compile(array $config): Repository && \is_array($config['loader']['servers']) ) { foreach ($config['loader']['servers'] as $server) { - $serverFactory = new Server($this->interpreter); + $serverFactory = new SFTP\Factory\Server($this->interpreter); $loader = $serverFactory->compile($server); $serverBuilder = $loader->getBuilder(); diff --git a/src/Runtime/RuntimeChoice.php b/src/Runtime/RuntimeChoice.php index 6e488822..3dccba45 100644 --- a/src/Runtime/RuntimeChoice.php +++ b/src/Runtime/RuntimeChoice.php @@ -17,7 +17,7 @@ public function __construct( ) { } - public function __invoke(array $configuration): RuntimeInterface + public function __invoke(array $configuration): Satellite\Runtime\RuntimeInterface { $satellite = ($this->adapterChoice)($configuration)->build(); diff --git a/src/Runtime/Workflow/Configuration.php b/src/Runtime/Workflow/Configuration.php index ce1f53b0..012a1c46 100644 --- a/src/Runtime/Workflow/Configuration.php +++ b/src/Runtime/Workflow/Configuration.php @@ -11,12 +11,12 @@ final readonly class Configuration implements Configurator\RuntimeConfigurationInterface { private Satellite\Runtime\Pipeline\Configuration $pipelineConfiguration; - private Satellite\Runtime\Workflow\Action\Configuration $actionConfiguration; + private Action\Configuration $actionConfiguration; public function __construct() { $this->pipelineConfiguration = new Satellite\Runtime\Pipeline\Configuration(); - $this->actionConfiguration = new Satellite\Runtime\Workflow\Action\Configuration(); + $this->actionConfiguration = new Action\Configuration(); } public function addPlugin(string $name, Configurator\PluginConfigurationInterface $plugin): self diff --git a/src/Service.php b/src/Service.php index 1f80032a..904b6f87 100644 --- a/src/Service.php +++ b/src/Service.php @@ -128,7 +128,7 @@ public function registerAdapters(Configurator\Adapter\FactoryInterface ...$adapt foreach (expectAttributes($adapter, Configurator\Adapter::class) as $attribute) { $this->addAdapter($attribute, $adapter); } - } catch (MissingAttributeException) { + } catch (Satellite\MissingAttributeException) { } } From e6e4fa4628cbfbeaf1de24535df5bb07297f1ddf Mon Sep 17 00:00:00 2001 From: sebprt Date: Tue, 16 Jan 2024 14:58:38 +0100 Subject: [PATCH 3/5] Updated included dependencies --- src/Service.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Service.php b/src/Service.php index 904b6f87..6fbb5210 100644 --- a/src/Service.php +++ b/src/Service.php @@ -238,12 +238,10 @@ private function compileWorkflow(array $config): Satellite\Builder\Repository\Wo 'php-etl/pipeline-contracts:>=0.5.1 <0.6', 'php-etl/action-contracts:>=0.2.0 <0.3', 'php-etl/workflow:*', - 'php-etl/console-state:*', 'php-etl/workflow-console-runtime:*', 'psr/log:*', 'monolog/monolog:*', 'symfony/dotenv:^6.0', - 'symfony/console:^6.0', 'symfony/dependency-injection:^6.0', ); @@ -338,11 +336,9 @@ private function compilePipelineJob(array $config): Satellite\Builder\Repository 'php-etl/satellite-contracts:>=0.1.1 <0.2', 'php-etl/pipeline-contracts:>=0.5.1 <0.6', 'php-etl/pipeline:*', - 'php-etl/console-state:*', 'php-etl/pipeline-console-runtime:*', 'psr/log:*', 'monolog/monolog:*', - 'symfony/console:^6.0', 'symfony/dotenv:^6.0', 'symfony/dependency-injection:^6.0', ); From 9d4046922e36d958017fd7a11e64d1436bbf1db4 Mon Sep 17 00:00:00 2001 From: sebprt Date: Tue, 16 Jan 2024 16:51:01 +0100 Subject: [PATCH 4/5] Improved the dependencies management --- src/Action/Custom/Service.php | 3 +++ src/Plugin/Custom/Service.php | 5 ++++- src/Service.php | 6 ++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Action/Custom/Service.php b/src/Action/Custom/Service.php index 4bd351ca..93c06dfc 100644 --- a/src/Action/Custom/Service.php +++ b/src/Action/Custom/Service.php @@ -13,6 +13,9 @@ #[Configurator\Action( name: 'custom', + dependencies: [ + 'symfony/dependency-injection:^6.0' + ], )] final readonly class Service implements Configurator\ActionInterface { diff --git a/src/Plugin/Custom/Service.php b/src/Plugin/Custom/Service.php index aeac335b..579512dd 100644 --- a/src/Plugin/Custom/Service.php +++ b/src/Plugin/Custom/Service.php @@ -13,11 +13,14 @@ #[Configurator\Pipeline( name: 'custom', + dependencies: [ + 'symfony/dependency-injection:^6.0' + ], steps: [ new Configurator\Pipeline\StepExtractor(), new Configurator\Pipeline\StepTransformer(), new Configurator\Pipeline\StepLoader(), - ], + ] )] final readonly class Service implements Configurator\PipelinePluginInterface { private Processor $processor; diff --git a/src/Service.php b/src/Service.php index 6fbb5210..e49b585c 100644 --- a/src/Service.php +++ b/src/Service.php @@ -241,8 +241,7 @@ private function compileWorkflow(array $config): Satellite\Builder\Repository\Wo 'php-etl/workflow-console-runtime:*', 'psr/log:*', 'monolog/monolog:*', - 'symfony/dotenv:^6.0', - 'symfony/dependency-injection:^6.0', + 'symfony/dotenv:^6.0' ); $repository->addFiles( @@ -339,8 +338,7 @@ private function compilePipelineJob(array $config): Satellite\Builder\Repository 'php-etl/pipeline-console-runtime:*', 'psr/log:*', 'monolog/monolog:*', - 'symfony/dotenv:^6.0', - 'symfony/dependency-injection:^6.0', + 'symfony/dotenv:^6.0' ); if (\array_key_exists('expression_language', $config['pipeline']) From 662f34d4aa1b512e2c47caf3835e7099c04ed84e Mon Sep 17 00:00:00 2001 From: sebprt Date: Wed, 17 Jan 2024 12:27:52 +0100 Subject: [PATCH 5/5] Ran php-cs-fixer --- src/Action/Custom/Service.php | 2 +- src/Plugin/Custom/Service.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Action/Custom/Service.php b/src/Action/Custom/Service.php index 93c06dfc..a7694a1c 100644 --- a/src/Action/Custom/Service.php +++ b/src/Action/Custom/Service.php @@ -14,7 +14,7 @@ #[Configurator\Action( name: 'custom', dependencies: [ - 'symfony/dependency-injection:^6.0' + 'symfony/dependency-injection:^6.0', ], )] final readonly class Service implements Configurator\ActionInterface diff --git a/src/Plugin/Custom/Service.php b/src/Plugin/Custom/Service.php index 579512dd..de5fdf72 100644 --- a/src/Plugin/Custom/Service.php +++ b/src/Plugin/Custom/Service.php @@ -14,7 +14,7 @@ #[Configurator\Pipeline( name: 'custom', dependencies: [ - 'symfony/dependency-injection:^6.0' + 'symfony/dependency-injection:^6.0', ], steps: [ new Configurator\Pipeline\StepExtractor(),