Skip to content

Commit 51eb10a

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

33 files changed

+110
-114
lines changed

src/Action/ConfigurationApplier.php

+2-2
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

+2-2
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

+2-3
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

+1-1
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

+5-5
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

+5-5
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

+5-5
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

+1-1
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/Normalizer/ExpressionNormalizer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
class ExpressionNormalizer implements NormalizerInterface
1111
{
12-
public function normalize(mixed $object, string $format = null, array $context = []): string
12+
public function normalize(mixed $object, ?string $format = null, array $context = []): string
1313
{
1414
return (string) $object;
1515
}
1616

17-
public function supportsNormalization(mixed $data, string $format = null): bool
17+
public function supportsNormalization(mixed $data, ?string $format = null): bool
1818
{
1919
return $data instanceof Expression;
2020
}

src/ConfigLoader.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44

55
namespace Kiboko\Component\Satellite;
66

7-
use Kiboko\Component\Satellite;
87
use Kiboko\Contract\Configurator\InvalidConfigurationException;
98
use Symfony\Component\Config;
109

11-
class ConfigLoader implements Satellite\ConfigLoaderInterface
10+
class ConfigLoader implements ConfigLoaderInterface
1211
{
1312
public function __construct(private readonly string $basePath)
1413
{
@@ -120,8 +119,8 @@ public function loadFile(string $file): array
120119
$locator = new Config\FileLocator([$this->basePath]);
121120

122121
$loaderResolver = new Config\Loader\LoaderResolver([
123-
new Satellite\Console\Config\YamlFileLoader($locator),
124-
new Satellite\Console\Config\JsonFileLoader($locator),
122+
new Console\Config\YamlFileLoader($locator),
123+
new Console\Config\JsonFileLoader($locator),
125124
]);
126125

127126
$delegatingLoader = new Config\Loader\DelegatingLoader($loaderResolver);

src/ExpressionLanguage/Download.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Kiboko\Component\Satellite\ExpressionLanguage;
66

7-
use PhpSpec\Locator\Resource;
87
use Symfony\Component\ExpressionLanguage\ExpressionFunction;
98

109
final class Download extends ExpressionFunction
@@ -27,10 +26,11 @@ function (string $value, string $context = ''): string {
2726
return sprintf($pattern, $value, $context);
2827
},
2928
function (string $value, string $context = '') {
30-
$resource = fopen($context . $value, 'r');
31-
if ($resource === false) {
29+
$resource = fopen($context.$value, 'r');
30+
if (false === $resource) {
3231
throw new \RuntimeException('Could not open file.');
3332
}
33+
3434
return $resource;
3535
},
3636
);

src/ExpressionLanguage/ExpressionLanguage.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
final class ExpressionLanguage extends BaseExpressionLanguage
1111
{
12-
public function __construct(CacheItemPoolInterface $cache = null, array $providers = [])
12+
public function __construct(?CacheItemPoolInterface $cache = null, array $providers = [])
1313
{
1414
parent::__construct($cache, [
1515
...$providers,

src/Feature/Logger/Builder/Monolog/GelfBuilder.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function withLevel(string $level): self
2525
return $this;
2626
}
2727

28-
public function withTCPTransport(string $host = null, int $port = null): self
28+
public function withTCPTransport(?string $host = null, ?int $port = null): self
2929
{
3030
$this->transport = 'tcp';
3131
$this->host = $host;
@@ -34,7 +34,7 @@ public function withTCPTransport(string $host = null, int $port = null): self
3434
return $this;
3535
}
3636

37-
public function withAMQPTransport(string $queue, string $channel, string $vhost, string $host = null, int $port = null, float $timeout = null): self
37+
public function withAMQPTransport(string $queue, string $channel, string $vhost, ?string $host = null, ?int $port = null, ?float $timeout = null): self
3838
{
3939
$this->transport = 'amqp';
4040
$this->queue = $queue;

src/Feature/Logger/Factory/ElasticSearchFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function validate(array $config): bool
5353
return false;
5454
}
5555

56-
public function compile(array $config): Logger\Factory\Repository\ElasticSearchRepository
56+
public function compile(array $config): Repository\ElasticSearchRepository
5757
{
5858
$builder = new Logger\Builder\Monolog\ElasticSearchBuilder($this->interpreter);
5959

@@ -69,6 +69,6 @@ public function compile(array $config): Logger\Factory\Repository\ElasticSearchR
6969
$builder->withIndex($config['index']);
7070
}
7171

72-
return new Logger\Factory\Repository\ElasticSearchRepository($builder);
72+
return new Repository\ElasticSearchRepository($builder);
7373
}
7474
}

src/Feature/Logger/Factory/GelfFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function validate(array $config): bool
5050
return false;
5151
}
5252

53-
public function compile(array $config): Logger\Factory\Repository\GelfRepository
53+
public function compile(array $config): Repository\GelfRepository
5454
{
5555
$builder = new Logger\Builder\Monolog\GelfBuilder();
5656

@@ -74,6 +74,6 @@ public function compile(array $config): Logger\Factory\Repository\GelfRepository
7474
);
7575
}
7676

77-
return new Logger\Factory\Repository\GelfRepository($builder);
77+
return new Repository\GelfRepository($builder);
7878
}
7979
}

