From c26c28d6fc38b04905644f86c6ee4e8ee885d40e Mon Sep 17 00:00:00 2001 From: sebprt Date: Tue, 16 Jan 2024 10:07:18 +0100 Subject: [PATCH 1/3] Ensures that the service used in the use option is public by default --- src/DependencyInjection/SatelliteDependencyInjection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DependencyInjection/SatelliteDependencyInjection.php b/src/DependencyInjection/SatelliteDependencyInjection.php index 1370c2d4..80509e93 100644 --- a/src/DependencyInjection/SatelliteDependencyInjection.php +++ b/src/DependencyInjection/SatelliteDependencyInjection.php @@ -93,7 +93,7 @@ public function __invoke(array $config): ContainerBuilder $definition->setFactory([$service['factory']['class'], $service['factory']['method']]); } - $definition->setPublic($service['public']); + $definition->setPublic($config['use'] === $identifier ? true : $service['public']); } } From a089f309a24528b53ba96a223a498c1784b0d167 Mon Sep 17 00:00:00 2001 From: sebprt Date: Tue, 16 Jan 2024 10:10:41 +0100 Subject: [PATCH 2/3] 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 4dbe781b..da9e6d77 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 105d446457dcda255ef2cf439eab46e9a37a548a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Parrat?= <47692802+sebprt@users.noreply.github.com> Date: Tue, 16 Jan 2024 11:09:57 +0100 Subject: [PATCH 3/3] Applied suggestion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Grégory PLANCHAT --- src/DependencyInjection/SatelliteDependencyInjection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DependencyInjection/SatelliteDependencyInjection.php b/src/DependencyInjection/SatelliteDependencyInjection.php index 80509e93..9ba45f57 100644 --- a/src/DependencyInjection/SatelliteDependencyInjection.php +++ b/src/DependencyInjection/SatelliteDependencyInjection.php @@ -93,7 +93,7 @@ public function __invoke(array $config): ContainerBuilder $definition->setFactory([$service['factory']['class'], $service['factory']['method']]); } - $definition->setPublic($config['use'] === $identifier ? true : $service['public']); + $definition->setPublic($config['use'] === $identifier || $service['public']); } }