From 7c6c206fe9b15f1acf4d5a0839c017665f320493 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 1 Dec 2023 15:59:12 +0100 Subject: [PATCH] cs-fixer + remove the PHP_CS_FIXER_IGNORE_ENV --- .github/workflows/quality.yaml | 2 +- src/Action/Custom/Factory/Action.php | 4 +- .../Factory/Repository/RepositoryTrait.php | 2 +- src/Action/Custom/Service.php | 4 +- src/Action/SFTP/Factory/Action.php | 6 +- .../SFTP/Factory/Repository/Repository.php | 2 +- src/Action/SFTP/Service.php | 4 +- src/Adapter/Composer.php | 9 +- src/Adapter/Docker/Satellite.php | 13 +- src/Adapter/Docker/SatelliteBuilder.php | 10 +- src/Adapter/Filesystem/Satellite.php | 4 +- src/Adapter/Filesystem/SatelliteBuilder.php | 10 +- src/Adapter/Tar/Satellite.php | 4 +- src/Adapter/Tar/SatelliteBuilder.php | 10 +- src/Builder/Action.php | 4 +- src/Builder/Pipeline.php | 24 +-- src/Builder/Repository/API.php | 2 +- src/Builder/Repository/Action.php | 2 +- src/Builder/Repository/Hook.php | 2 +- src/Builder/Repository/Pipeline.php | 2 +- src/Builder/Repository/Workflow.php | 2 +- src/Builder/Workflow.php | 3 +- src/Cloud/Console/Command/CreateCommand.php | 2 +- src/Cloud/Console/Command/RemoveCommand.php | 2 +- src/Cloud/Console/Command/UpdateCommand.php | 2 +- src/Console/Command/ApiRunCommand.php | 2 +- src/Console/Command/BuildCommand.php | 2 +- src/Console/Command/HookRunCommand.php | 2 +- src/Console/Command/PipelineRunCommand.php | 2 +- src/Console/Command/RunCommand.php | 153 +++++++++--------- src/Console/Command/ValidateCommand.php | 2 +- src/Console/Command/WorkflowRunCommand.php | 2 +- .../Builder/Monolog/ElasticSearchBuilder.php | 2 +- .../Logger/Factory/ElasticSearchFactory.php | 2 +- src/Feature/Logger/Factory/GelfFactory.php | 2 +- src/Feature/Logger/Factory/StreamFactory.php | 2 +- src/Feature/Logger/Factory/SyslogFactory.php | 2 +- src/Feature/Logger/RepositoryTrait.php | 2 +- src/Feature/Logger/Service.php | 4 +- .../Rejection/Factory/RabbitMQFactory.php | 2 +- src/Feature/Rejection/RepositoryTrait.php | 2 +- src/Feature/Rejection/Service.php | 4 +- src/Feature/State/RepositoryTrait.php | 2 +- src/Feature/State/Service.php | 2 +- src/Interpreter.php | 2 +- src/Pipeline/Extractor.php | 7 +- src/Pipeline/Loader.php | 7 +- src/Pipeline/Transformer.php | 7 +- src/Plugin/Batching/Repository.php | 6 +- src/Plugin/Batching/Service.php | 4 +- src/Plugin/Custom/Factory/Extractor.php | 4 +- src/Plugin/Custom/Factory/Loader.php | 4 +- .../Factory/Repository/RepositoryTrait.php | 2 +- src/Plugin/Custom/Factory/Transformer.php | 4 +- src/Plugin/Custom/Service.php | 4 +- src/Plugin/FTP/Factory/Loader.php | 6 +- .../FTP/Factory/Repository/Repository.php | 2 +- src/Plugin/FTP/Factory/Server.php | 6 +- src/Plugin/FTP/Service.php | 4 +- src/Plugin/Filtering/Factory/Drop.php | 4 +- src/Plugin/Filtering/Factory/Reject.php | 4 +- .../Factory/Repository/RepositoryTrait.php | 2 +- src/Plugin/Filtering/Service.php | 4 +- src/Plugin/SFTP/Factory/Extractor.php | 6 +- src/Plugin/SFTP/Factory/Loader.php | 6 +- .../SFTP/Factory/Repository/Repository.php | 2 +- src/Plugin/SFTP/Factory/Server.php | 6 +- src/Plugin/SFTP/Service.php | 4 +- src/Plugin/Stream/Repository.php | 6 +- src/Plugin/Stream/Service.php | 4 +- src/Service.php | 6 +- 71 files changed, 225 insertions(+), 222 deletions(-) diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index 81e014bd..75470482 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -14,7 +14,7 @@ jobs: run: | wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer chmod a+x php-cs-fixer - PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run + ./php-cs-fixer fix src --dry-run phpstan: runs-on: ubuntu-latest diff --git a/src/Action/Custom/Factory/Action.php b/src/Action/Custom/Factory/Action.php index 29279a9c..eb70c1ec 100644 --- a/src/Action/Custom/Factory/Action.php +++ b/src/Action/Custom/Factory/Action.php @@ -44,7 +44,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -55,7 +55,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } diff --git a/src/Action/Custom/Factory/Repository/RepositoryTrait.php b/src/Action/Custom/Factory/Repository/RepositoryTrait.php index 200ef6c0..447d6fa4 100644 --- a/src/Action/Custom/Factory/Repository/RepositoryTrait.php +++ b/src/Action/Custom/Factory/Repository/RepositoryTrait.php @@ -14,7 +14,7 @@ trait RepositoryTrait /** @var string[] */ private array $packages; - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): Configurator\RepositoryInterface + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): Configurator\RepositoryInterface { array_push($this->files, ...$files); diff --git a/src/Action/Custom/Service.php b/src/Action/Custom/Service.php index be6c7550..4bd351ca 100644 --- a/src/Action/Custom/Service.php +++ b/src/Action/Custom/Service.php @@ -43,7 +43,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -54,7 +54,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } diff --git a/src/Action/SFTP/Factory/Action.php b/src/Action/SFTP/Factory/Action.php index 03a51221..968853a7 100644 --- a/src/Action/SFTP/Factory/Action.php +++ b/src/Action/SFTP/Factory/Action.php @@ -39,7 +39,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -50,7 +50,7 @@ public function validate(array $config): bool $this->normalize($config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } @@ -68,7 +68,7 @@ public function compile(array $config): Repository try { return new Repository($builder); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException(message: $exception->getMessage(), previous: $exception); } } diff --git a/src/Action/SFTP/Factory/Repository/Repository.php b/src/Action/SFTP/Factory/Repository/Repository.php index 278c67dd..30614486 100644 --- a/src/Action/SFTP/Factory/Repository/Repository.php +++ b/src/Action/SFTP/Factory/Repository/Repository.php @@ -12,7 +12,7 @@ { public function __construct(private Builder\Action $builder) {} - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): self + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): self { return $this; } diff --git a/src/Action/SFTP/Service.php b/src/Action/SFTP/Service.php index 9255277d..53385fa1 100644 --- a/src/Action/SFTP/Service.php +++ b/src/Action/SFTP/Service.php @@ -45,7 +45,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -56,7 +56,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } diff --git a/src/Adapter/Composer.php b/src/Adapter/Composer.php index 0760c803..611c5de7 100644 --- a/src/Adapter/Composer.php +++ b/src/Adapter/Composer.php @@ -8,6 +8,7 @@ use Psr\Log\LoggerInterface; use React\ChildProcess\Process; use React\Promise\Deferred; + use function React\Async\await; use function React\Promise\Timer\timeout; @@ -28,16 +29,16 @@ private function execute(Process $process, float $timeout = 300): void { $process->start(); - $process->stdout->on('data', function ($chunk) { + $process->stdout->on('data', function ($chunk): void { $this->logger->debug($chunk); }); - $process->stderr->on('data', function ($chunk) { + $process->stderr->on('data', function ($chunk): void { $this->logger->info($chunk); }); $deferred = new Deferred(); - $process->on('exit', function () use ($deferred) { + $process->on('exit', function () use ($deferred): void { $deferred->resolve(); }); @@ -53,7 +54,7 @@ private function execute(Process $process, float $timeout = 300): void private function command(string ...$command): void { $process = new Process( - implode (' ', array_map(fn ($part) => escapeshellarg($part), $command)), + implode(' ', array_map(fn ($part) => escapeshellarg($part), $command)), $this->workdir, ); diff --git a/src/Adapter/Docker/Satellite.php b/src/Adapter/Docker/Satellite.php index a2e7bec4..81524009 100644 --- a/src/Adapter/Docker/Satellite.php +++ b/src/Adapter/Docker/Satellite.php @@ -13,6 +13,7 @@ use React\ChildProcess\Process; use React\Promise\Deferred; use React\Stream\ReadableResourceStream; + use function React\Async\await; use function React\Promise\Timer\timeout; @@ -27,7 +28,7 @@ final class Satellite implements Configurator\SatelliteInterface public function __construct( private readonly Dockerfile\Dockerfile $dockerfile, private readonly string $workdir, - Packaging\FileInterface|Packaging\DirectoryInterface ...$files + Packaging\DirectoryInterface|Packaging\FileInterface ...$files ) { $this->files = $files; } @@ -39,7 +40,7 @@ public function addTags(string ...$imageTags): self return $this; } - public function withFile(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): self + public function withFile(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): self { array_push($this->files, ...$files); @@ -73,7 +74,7 @@ public function build( $command = ['docker', 'build', '--rm', '-', ...iterator_to_array($iterator($this->imageTags))]; $process = new Process( - implode (' ', array_map(fn (string $part) => escapeshellarg($part), $command)), + implode(' ', array_map(fn (string $part) => escapeshellarg($part), $command)), $this->workdir, ); @@ -95,16 +96,16 @@ private function execute( Process $process, float $timeout = 300 ): void { - $process->stdout->on('data', function ($chunk) use ($logger) { + $process->stdout->on('data', function ($chunk) use ($logger): void { $logger->debug($chunk); }); - $process->stderr->on('data', function ($chunk) use ($logger) { + $process->stderr->on('data', function ($chunk) use ($logger): void { $logger->info($chunk); }); $deferred = new Deferred(); - $process->on('exit', function () use ($deferred) { + $process->on('exit', function () use ($deferred): void { $deferred->resolve(); }); diff --git a/src/Adapter/Docker/SatelliteBuilder.php b/src/Adapter/Docker/SatelliteBuilder.php index a5b71496..1ad2594c 100644 --- a/src/Adapter/Docker/SatelliteBuilder.php +++ b/src/Adapter/Docker/SatelliteBuilder.php @@ -23,8 +23,8 @@ final class SatelliteBuilder implements Configurator\SatelliteBuilderInterface private iterable $command = []; /** @var iterable */ private iterable $tags = []; - private null|PackagingContract\FileInterface|PackagingContract\AssetInterface $composerJsonFile = null; - private null|PackagingContract\FileInterface|PackagingContract\AssetInterface $composerLockFile = null; + private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile = null; + private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null; /** @var iterable> */ private iterable $paths = []; /** @var \AppendIterator> */ @@ -66,8 +66,8 @@ public function withComposerRequire(string ...$package): self } public function withComposerFile( - PackagingContract\FileInterface|PackagingContract\AssetInterface $composerJsonFile, - PackagingContract\FileInterface|PackagingContract\AssetInterface $composerLockFile = null + PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile, + PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null ): self { $this->composerJsonFile = $composerJsonFile; $this->composerLockFile = $composerLockFile; @@ -76,7 +76,7 @@ public function withComposerFile( } public function withFile( - PackagingContract\FileInterface|PackagingContract\AssetInterface $source, + PackagingContract\AssetInterface|PackagingContract\FileInterface $source, string $destinationPath = null ): self { if (!$source instanceof PackagingContract\FileInterface) { diff --git a/src/Adapter/Filesystem/Satellite.php b/src/Adapter/Filesystem/Satellite.php index 092aaadb..d8edbc01 100644 --- a/src/Adapter/Filesystem/Satellite.php +++ b/src/Adapter/Filesystem/Satellite.php @@ -18,12 +18,12 @@ final class Satellite implements Configurator\SatelliteInterface public function __construct( private readonly string $workdir, private readonly Composer $composer, - Packaging\FileInterface|Packaging\DirectoryInterface ...$files + Packaging\DirectoryInterface|Packaging\FileInterface ...$files ) { $this->files = $files; } - public function withFile(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): self + public function withFile(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): self { array_push($this->files, ...$files); diff --git a/src/Adapter/Filesystem/SatelliteBuilder.php b/src/Adapter/Filesystem/SatelliteBuilder.php index a7ce0409..1a400c38 100644 --- a/src/Adapter/Filesystem/SatelliteBuilder.php +++ b/src/Adapter/Filesystem/SatelliteBuilder.php @@ -20,8 +20,8 @@ final class SatelliteBuilder implements Configurator\SatelliteBuilderInterface ]; private array $authenticationTokens = []; private array $repositories = []; - private null|PackagingContract\FileInterface|PackagingContract\AssetInterface $composerJsonFile = null; - private null|PackagingContract\FileInterface|PackagingContract\AssetInterface $composerLockFile = null; + private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile = null; + private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null; /** @var iterable> */ private iterable $paths = []; /** @var \AppendIterator> */ @@ -54,8 +54,8 @@ public function withComposerRequire(string ...$package): self } public function withComposerFile( - PackagingContract\FileInterface|PackagingContract\AssetInterface $composerJsonFile, - PackagingContract\FileInterface|PackagingContract\AssetInterface $composerLockFile = null + PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile, + PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null ): self { $this->composerJsonFile = $composerJsonFile; $this->composerLockFile = $composerLockFile; @@ -64,7 +64,7 @@ public function withComposerFile( } public function withFile( - PackagingContract\FileInterface|PackagingContract\AssetInterface $source, + PackagingContract\AssetInterface|PackagingContract\FileInterface $source, string $destinationPath = null ): self { if (!$source instanceof PackagingContract\FileInterface) { diff --git a/src/Adapter/Tar/Satellite.php b/src/Adapter/Tar/Satellite.php index e80c81b9..2eb47e88 100644 --- a/src/Adapter/Tar/Satellite.php +++ b/src/Adapter/Tar/Satellite.php @@ -19,7 +19,7 @@ final class Satellite implements Configurator\SatelliteInterface public function __construct( private readonly string $outputPath, - Packaging\FileInterface|Packaging\DirectoryInterface ...$files + Packaging\DirectoryInterface|Packaging\FileInterface ...$files ) { $this->files = $files; } @@ -31,7 +31,7 @@ public function addTags(string ...$imageTags): self return $this; } - public function withFile(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): self + public function withFile(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): self { array_push($this->files, ...$files); diff --git a/src/Adapter/Tar/SatelliteBuilder.php b/src/Adapter/Tar/SatelliteBuilder.php index c65ac1c7..68c89afd 100644 --- a/src/Adapter/Tar/SatelliteBuilder.php +++ b/src/Adapter/Tar/SatelliteBuilder.php @@ -13,8 +13,8 @@ final class SatelliteBuilder implements Configurator\SatelliteBuilderInterface { /** @var iterable */ private iterable $composerRequire = []; - private null|PackagingContract\FileInterface|PackagingContract\AssetInterface $composerJsonFile = null; - private null|PackagingContract\FileInterface|PackagingContract\AssetInterface $composerLockFile = null; + private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile = null; + private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null; /** @var \AppendIterator> */ private readonly iterable $files; /** @var array> */ @@ -47,8 +47,8 @@ public function withComposerRequire(string ...$package): self } public function withComposerFile( - PackagingContract\FileInterface|PackagingContract\AssetInterface $composerJsonFile, - PackagingContract\FileInterface|PackagingContract\AssetInterface $composerLockFile = null + PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile, + PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null ): self { $this->composerJsonFile = $composerJsonFile; $this->composerLockFile = $composerLockFile; @@ -57,7 +57,7 @@ public function withComposerFile( } public function withFile( - PackagingContract\FileInterface|PackagingContract\AssetInterface $source, + PackagingContract\AssetInterface|PackagingContract\FileInterface $source, string $destinationPath = null ): self { if (!$source instanceof PackagingContract\FileInterface) { diff --git a/src/Builder/Action.php b/src/Builder/Action.php index fea89225..3bcc2282 100644 --- a/src/Builder/Action.php +++ b/src/Builder/Action.php @@ -16,8 +16,8 @@ public function __construct( ) {} public function addAction( - Node\Expr|Builder $loader, - Node\Expr|Builder $state, + Builder|Node\Expr $loader, + Builder|Node\Expr $state, ): self { $this->action = new Node\Expr\MethodCall( var: $this->runtime, diff --git a/src/Builder/Pipeline.php b/src/Builder/Pipeline.php index bd36e5af..22a90add 100644 --- a/src/Builder/Pipeline.php +++ b/src/Builder/Pipeline.php @@ -16,10 +16,10 @@ public function __construct( ) {} public function addExtractor( - Node\Expr|Builder $code, - Node\Expr|Builder $extractor, - Node\Expr|Builder $rejection, - Node\Expr|Builder $state, + Builder|Node\Expr $code, + Builder|Node\Expr $extractor, + Builder|Node\Expr $rejection, + Builder|Node\Expr $state, ): self { $this->steps[] = fn (Node\Expr $runtime) => new Node\Expr\MethodCall( var: $runtime, @@ -36,10 +36,10 @@ public function addExtractor( } public function addTransformer( - Node\Expr|Builder $code, - Node\Expr|Builder $transformer, - Node\Expr|Builder $rejection, - Node\Expr|Builder $state, + Builder|Node\Expr $code, + Builder|Node\Expr $transformer, + Builder|Node\Expr $rejection, + Builder|Node\Expr $state, ): self { $this->steps[] = fn (Node\Expr $runtime) => new Node\Expr\MethodCall( var: $runtime, @@ -56,10 +56,10 @@ public function addTransformer( } public function addLoader( - Node\Expr|Builder $code, - Node\Expr|Builder $loader, - Node\Expr|Builder $rejection, - Node\Expr|Builder $state, + Builder|Node\Expr $code, + Builder|Node\Expr $loader, + Builder|Node\Expr $rejection, + Builder|Node\Expr $state, ): self { $this->steps[] = fn (Node\Expr $runtime) => new Node\Expr\MethodCall( var: $runtime, diff --git a/src/Builder/Repository/API.php b/src/Builder/Repository/API.php index 6f084207..ec96aca5 100644 --- a/src/Builder/Repository/API.php +++ b/src/Builder/Repository/API.php @@ -17,7 +17,7 @@ final class API implements Configurator\RepositoryInterface public function __construct(private readonly Satellite\Builder\API $builder) {} - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): Configurator\RepositoryInterface + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): Configurator\RepositoryInterface { array_push($this->files, ...$files); diff --git a/src/Builder/Repository/Action.php b/src/Builder/Repository/Action.php index 807566ea..be8a0e73 100644 --- a/src/Builder/Repository/Action.php +++ b/src/Builder/Repository/Action.php @@ -17,7 +17,7 @@ final class Action implements Configurator\RepositoryInterface public function __construct(private readonly Satellite\Builder\Action $builder) {} - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): Configurator\RepositoryInterface + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): Configurator\RepositoryInterface { array_push($this->files, ...$files); diff --git a/src/Builder/Repository/Hook.php b/src/Builder/Repository/Hook.php index 849f88a6..d7d56b3a 100644 --- a/src/Builder/Repository/Hook.php +++ b/src/Builder/Repository/Hook.php @@ -17,7 +17,7 @@ final class Hook implements Configurator\RepositoryInterface public function __construct(private readonly Satellite\Builder\Hook $builder) {} - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): Configurator\RepositoryInterface + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): Configurator\RepositoryInterface { array_push($this->files, ...$files); diff --git a/src/Builder/Repository/Pipeline.php b/src/Builder/Repository/Pipeline.php index ac171e2d..2d82a798 100644 --- a/src/Builder/Repository/Pipeline.php +++ b/src/Builder/Repository/Pipeline.php @@ -17,7 +17,7 @@ final class Pipeline implements Configurator\RepositoryInterface public function __construct(private readonly Satellite\Builder\Pipeline $builder) {} - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): Configurator\RepositoryInterface + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): Configurator\RepositoryInterface { array_push($this->files, ...$files); diff --git a/src/Builder/Repository/Workflow.php b/src/Builder/Repository/Workflow.php index 23aac5b6..f4516fe6 100644 --- a/src/Builder/Repository/Workflow.php +++ b/src/Builder/Repository/Workflow.php @@ -17,7 +17,7 @@ final class Workflow implements Configurator\RepositoryInterface public function __construct(private readonly Satellite\Builder\Workflow $builder) {} - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): Configurator\RepositoryInterface + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): Configurator\RepositoryInterface { array_push($this->files, ...$files); diff --git a/src/Builder/Workflow.php b/src/Builder/Workflow.php index cf03177d..a815d2ef 100644 --- a/src/Builder/Workflow.php +++ b/src/Builder/Workflow.php @@ -15,7 +15,8 @@ public function __construct( private readonly Node\Expr $runtime ) {} - public function addPipeline(string $code, string $pipelineFilename): self { + public function addPipeline(string $code, string $pipelineFilename): self + { $this->jobs[] = fn (Node\Expr $runtime) => new Node\Expr\MethodCall( var: $runtime, name: new Node\Identifier('job'), diff --git a/src/Cloud/Console/Command/CreateCommand.php b/src/Cloud/Console/Command/CreateCommand.php index 834c6ae9..c3446ba4 100644 --- a/src/Cloud/Console/Command/CreateCommand.php +++ b/src/Cloud/Console/Command/CreateCommand.php @@ -82,7 +82,7 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O try { $configuration = $service->normalize($configuration); - } catch (Config\Definition\Exception\InvalidTypeException|Config\Definition\Exception\InvalidConfigurationException $exception) { + } catch (Config\Definition\Exception\InvalidConfigurationException|Config\Definition\Exception\InvalidTypeException $exception) { $style->error($exception->getMessage()); return self::FAILURE; diff --git a/src/Cloud/Console/Command/RemoveCommand.php b/src/Cloud/Console/Command/RemoveCommand.php index 6608d1f8..f48e1ae7 100644 --- a/src/Cloud/Console/Command/RemoveCommand.php +++ b/src/Cloud/Console/Command/RemoveCommand.php @@ -82,7 +82,7 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O try { $configuration = $service->normalize($configuration); - } catch (Config\Definition\Exception\InvalidTypeException|Config\Definition\Exception\InvalidConfigurationException $exception) { + } catch (Config\Definition\Exception\InvalidConfigurationException|Config\Definition\Exception\InvalidTypeException $exception) { $style->error($exception->getMessage()); return self::FAILURE; diff --git a/src/Cloud/Console/Command/UpdateCommand.php b/src/Cloud/Console/Command/UpdateCommand.php index 4fcd5e77..7fb93962 100644 --- a/src/Cloud/Console/Command/UpdateCommand.php +++ b/src/Cloud/Console/Command/UpdateCommand.php @@ -82,7 +82,7 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O try { $configuration = $service->normalize($configuration); - } catch (Config\Definition\Exception\InvalidTypeException|Config\Definition\Exception\InvalidConfigurationException $exception) { + } catch (Config\Definition\Exception\InvalidConfigurationException|Config\Definition\Exception\InvalidTypeException $exception) { $style->error($exception->getMessage()); return self::FAILURE; diff --git a/src/Console/Command/ApiRunCommand.php b/src/Console/Command/ApiRunCommand.php index 459b71c2..72a4febf 100644 --- a/src/Console/Command/ApiRunCommand.php +++ b/src/Console/Command/ApiRunCommand.php @@ -25,7 +25,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $style->warning([ 'The command "run:hook is deprecated and will be removed in future releases.', - 'Please use the "run" command as a replacement.' + 'Please use the "run" command as a replacement.', ]); return parent::execute($input, $output); diff --git a/src/Console/Command/BuildCommand.php b/src/Console/Command/BuildCommand.php index 5e6ad29c..2d1487b9 100644 --- a/src/Console/Command/BuildCommand.php +++ b/src/Console/Command/BuildCommand.php @@ -67,7 +67,7 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O try { $configuration = $service->normalize($configuration); - } catch (Config\Definition\Exception\InvalidTypeException|Config\Definition\Exception\InvalidConfigurationException $exception) { + } catch (Config\Definition\Exception\InvalidConfigurationException|Config\Definition\Exception\InvalidTypeException $exception) { $style->error($exception->getMessage()); return 255; diff --git a/src/Console/Command/HookRunCommand.php b/src/Console/Command/HookRunCommand.php index 0def78ba..3a7033f3 100644 --- a/src/Console/Command/HookRunCommand.php +++ b/src/Console/Command/HookRunCommand.php @@ -25,7 +25,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $style->warning([ 'The command "run:hook is deprecated and will be removed in future releases.', - 'Please use the "run" command as a replacement.' + 'Please use the "run" command as a replacement.', ]); return parent::execute($input, $output); diff --git a/src/Console/Command/PipelineRunCommand.php b/src/Console/Command/PipelineRunCommand.php index 85925091..e41eff36 100644 --- a/src/Console/Command/PipelineRunCommand.php +++ b/src/Console/Command/PipelineRunCommand.php @@ -25,7 +25,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $style->warning([ 'The command "run:pipeline is deprecated and will be removed in future releases.', - 'Please use the "run" command as a replacement.' + 'Please use the "run" command as a replacement.', ]); return parent::execute($input, $output); diff --git a/src/Console/Command/RunCommand.php b/src/Console/Command/RunCommand.php index 1a5ac69a..ffaeca5f 100644 --- a/src/Console/Command/RunCommand.php +++ b/src/Console/Command/RunCommand.php @@ -10,6 +10,7 @@ use Symfony\Component\Console; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; + use function React\Async\await; #[Console\Attribute\AsCommand('run', 'Run a data flow satellite (pipeline or workflow).')] @@ -40,16 +41,17 @@ protected function execute(InputInterface $input, OutputInterface $output): int $style->writeln(sprintf('Running pipeline in %s', $input->getArgument('path'))); $process = $this->pipelineWorker($style, $cwd, $input->getArgument('path'), 'pipeline.php'); - } else if (file_exists('workflow.php')) { + } elseif (file_exists('workflow.php')) { $style->writeln(sprintf('Running workflow in %s', $input->getArgument('path'))); $process = $this->workflowWorker($style, $cwd, $input->getArgument('path'), 'workflow.php'); - } else if (file_exists('main.php')) { + } elseif (file_exists('main.php')) { $style->writeln(sprintf('Running API in %s', $input->getArgument('path'))); $process = $this->httpWorker($style, $cwd, $input->getArgument('path'), 'main.php'); } else { $style->error('The provided path does not contain either a workflow or a pipeline satellite, did you mean to run "run:api"?'); + return Console\Command\Command::FAILURE; } @@ -68,49 +70,49 @@ protected function execute(InputInterface $input, OutputInterface $output): int private function pipelineWorker(Console\Style\SymfonyStyle $style, string $cwd, string $path, string $entrypoint): Process { - $source =<<addClassMap([ - /* @phpstan-ignore-next-line */ - \ProjectServiceContainer::class => 'container.php', - ]); - \$autoload->register(); + $source = <<addClassMap([ + /* @phpstan-ignore-next-line */ + \\ProjectServiceContainer::class => 'container.php', + ]); + \$autoload->register(); - \$dotenv = new \Symfony\Component\Dotenv\Dotenv(); - \$dotenv->usePutenv(); - - if (file_exists(\$file = '{$cwd}/.env')) { - \$dotenv->loadEnv(\$file); - } - if (file_exists(\$file = '{$cwd}/{$path}/.env')) { - \$dotenv->loadEnv(\$file); - } + \$dotenv = new \\Symfony\\Component\\Dotenv\\Dotenv(); + \$dotenv->usePutenv(); + + if (file_exists(\$file = '{$cwd}/.env')) { + \$dotenv->loadEnv(\$file); + } + if (file_exists(\$file = '{$cwd}/{$path}/.env')) { + \$dotenv->loadEnv(\$file); + } - \$runtime = new \Kiboko\Component\Runtime\Pipeline\Console( - new \Symfony\Component\Console\Output\ConsoleOutput(), - new \Kiboko\Component\Pipeline\Pipeline( - new \Kiboko\Component\Pipeline\PipelineRunner( - new \Psr\Log\NullLogger() + \$runtime = new \\Kiboko\\Component\\Runtime\\Pipeline\\Console( + new \\Symfony\\Component\\Console\\Output\\ConsoleOutput(), + new \\Kiboko\\Component\\Pipeline\\Pipeline( + new \\Kiboko\\Component\\Pipeline\\PipelineRunner( + new \\Psr\\Log\\NullLogger() + ), + new \\Kiboko\\Contract\\Pipeline\\NullState(), ), - new \Kiboko\Contract\Pipeline\NullState(), - ), - ); + ); - \$satellite = include '{$cwd}/{$path}/$entrypoint'; + \$satellite = include '{$cwd}/{$path}/{$entrypoint}'; - \$satellite(\$runtime); - \$runtime->run(); + \$satellite(\$runtime); + \$runtime->run(); - \$autoload->unregister(); - PHP; + \$autoload->unregister(); + PHP; $stream = fopen('php://temp', 'r+'); fwrite($stream, $source); - fseek($stream, 0, SEEK_SET); + fseek($stream, 0, \SEEK_SET); $input = new ReadableResourceStream($stream); @@ -126,10 +128,10 @@ private function pipelineWorker(Console\Style\SymfonyStyle $style, string $cwd, $process->start(); - $process->stdout->on('data', function ($chunk) use ($style) { + $process->stdout->on('data', function ($chunk) use ($style): void { $style->text($chunk); }); - $process->stderr->on('data', function ($chunk) use ($style) { + $process->stderr->on('data', function ($chunk) use ($style): void { $style->info($chunk); }); @@ -140,46 +142,46 @@ private function pipelineWorker(Console\Style\SymfonyStyle $style, string $cwd, private function workflowWorker(Console\Style\SymfonyStyle $style, string $cwd, string $path, string $entrypoint): Process { - $source =<<addClassMap([ - /* @phpstan-ignore-next-line */ - \ProjectServiceContainer::class => 'container.php', - ]); - \$autoload->register(); + $source = <<addClassMap([ + /* @phpstan-ignore-next-line */ + \\ProjectServiceContainer::class => 'container.php', + ]); + \$autoload->register(); - \$dotenv = new \Symfony\Component\Dotenv\Dotenv(); - \$dotenv->usePutenv(); - - if (file_exists(\$file = '{$cwd}/.env')) { - \$dotenv->loadEnv(\$file); - } - if (file_exists(\$file = '{$cwd}/{$path}/.env')) { - \$dotenv->loadEnv(\$file); - } - - \$runtime = new \Kiboko\Component\Runtime\Workflow\Console( - new \Symfony\Component\Console\Output\ConsoleOutput(), - new \Kiboko\Component\Pipeline\PipelineRunner( - new \Psr\Log\NullLogger() - ), - ); + \$dotenv = new \\Symfony\\Component\\Dotenv\\Dotenv(); + \$dotenv->usePutenv(); + + if (file_exists(\$file = '{$cwd}/.env')) { + \$dotenv->loadEnv(\$file); + } + if (file_exists(\$file = '{$cwd}/{$path}/.env')) { + \$dotenv->loadEnv(\$file); + } + + \$runtime = new \\Kiboko\\Component\\Runtime\\Workflow\\Console( + new \\Symfony\\Component\\Console\\Output\\ConsoleOutput(), + new \\Kiboko\\Component\\Pipeline\\PipelineRunner( + new \\Psr\\Log\\NullLogger() + ), + ); - \$satellite = include '{$cwd}/{$path}/$entrypoint'; + \$satellite = include '{$cwd}/{$path}/{$entrypoint}'; - \$satellite(\$runtime); - \$runtime->run(); + \$satellite(\$runtime); + \$runtime->run(); - \$autoload->unregister(); - PHP; + \$autoload->unregister(); + PHP; $stream = fopen('php://temp', 'r+'); fwrite($stream, $source); - fseek($stream, 0, SEEK_SET); + fseek($stream, 0, \SEEK_SET); $input = new ReadableResourceStream($stream); @@ -195,10 +197,10 @@ private function workflowWorker(Console\Style\SymfonyStyle $style, string $cwd, $process->start(); - $process->stdout->on('data', function ($chunk) use ($style) { + $process->stdout->on('data', function ($chunk) use ($style): void { $style->text($chunk); }); - $process->stderr->on('data', function ($chunk) use ($style) { + $process->stderr->on('data', function ($chunk) use ($style): void { $style->info($chunk); }); @@ -213,7 +215,7 @@ private function httpWorker(Console\Style\SymfonyStyle $style, string $cwd, stri $command = ['php', '-S', 'localhost:8000', $entrypoint]; - $process = new Process(implode (' ', array_map(fn ($part) => escapeshellarg($part), $command)), $cwd.'/'.$path); + $process = new Process(implode(' ', array_map(fn ($part) => escapeshellarg($part), $command)), $cwd.'/'.$path); $process->start(); @@ -262,7 +264,7 @@ private function executeWorker( ): bool { $deferred = new Deferred(); - $process->on('exit', function () use ($deferred) { + $process->on('exit', function () use ($deferred): void { $deferred->resolve(); }); @@ -272,6 +274,7 @@ private function executeWorker( if (0 !== $process->getExitCode()) { $style->error(sprintf('Process exited unexpectedly with exit code %d', $process->getExitCode())); + return false; } diff --git a/src/Console/Command/ValidateCommand.php b/src/Console/Command/ValidateCommand.php index e342d78c..2ae8db02 100644 --- a/src/Console/Command/ValidateCommand.php +++ b/src/Console/Command/ValidateCommand.php @@ -66,7 +66,7 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O try { $configuration = $service->normalize($configuration); - } catch (Config\Definition\Exception\InvalidTypeException|Config\Definition\Exception\InvalidConfigurationException $exception) { + } catch (Config\Definition\Exception\InvalidConfigurationException|Config\Definition\Exception\InvalidTypeException $exception) { $style->error($exception->getMessage()); return 255; diff --git a/src/Console/Command/WorkflowRunCommand.php b/src/Console/Command/WorkflowRunCommand.php index 75cda29f..9b6d9720 100644 --- a/src/Console/Command/WorkflowRunCommand.php +++ b/src/Console/Command/WorkflowRunCommand.php @@ -25,7 +25,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $style->warning([ 'The command "run:pipeline is deprecated and will be removed in future releases.', - 'Please use the "run" command as a replacement.' + 'Please use the "run" command as a replacement.', ]); return parent::execute($input, $output); diff --git a/src/Feature/Logger/Builder/Monolog/ElasticSearchBuilder.php b/src/Feature/Logger/Builder/Monolog/ElasticSearchBuilder.php index 1bb4018a..be01985f 100644 --- a/src/Feature/Logger/Builder/Monolog/ElasticSearchBuilder.php +++ b/src/Feature/Logger/Builder/Monolog/ElasticSearchBuilder.php @@ -34,7 +34,7 @@ public function withIndex(string $index): self return $this; } - public function withHosts(string|array|Expression ...$hosts): self + public function withHosts(array|Expression|string ...$hosts): self { array_push($this->hosts, ...$hosts); diff --git a/src/Feature/Logger/Factory/ElasticSearchFactory.php b/src/Feature/Logger/Factory/ElasticSearchFactory.php index 366bdcf0..7e265448 100644 --- a/src/Feature/Logger/Factory/ElasticSearchFactory.php +++ b/src/Feature/Logger/Factory/ElasticSearchFactory.php @@ -36,7 +36,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } diff --git a/src/Feature/Logger/Factory/GelfFactory.php b/src/Feature/Logger/Factory/GelfFactory.php index 132872ef..c7017afe 100644 --- a/src/Feature/Logger/Factory/GelfFactory.php +++ b/src/Feature/Logger/Factory/GelfFactory.php @@ -33,7 +33,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } diff --git a/src/Feature/Logger/Factory/StreamFactory.php b/src/Feature/Logger/Factory/StreamFactory.php index 2886bac7..0048058d 100644 --- a/src/Feature/Logger/Factory/StreamFactory.php +++ b/src/Feature/Logger/Factory/StreamFactory.php @@ -33,7 +33,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } diff --git a/src/Feature/Logger/Factory/SyslogFactory.php b/src/Feature/Logger/Factory/SyslogFactory.php index 7bf4b8f5..9d2ad46c 100644 --- a/src/Feature/Logger/Factory/SyslogFactory.php +++ b/src/Feature/Logger/Factory/SyslogFactory.php @@ -33,7 +33,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } diff --git a/src/Feature/Logger/RepositoryTrait.php b/src/Feature/Logger/RepositoryTrait.php index ed522a90..f2d6ae88 100644 --- a/src/Feature/Logger/RepositoryTrait.php +++ b/src/Feature/Logger/RepositoryTrait.php @@ -14,7 +14,7 @@ trait RepositoryTrait /** @var string[] */ private array $packages; - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): self + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): self { array_push($this->files, ...$files); diff --git a/src/Feature/Logger/Service.php b/src/Feature/Logger/Service.php index 7e1af794..9de85707 100644 --- a/src/Feature/Logger/Service.php +++ b/src/Feature/Logger/Service.php @@ -42,7 +42,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -158,7 +158,7 @@ public function compile(array $config): Repository $builder->withLogger($monologBuilder->getNode()); return $repository; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException(message: $exception->getMessage(), previous: $exception); } } diff --git a/src/Feature/Rejection/Factory/RabbitMQFactory.php b/src/Feature/Rejection/Factory/RabbitMQFactory.php index 2f785ba9..7de68b4f 100644 --- a/src/Feature/Rejection/Factory/RabbitMQFactory.php +++ b/src/Feature/Rejection/Factory/RabbitMQFactory.php @@ -38,7 +38,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } diff --git a/src/Feature/Rejection/RepositoryTrait.php b/src/Feature/Rejection/RepositoryTrait.php index c0545d79..118dc131 100644 --- a/src/Feature/Rejection/RepositoryTrait.php +++ b/src/Feature/Rejection/RepositoryTrait.php @@ -14,7 +14,7 @@ trait RepositoryTrait /** @var string[] */ private array $packages; - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): self + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): self { array_push($this->files, ...$files); diff --git a/src/Feature/Rejection/Service.php b/src/Feature/Rejection/Service.php index 9a10e741..3296a24a 100644 --- a/src/Feature/Rejection/Service.php +++ b/src/Feature/Rejection/Service.php @@ -41,7 +41,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -82,7 +82,7 @@ public function compile(array $config): Repository } return $repository; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException(message: $exception->getMessage(), previous: $exception); } } diff --git a/src/Feature/State/RepositoryTrait.php b/src/Feature/State/RepositoryTrait.php index 1d0943d6..c2f89736 100644 --- a/src/Feature/State/RepositoryTrait.php +++ b/src/Feature/State/RepositoryTrait.php @@ -14,7 +14,7 @@ trait RepositoryTrait /** @var string[] */ private array $packages; - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): self + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): self { array_push($this->files, ...$files); diff --git a/src/Feature/State/Service.php b/src/Feature/State/Service.php index 72720cba..7b6cf1b5 100644 --- a/src/Feature/State/Service.php +++ b/src/Feature/State/Service.php @@ -41,7 +41,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } diff --git a/src/Interpreter.php b/src/Interpreter.php index 1b98d7f5..87221bfb 100644 --- a/src/Interpreter.php +++ b/src/Interpreter.php @@ -14,7 +14,7 @@ final class Interpreter private readonly array $expressionFunctions; public function __construct( - ExpressionFunctionProviderInterface|ExpressionFunction ...$expressionFunctions + ExpressionFunction|ExpressionFunctionProviderInterface ...$expressionFunctions ) { $this->expressionFunctions = $expressionFunctions; } diff --git a/src/Pipeline/Extractor.php b/src/Pipeline/Extractor.php index 67cfb976..075a7f6d 100644 --- a/src/Pipeline/Extractor.php +++ b/src/Pipeline/Extractor.php @@ -19,8 +19,7 @@ public function __construct( private ?string $plugin, private ?string $key, private ExpressionLanguage $interpreter = new Satellite\ExpressionLanguage() - ) { - } + ) {} public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterface $repository): void { @@ -66,7 +65,7 @@ public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterf ); } - if (array_key_exists('code', $config)) { + if (\array_key_exists('code', $config)) { $code = $config['code']; } else { $code = sprintf('%s.%s', $this->plugin, $this->key); @@ -77,7 +76,7 @@ public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterf new Node\Name\FullyQualified('Kiboko\\Component\\Pipeline\\StepCode'), new Node\Identifier('fromString'), [ - new Node\Arg(new Node\Scalar\String_($code)) + new Node\Arg(new Node\Scalar\String_($code)), ] ), $repository->getBuilder() diff --git a/src/Pipeline/Loader.php b/src/Pipeline/Loader.php index 50726e6b..26235559 100644 --- a/src/Pipeline/Loader.php +++ b/src/Pipeline/Loader.php @@ -19,8 +19,7 @@ public function __construct( private ?string $plugin, private ?string $key, private ExpressionLanguage $interpreter = new Satellite\ExpressionLanguage() - ) { - } + ) {} public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterface $repository): void { @@ -66,7 +65,7 @@ public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterf ); } - if (array_key_exists('code', $config)) { + if (\array_key_exists('code', $config)) { $code = $config['code']; } else { $code = sprintf('%s.%s', $this->plugin, $this->key); @@ -77,7 +76,7 @@ public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterf new Node\Name\FullyQualified('Kiboko\\Component\\Pipeline\\StepCode'), new Node\Identifier('fromString'), [ - new Node\Arg(new Node\Scalar\String_($code)) + new Node\Arg(new Node\Scalar\String_($code)), ] ), $repository->getBuilder() diff --git a/src/Pipeline/Transformer.php b/src/Pipeline/Transformer.php index 7420f7d0..26fcfa0e 100644 --- a/src/Pipeline/Transformer.php +++ b/src/Pipeline/Transformer.php @@ -19,8 +19,7 @@ public function __construct( private ?string $plugin, private ?string $key, private ExpressionLanguage $interpreter = new Satellite\ExpressionLanguage() - ) { - } + ) {} public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterface $repository): void { @@ -66,7 +65,7 @@ public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterf ); } - if (array_key_exists('code', $config)) { + if (\array_key_exists('code', $config)) { $code = $config['code']; } else { $code = sprintf('%s.%s', $this->plugin, $this->key); @@ -77,7 +76,7 @@ public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterf new Node\Name\FullyQualified('Kiboko\\Component\\Pipeline\\StepCode'), new Node\Identifier('fromString'), [ - new Node\Arg(new Node\Scalar\String_($code)) + new Node\Arg(new Node\Scalar\String_($code)), ] ), $repository->getBuilder() diff --git a/src/Plugin/Batching/Repository.php b/src/Plugin/Batching/Repository.php index 23dd6c42..cb4d4e14 100644 --- a/src/Plugin/Batching/Repository.php +++ b/src/Plugin/Batching/Repository.php @@ -11,9 +11,9 @@ final readonly class Repository implements Configurator\StepRepositoryInterface { - public function __construct(private Merge|Fork $builder) {} + public function __construct(private Fork|Merge $builder) {} - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): self + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): self { return $this; } @@ -33,7 +33,7 @@ public function getPackages(): iterable return new \EmptyIterator(); } - public function getBuilder(): Merge|Fork + public function getBuilder(): Fork|Merge { return $this->builder; } diff --git a/src/Plugin/Batching/Service.php b/src/Plugin/Batching/Service.php index 9bf76aab..d3204bb9 100644 --- a/src/Plugin/Batching/Service.php +++ b/src/Plugin/Batching/Service.php @@ -55,7 +55,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -66,7 +66,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } diff --git a/src/Plugin/Custom/Factory/Extractor.php b/src/Plugin/Custom/Factory/Extractor.php index ccf1088d..5690023d 100644 --- a/src/Plugin/Custom/Factory/Extractor.php +++ b/src/Plugin/Custom/Factory/Extractor.php @@ -44,7 +44,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -55,7 +55,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } diff --git a/src/Plugin/Custom/Factory/Loader.php b/src/Plugin/Custom/Factory/Loader.php index aed11d17..69a17a52 100644 --- a/src/Plugin/Custom/Factory/Loader.php +++ b/src/Plugin/Custom/Factory/Loader.php @@ -44,7 +44,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -55,7 +55,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } diff --git a/src/Plugin/Custom/Factory/Repository/RepositoryTrait.php b/src/Plugin/Custom/Factory/Repository/RepositoryTrait.php index c8a7b63b..fb9a52a6 100644 --- a/src/Plugin/Custom/Factory/Repository/RepositoryTrait.php +++ b/src/Plugin/Custom/Factory/Repository/RepositoryTrait.php @@ -14,7 +14,7 @@ trait RepositoryTrait /** @var string[] */ private array $packages; - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): Configurator\RepositoryInterface + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): Configurator\RepositoryInterface { array_push($this->files, ...$files); diff --git a/src/Plugin/Custom/Factory/Transformer.php b/src/Plugin/Custom/Factory/Transformer.php index 23a99803..5beb12e3 100644 --- a/src/Plugin/Custom/Factory/Transformer.php +++ b/src/Plugin/Custom/Factory/Transformer.php @@ -44,7 +44,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -55,7 +55,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } diff --git a/src/Plugin/Custom/Service.php b/src/Plugin/Custom/Service.php index 69a862dd..0818a8e4 100644 --- a/src/Plugin/Custom/Service.php +++ b/src/Plugin/Custom/Service.php @@ -47,7 +47,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -58,7 +58,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } diff --git a/src/Plugin/FTP/Factory/Loader.php b/src/Plugin/FTP/Factory/Loader.php index 0e501b8c..f9caa4a7 100644 --- a/src/Plugin/FTP/Factory/Loader.php +++ b/src/Plugin/FTP/Factory/Loader.php @@ -39,7 +39,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -50,7 +50,7 @@ public function validate(array $config): bool $this->normalize($config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } @@ -88,7 +88,7 @@ public function compile(array $config): RepositoryInterface try { return new FTP\Factory\Repository\Repository($builder); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException(message: $exception->getMessage(), previous: $exception); } } diff --git a/src/Plugin/FTP/Factory/Repository/Repository.php b/src/Plugin/FTP/Factory/Repository/Repository.php index 240170e9..81b74abf 100644 --- a/src/Plugin/FTP/Factory/Repository/Repository.php +++ b/src/Plugin/FTP/Factory/Repository/Repository.php @@ -12,7 +12,7 @@ { public function __construct(private Builder\Loader|Builder\Server $builder) {} - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): self + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): self { return $this; } diff --git a/src/Plugin/FTP/Factory/Server.php b/src/Plugin/FTP/Factory/Server.php index 28530ff6..8bd71dd2 100644 --- a/src/Plugin/FTP/Factory/Server.php +++ b/src/Plugin/FTP/Factory/Server.php @@ -38,7 +38,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -49,7 +49,7 @@ public function validate(array $config): bool $this->normalize($config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } @@ -75,7 +75,7 @@ public function compile(array $config): FTP\Factory\Repository\Repository try { return new FTP\Factory\Repository\Repository($builder); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException(message: $exception->getMessage(), previous: $exception); } } diff --git a/src/Plugin/FTP/Service.php b/src/Plugin/FTP/Service.php index 33a816de..da93e63e 100644 --- a/src/Plugin/FTP/Service.php +++ b/src/Plugin/FTP/Service.php @@ -45,7 +45,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -56,7 +56,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } diff --git a/src/Plugin/Filtering/Factory/Drop.php b/src/Plugin/Filtering/Factory/Drop.php index 5236e40a..0736b536 100644 --- a/src/Plugin/Filtering/Factory/Drop.php +++ b/src/Plugin/Filtering/Factory/Drop.php @@ -40,7 +40,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -51,7 +51,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } diff --git a/src/Plugin/Filtering/Factory/Reject.php b/src/Plugin/Filtering/Factory/Reject.php index 047a919f..73cb67a0 100644 --- a/src/Plugin/Filtering/Factory/Reject.php +++ b/src/Plugin/Filtering/Factory/Reject.php @@ -40,7 +40,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -51,7 +51,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } diff --git a/src/Plugin/Filtering/Factory/Repository/RepositoryTrait.php b/src/Plugin/Filtering/Factory/Repository/RepositoryTrait.php index f332d595..1457f00d 100644 --- a/src/Plugin/Filtering/Factory/Repository/RepositoryTrait.php +++ b/src/Plugin/Filtering/Factory/Repository/RepositoryTrait.php @@ -14,7 +14,7 @@ trait RepositoryTrait /** @var string[] */ private array $packages; - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): Configurator\RepositoryInterface + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): Configurator\RepositoryInterface { array_push($this->files, ...$files); diff --git a/src/Plugin/Filtering/Service.php b/src/Plugin/Filtering/Service.php index f63c4021..8c04104b 100644 --- a/src/Plugin/Filtering/Service.php +++ b/src/Plugin/Filtering/Service.php @@ -46,7 +46,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -57,7 +57,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } diff --git a/src/Plugin/SFTP/Factory/Extractor.php b/src/Plugin/SFTP/Factory/Extractor.php index 014eb4e9..dc4e97ed 100644 --- a/src/Plugin/SFTP/Factory/Extractor.php +++ b/src/Plugin/SFTP/Factory/Extractor.php @@ -39,7 +39,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -50,7 +50,7 @@ public function validate(array $config): bool $this->normalize($config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } @@ -87,7 +87,7 @@ public function compile(array $config): Repository try { return new Repository($builder); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException(message: $exception->getMessage(), previous: $exception); } } diff --git a/src/Plugin/SFTP/Factory/Loader.php b/src/Plugin/SFTP/Factory/Loader.php index 1213dcee..e24b3611 100644 --- a/src/Plugin/SFTP/Factory/Loader.php +++ b/src/Plugin/SFTP/Factory/Loader.php @@ -39,7 +39,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -50,7 +50,7 @@ public function validate(array $config): bool $this->normalize($config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } @@ -87,7 +87,7 @@ public function compile(array $config): Repository try { return new Repository($builder); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException(message: $exception->getMessage(), previous: $exception); } } diff --git a/src/Plugin/SFTP/Factory/Repository/Repository.php b/src/Plugin/SFTP/Factory/Repository/Repository.php index 8ed17a76..d6277f17 100644 --- a/src/Plugin/SFTP/Factory/Repository/Repository.php +++ b/src/Plugin/SFTP/Factory/Repository/Repository.php @@ -12,7 +12,7 @@ { public function __construct(private Builder\Loader|Builder\Server $builder) {} - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): self + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): self { return $this; } diff --git a/src/Plugin/SFTP/Factory/Server.php b/src/Plugin/SFTP/Factory/Server.php index 62e498fa..1a2f7d02 100644 --- a/src/Plugin/SFTP/Factory/Server.php +++ b/src/Plugin/SFTP/Factory/Server.php @@ -38,7 +38,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -49,7 +49,7 @@ public function validate(array $config): bool $this->normalize($config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } @@ -84,7 +84,7 @@ public function compile(array $config): SFTP\Factory\Repository\Repository try { return new SFTP\Factory\Repository\Repository($builder); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException(message: $exception->getMessage(), previous: $exception); } } diff --git a/src/Plugin/SFTP/Service.php b/src/Plugin/SFTP/Service.php index ba5992c5..e0ae7a85 100644 --- a/src/Plugin/SFTP/Service.php +++ b/src/Plugin/SFTP/Service.php @@ -46,7 +46,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -57,7 +57,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } diff --git a/src/Plugin/Stream/Repository.php b/src/Plugin/Stream/Repository.php index 79bb0dff..c2f9b53c 100644 --- a/src/Plugin/Stream/Repository.php +++ b/src/Plugin/Stream/Repository.php @@ -10,10 +10,10 @@ final readonly class Repository implements Configurator\StepRepositoryInterface { public function __construct( - private Builder\StderrLoader|Builder\StdoutLoader|Builder\JSONStreamLoader|Builder\DebugLoader $builder + private Builder\DebugLoader|Builder\JSONStreamLoader|Builder\StderrLoader|Builder\StdoutLoader $builder ) {} - public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): self + public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): self { return $this; } @@ -33,7 +33,7 @@ public function getPackages(): iterable return new \EmptyIterator(); } - public function getBuilder(): Builder\StderrLoader|Builder\StdoutLoader|Builder\JSONStreamLoader|Builder\DebugLoader + public function getBuilder(): Builder\DebugLoader|Builder\JSONStreamLoader|Builder\StderrLoader|Builder\StdoutLoader { return $this->builder; } diff --git a/src/Plugin/Stream/Service.php b/src/Plugin/Stream/Service.php index 3f3e11a9..c1fba50c 100644 --- a/src/Plugin/Stream/Service.php +++ b/src/Plugin/Stream/Service.php @@ -45,7 +45,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -56,7 +56,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } } diff --git a/src/Service.php b/src/Service.php index 628cf4cc..4dbe781b 100644 --- a/src/Service.php +++ b/src/Service.php @@ -147,7 +147,7 @@ public function registerRuntimes(Satellite\Runtime\FactoryInterface ...$runtimes return $this; } - public function registerPlugins(Configurator\PipelinePluginInterface|Configurator\PipelineFeatureInterface ...$plugins): self + public function registerPlugins(Configurator\PipelineFeatureInterface|Configurator\PipelinePluginInterface ...$plugins): self { foreach ($plugins as $plugin) { /** @var Configurator\Feature $attribute */ @@ -188,7 +188,7 @@ public function normalize(array $config): array { try { return $this->processor->processConfiguration($this->configuration, $config); - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) { throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception); } } @@ -199,7 +199,7 @@ public function validate(array $config): bool $this->processor->processConfiguration($this->configuration, $config); return true; - } catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) { + } catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) { return false; } }