src/Feature/Logger/Factory/StreamFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function validate(array $config): bool
5050
return false;
5151
}
5252

53-
public function compile(array $config): Logger\Factory\Repository\StreamRepository
53+
public function compile(array $config): Repository\StreamRepository
5454
{
5555
$builder = new Logger\Builder\Monolog\StreamBuilder($config['path']);
5656

@@ -66,6 +66,6 @@ public function compile(array $config): Logger\Factory\Repository\StreamReposito
6666
$builder->withLocking($config['use_locking']);
6767
}
6868

69-
return new Logger\Factory\Repository\StreamRepository($builder);
69+
return new Repository\StreamRepository($builder);
7070
}
7171
}

src/Feature/Logger/Factory/SyslogFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function validate(array $config): bool
5050
return false;
5151
}
5252

53-
public function compile(array $config): Logger\Factory\Repository\SyslogRepository
53+
public function compile(array $config): Repository\SyslogRepository
5454
{
5555
$builder = new Logger\Builder\Monolog\SyslogBuilder($config['ident']);
5656

@@ -66,6 +66,6 @@ public function compile(array $config): Logger\Factory\Repository\SyslogReposito
6666
$builder->withLogopts($config['logopts']);
6767
}
6868

69-
return new Logger\Factory\Repository\SyslogRepository($builder);
69+
return new Repository\SyslogRepository($builder);
7070
}
7171
}

src/Feature/Rejection/Factory/RabbitMQFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function validate(array $config): bool
5555
return false;
5656
}
5757

58-
public function compile(array $config): Rejection\Factory\Repository\RabbitMQRepository
58+
public function compile(array $config): Repository\RabbitMQRepository
5959
{
6060
$builder = new Rejection\Builder\RabbitMQBuilder(
6161
stepUuid: compileValueWhenExpression($this->interpreter, uniqid()),
@@ -76,6 +76,6 @@ public function compile(array $config): Rejection\Factory\Repository\RabbitMQRep
7676
$builder->withExchange(compileValueWhenExpression($this->interpreter, $config['exchange']));
7777
}
7878

79-
return new Rejection\Factory\Repository\RabbitMQRepository($builder);
79+
return new Repository\RabbitMQRepository($builder);
8080
}
8181
}

src/Plugin/Custom/Factory/Extractor.php

+2-2
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\Extractor
66+
public function compile(array $config): Repository\Extractor
6767
{
6868
$containerName = sprintf('ProjectServiceContainer%s', ByteString::fromRandom(8)->toString());
6969

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

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

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

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

0 commit comments

Comments
 (0)