Skip to content

Commit 51a3d1f

Browse files
committed
code format commit
1 parent 9679a27 commit 51a3d1f

35 files changed

+125
-132
lines changed

src/Action/ConfigurationApplier.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
final class ConfigurationApplier
1212
{
13-
private ?Satellite\Action\Action $action = null;
13+
private ?Action $action = null;
1414
private array $packages = [];
1515

1616
public function __construct(
@@ -22,7 +22,7 @@ public function __construct(
2222

2323
public function withAction(): self
2424
{
25-
$this->action = new Satellite\Action\Action($this->plugin, clone $this->interpreter);
25+
$this->action = new Action($this->plugin, clone $this->interpreter);
2626

2727
return $this;
2828
}

src/Action/Custom/Factory/Action.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function validate(array $config): bool
6363
/**
6464
* @throws Configurator\ConfigurationExceptionInterface
6565
*/
66-
public function compile(array $config): Custom\Factory\Repository\Action
66+
public function compile(array $config): Repository\Action
6767
{
6868
$containerName = sprintf('ProjectServiceContainer%s', ByteString::fromRandom(8)->toString());
6969

@@ -74,7 +74,7 @@ public function compile(array $config): Custom\Factory\Repository\Action
7474

7575
$container = (new SatelliteDependencyInjection(...$this->providers))($config);
7676

77-
$repository = new Custom\Factory\Repository\Action($builder);
77+
$repository = new Repository\Action($builder);
7878

7979
$dumper = new PhpDumper($container);
8080
$repository->addFiles(

src/Action/Custom/Service.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Kiboko\Component\Satellite\Action\Custom;
66

7-
use Kiboko\Component\Satellite\Action\Custom;
87
use Kiboko\Component\Satellite\ExpressionLanguage as Satellite;
98
use Kiboko\Contract\Configurator;
109
use Symfony\Component\Config\Definition\Exception as Symfony;
@@ -26,7 +25,7 @@ public function __construct(
2625
private ExpressionLanguage $interpreter = new Satellite\ExpressionLanguage()
2726
) {
2827
$this->processor = new Processor();
29-
$this->configuration = new Custom\Configuration();
28+
$this->configuration = new Configuration();
3029
}
3130

3231
public function interpreter(): ExpressionLanguage
@@ -78,7 +77,7 @@ public function compile(array $config): Configurator\RepositoryInterface
7877
}
7978
}
8079

81-
$actionFactory = new Custom\Factory\Action($this->interpreter);
80+
$actionFactory = new Factory\Action($this->interpreter);
8281

8382
return $actionFactory->compile($config);
8483
}

src/Adapter/ComposerFailureException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
final class ComposerFailureException extends \RuntimeException
88
{
9-
public function __construct(private readonly string $command = '', string $message = '', int $code = 0, \Throwable $previous = null)
9+
public function __construct(private readonly string $command = '', string $message = '', int $code = 0, ?\Throwable $previous = null)
1010
{
1111
parent::__construct($message, $code, $previous);
1212
}

src/Adapter/Docker/SatelliteBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ final class SatelliteBuilder implements Configurator\SatelliteBuilderInterface
2323
private iterable $command = [];
2424
/** @var iterable<string> */
2525
private iterable $tags = [];
26-
private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile = null;
27-
private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null;
26+
private PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerJsonFile = null;
27+
private PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerLockFile = null;
2828
/** @var iterable<array<string, string>> */
2929
private iterable $paths = [];
3030
/** @var \AppendIterator<string,PackagingContract\FileInterface, \Iterator<string,PackagingContract\FileInterface>> */
@@ -67,7 +67,7 @@ public function withComposerRequire(string ...$package): self
6767

6868
public function withComposerFile(
6969
PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile,
70-
PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null
70+
PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerLockFile = null
7171
): self {
7272
$this->composerJsonFile = $composerJsonFile;
7373
$this->composerLockFile = $composerLockFile;
@@ -77,7 +77,7 @@ public function withComposerFile(
7777

7878
public function withFile(
7979
PackagingContract\AssetInterface|PackagingContract\FileInterface $source,
80-
string $destinationPath = null
80+
?string $destinationPath = null
8181
): self {
8282
if (!$source instanceof PackagingContract\FileInterface) {
8383
$source = new Packaging\VirtualFile($source);
@@ -92,7 +92,7 @@ public function withFile(
9292
return $this;
9393
}
9494

95-
public function withDirectory(PackagingContract\DirectoryInterface $source, string $destinationPath = null): self
95+
public function withDirectory(PackagingContract\DirectoryInterface $source, ?string $destinationPath = null): self
9696
{
9797
$this->paths[] = [$source->getPath(), $destinationPath ?? $source->getPath()];
9898

src/Adapter/Filesystem/SatelliteBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ final class SatelliteBuilder implements Configurator\SatelliteBuilderInterface
2020
];
2121
private array $authenticationTokens = [];
2222
private array $repositories = [];
23-
private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile = null;
24-
private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null;
23+
private PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerJsonFile = null;
24+
private PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerLockFile = null;
2525
/** @var iterable<array<string, string>> */
2626
private iterable $paths = [];
2727
/** @var \AppendIterator<string,PackagingContract\FileInterface, \Iterator<string,PackagingContract\FileInterface>> */
@@ -55,7 +55,7 @@ public function withComposerRequire(string ...$package): self
5555

5656
public function withComposerFile(
5757
PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile,
58-
PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null
58+
PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerLockFile = null
5959
): self {
6060
$this->composerJsonFile = $composerJsonFile;
6161
$this->composerLockFile = $composerLockFile;
@@ -65,7 +65,7 @@ public function withComposerFile(
6565

6666
public function withFile(
6767
PackagingContract\AssetInterface|PackagingContract\FileInterface $source,
68-
string $destinationPath = null
68+
?string $destinationPath = null
6969
): self {
7070
if (!$source instanceof PackagingContract\FileInterface) {
7171
$source = new Packaging\VirtualFile($source);
@@ -80,7 +80,7 @@ public function withFile(
8080
return $this;
8181
}
8282

83-
public function withDirectory(PackagingContract\DirectoryInterface $source, string $destinationPath = null): self
83+
public function withDirectory(PackagingContract\DirectoryInterface $source, ?string $destinationPath = null): self
8484
{
8585
$this->paths[] = [$source->getPath(), $destinationPath ?? $source->getPath()];
8686

src/Adapter/Tar/SatelliteBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ final class SatelliteBuilder implements Configurator\SatelliteBuilderInterface
1313
{
1414
/** @var iterable<string> */
1515
private iterable $composerRequire = [];
16-
private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile = null;
17-
private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null;
16+
private PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerJsonFile = null;
17+
private PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerLockFile = null;
1818
/** @var \AppendIterator<string,PackagingContract\FileInterface, \Iterator<string,PackagingContract\FileInterface>> */
1919
private readonly iterable $files;
2020
/** @var array<string, array<string, string>> */
@@ -48,7 +48,7 @@ public function withComposerRequire(string ...$package): self
4848

4949
public function withComposerFile(
5050
PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile,
51-
PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null
51+
PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerLockFile = null
5252
): self {
5353
$this->composerJsonFile = $composerJsonFile;
5454
$this->composerLockFile = $composerLockFile;
@@ -58,7 +58,7 @@ public function withComposerFile(
5858

5959
public function withFile(
6060
PackagingContract\AssetInterface|PackagingContract\FileInterface $source,
61-
string $destinationPath = null
61+
?string $destinationPath = null
6262
): self {
6363
if (!$source instanceof PackagingContract\FileInterface) {
6464
$source = new Packaging\VirtualFile($source);
@@ -71,7 +71,7 @@ public function withFile(
7171
return $this;
7272
}
7373

74-
public function withDirectory(PackagingContract\DirectoryInterface $source, string $destinationPath = null): self
74+
public function withDirectory(PackagingContract\DirectoryInterface $source, ?string $destinationPath = null): self
7575
{
7676
$this->files->append(new \RecursiveIteratorIterator($source, \RecursiveIteratorIterator::SELF_FIRST));
7777

src/Cloud/Auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class Auth
1313
private string $pathName;
1414
private array $configuration;
1515

16-
public function __construct(string $pathName = null)
16+
public function __construct(?string $pathName = null)
1717
{
1818
if (null === $pathName) {
1919
$this->pathName = getenv('HOME').'/.gyroscops/';

src/Cloud/CommandBus.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Kiboko\Component\Satellite\Cloud;
66

77
use Gyroscops\Api\Client;
8-
use Kiboko\Component\Satellite;
98
use React\Promise\Deferred;
109
use React\Promise\PromiseInterface;
1110

@@ -22,16 +21,16 @@ public function __construct(
2221
public static function withStandardHandlers(Client $client): self
2322
{
2423
return new self([
25-
Satellite\Cloud\Command\Pipeline\DeclarePipelineCommand::class => new Satellite\Cloud\Handler\Pipeline\DeclarePipelineCommandHandler($client),
26-
Satellite\Cloud\Command\Pipeline\AddPipelineComposerPSR4AutoloadCommand::class => new Satellite\Cloud\Handler\Pipeline\AddPipelineComposerPSR4AutoloadCommandHandler($client),
27-
Satellite\Cloud\Command\Pipeline\AppendPipelineStepCommand::class => new Satellite\Cloud\Handler\Pipeline\AppendPipelineStepCommandHandler($client),
28-
Satellite\Cloud\Command\Pipeline\RemovePipelineCommand::class => new Satellite\Cloud\Handler\Pipeline\RemovePipelineCommandHandler($client),
29-
Satellite\Cloud\Command\Pipeline\AddAfterPipelineStepCommand::class => new Satellite\Cloud\Handler\Pipeline\AddAfterPipelineStepCommandHandler($client),
30-
Satellite\Cloud\Command\Pipeline\AddBeforePipelineStepCommand::class => new Satellite\Cloud\Handler\Pipeline\AddBeforePipelineStepCommandHandler($client),
31-
Satellite\Cloud\Command\Pipeline\ReplacePipelineStepCommand::class => new Satellite\Cloud\Handler\Pipeline\ReplacePipelineStepCommandHandler($client),
32-
Satellite\Cloud\Command\Pipeline\RemovePipelineStepCommand::class => new Satellite\Cloud\Handler\Pipeline\RemovePipelineStepCommandHandler($client),
33-
Satellite\Cloud\Command\Workflow\DeclareWorkflowCommand::class => new Satellite\Cloud\Handler\Workflow\DeclareWorkflowCommandHandler($client),
34-
Satellite\Cloud\Command\Workflow\RemoveWorkflowCommand::class => new Satellite\Cloud\Handler\Workflow\RemoveWorkflowCommandHandler($client),
24+
Command\Pipeline\DeclarePipelineCommand::class => new Handler\Pipeline\DeclarePipelineCommandHandler($client),
25+
Command\Pipeline\AddPipelineComposerPSR4AutoloadCommand::class => new Handler\Pipeline\AddPipelineComposerPSR4AutoloadCommandHandler($client),
26+
Command\Pipeline\AppendPipelineStepCommand::class => new Handler\Pipeline\AppendPipelineStepCommandHandler($client),
27+
Command\Pipeline\RemovePipelineCommand::class => new Handler\Pipeline\RemovePipelineCommandHandler($client),
28+
Command\Pipeline\AddAfterPipelineStepCommand::class => new Handler\Pipeline\AddAfterPipelineStepCommandHandler($client),
29+
Command\Pipeline\AddBeforePipelineStepCommand::class => new Handler\Pipeline\AddBeforePipelineStepCommandHandler($client),
30+
Command\Pipeline\ReplacePipelineStepCommand::class => new Handler\Pipeline\ReplacePipelineStepCommandHandler($client),
31+
Command\Pipeline\RemovePipelineStepCommand::class => new Handler\Pipeline\RemovePipelineStepCommandHandler($client),
32+
Command\Workflow\DeclareWorkflowCommand::class => new Handler\Workflow\DeclareWorkflowCommandHandler($client),
33+
Command\Workflow\RemoveWorkflowCommand::class => new Handler\Workflow\RemoveWorkflowCommandHandler($client),
3534
]);
3635
}
3736

src/Cloud/DTO/JobList.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44

55
namespace Kiboko\Component\Satellite\Cloud\DTO;
66

7-
use Kiboko\Component\Satellite\Cloud\DTO;
8-
97
readonly class JobList implements \Countable, \IteratorAggregate
108
{
119
private array $jobs;
1210

1311
public function __construct(
14-
DTO\Workflow\JobInterface ...$job,
12+
Workflow\JobInterface ...$job,
1513
) {
1614
$this->jobs = $job;
1715
}
@@ -21,7 +19,7 @@ public function getIterator(): \Traversable
2119
$jobs = $this->jobs;
2220

2321
/* @phpstan-ignore-next-line */
24-
usort($jobs, fn (DTO\Workflow\JobInterface $left, DTO\Workflow\JobInterface $right) => $left->order <=> $right->order);
22+
usort($jobs, fn (Workflow\JobInterface $left, Workflow\JobInterface $right) => $left->order <=> $right->order);
2523

2624
return new \ArrayIterator($jobs);
2725
}
@@ -31,13 +29,13 @@ public function codes(): array
3129
$jobs = $this->jobs;
3230

3331
/* @phpstan-ignore-next-line */
34-
usort($jobs, fn (DTO\Workflow\JobInterface $left, DTO\Workflow\JobInterface $right) => $left->order <=> $right->order);
32+
usort($jobs, fn (Workflow\JobInterface $left, Workflow\JobInterface $right) => $left->order <=> $right->order);
3533

3634
/* @phpstan-ignore-next-line */
37-
return array_map(fn (DTO\Workflow\JobInterface $job) => $job->code->asString(), $jobs);
35+
return array_map(fn (Workflow\JobInterface $job) => $job->code->asString(), $jobs);
3836
}
3937

40-
public function get(string $code): DTO\Workflow\JobInterface
38+
public function get(string $code): Workflow\JobInterface
4139
{
4240
foreach ($this->jobs as $job) {
4341
if ($job->code->asString() === $code) {

0 commit comments

Comments
 (0)