Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added reason option into the configuration #115

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
4 changes: 2 additions & 2 deletions src/Action/ConfigurationApplier.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

final class ConfigurationApplier
{
private ?Satellite\Action\Action $action = null;
private ?Action $action = null;
private array $packages = [];

Check failure on line 14 in src/Action/ConfigurationApplier.php

View workflow job for this annotation

GitHub Actions / phpstan7

Property Kiboko\Component\Satellite\Action\ConfigurationApplier::$packages type has no value type specified in iterable type array.

Check failure on line 14 in src/Action/ConfigurationApplier.php

View workflow job for this annotation

GitHub Actions / phpstan6

Property Kiboko\Component\Satellite\Action\ConfigurationApplier::$packages type has no value type specified in iterable type array.

Check failure on line 14 in src/Action/ConfigurationApplier.php

View workflow job for this annotation

GitHub Actions / phpstan8

Property Kiboko\Component\Satellite\Action\ConfigurationApplier::$packages type has no value type specified in iterable type array.

public function __construct(
private readonly string $plugin,
Expand All @@ -22,7 +22,7 @@

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

return $this;
}
Expand All @@ -34,11 +34,11 @@
return $this;
}

public function appendTo(array $config, Satellite\Builder\Repository\Action $action): void

Check failure on line 37 in src/Action/ConfigurationApplier.php

View workflow job for this annotation

GitHub Actions / phpstan7

Method Kiboko\Component\Satellite\Action\ConfigurationApplier::appendTo() has parameter $config with no value type specified in iterable type array.

Check failure on line 37 in src/Action/ConfigurationApplier.php

View workflow job for this annotation

GitHub Actions / phpstan6

Method Kiboko\Component\Satellite\Action\ConfigurationApplier::appendTo() has parameter $config with no value type specified in iterable type array.

Check failure on line 37 in src/Action/ConfigurationApplier.php

View workflow job for this annotation

GitHub Actions / phpstan8

Method Kiboko\Component\Satellite\Action\ConfigurationApplier::appendTo() has parameter $config with no value type specified in iterable type array.
{
$repository = $this->service->compile($config[$this->plugin]);

($this->action)($config, $action->getBuilder(), $repository);

Check failure on line 41 in src/Action/ConfigurationApplier.php

View workflow job for this annotation

GitHub Actions / phpstan8

Trying to invoke Kiboko\Component\Satellite\Action\Action|null but it might not be a callable.

$action->addPackages(...$this->packages);

Expand Down
4 changes: 2 additions & 2 deletions src/Action/Custom/Factory/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
private readonly Processor $processor;
private readonly ConfigurationInterface $configuration;

public function __construct(

Check failure on line 27 in src/Action/Custom/Factory/Action.php

View workflow job for this annotation

GitHub Actions / phpstan7

Method Kiboko\Component\Satellite\Action\Custom\Factory\Action::__construct() has parameter $providers with no value type specified in iterable type array.

Check failure on line 27 in src/Action/Custom/Factory/Action.php

View workflow job for this annotation

GitHub Actions / phpstan6

Method Kiboko\Component\Satellite\Action\Custom\Factory\Action::__construct() has parameter $providers with no value type specified in iterable type array.

Check failure on line 27 in src/Action/Custom/Factory/Action.php

View workflow job for this annotation

GitHub Actions / phpstan8

Method Kiboko\Component\Satellite\Action\Custom\Factory\Action::__construct() has parameter $providers with no value type specified in iterable type array.
private readonly ExpressionLanguage $interpreter = new Satellite\ExpressionLanguage(),
private readonly array $providers = [],
) {
Expand Down Expand Up @@ -63,7 +63,7 @@
/**
* @throws Configurator\ConfigurationExceptionInterface
*/
public function compile(array $config): Custom\Factory\Repository\Action
public function compile(array $config): Repository\Action
{
$containerName = sprintf('ProjectServiceContainer%s', ByteString::fromRandom(8)->toString());

Expand All @@ -74,14 +74,14 @@

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

$repository = new Custom\Factory\Repository\Action($builder);
$repository = new Repository\Action($builder);

$dumper = new PhpDumper($container);
$repository->addFiles(
new Packaging\File(
sprintf('%s.php', $containerName),
new Packaging\Asset\InMemory(
$dumper->dump(['class' => $containerName, 'namespace' => 'GyroscopsGenerated'])

Check failure on line 84 in src/Action/Custom/Factory/Action.php

View workflow job for this annotation

GitHub Actions / phpstan7

Parameter #1 $content of class Kiboko\Component\Packaging\Asset\InMemory constructor expects string, array|string given.
)
),
);
Expand Down
5 changes: 2 additions & 3 deletions src/Action/Custom/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Kiboko\Component\Satellite\Action\Custom;

use Kiboko\Component\Satellite\Action\Custom;
use Kiboko\Component\Satellite\ExpressionLanguage as Satellite;
use Kiboko\Contract\Configurator;
use Symfony\Component\Config\Definition\Exception as Symfony;
Expand All @@ -26,7 +25,7 @@
private ExpressionLanguage $interpreter = new Satellite\ExpressionLanguage()
) {
$this->processor = new Processor();
$this->configuration = new Custom\Configuration();
$this->configuration = new Configuration();
}

public function interpreter(): ExpressionLanguage
Expand Down Expand Up @@ -74,11 +73,11 @@
&& \count($config['expression_language'])
) {
foreach ($config['expression_language'] as $provider) {
$interpreter->registerProvider(new $provider());

Check failure on line 76 in src/Action/Custom/Service.php

View workflow job for this annotation

GitHub Actions / phpstan7

Parameter #1 $provider of method Symfony\Component\ExpressionLanguage\ExpressionLanguage::registerProvider() expects Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface, object given.
}
}

$actionFactory = new Custom\Factory\Action($this->interpreter);
$actionFactory = new Factory\Action($this->interpreter);

return $actionFactory->compile($config);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/ComposerFailureException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

final class ComposerFailureException extends \RuntimeException
{
public function __construct(private readonly string $command = '', string $message = '', int $code = 0, \Throwable $previous = null)
public function __construct(private readonly string $command = '', string $message = '', int $code = 0, ?\Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
Expand Down
10 changes: 5 additions & 5 deletions src/Adapter/Docker/SatelliteBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
private iterable $command = [];
/** @var iterable<string> */
private iterable $tags = [];
private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile = null;
private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null;
private PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerJsonFile = null;
private PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerLockFile = null;
/** @var iterable<array<string, string>> */
private iterable $paths = [];
/** @var \AppendIterator<string,PackagingContract\FileInterface, \Iterator<string,PackagingContract\FileInterface>> */
Expand Down Expand Up @@ -67,7 +67,7 @@

public function withComposerFile(
PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile,
PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null
PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerLockFile = null
): self {
$this->composerJsonFile = $composerJsonFile;
$this->composerLockFile = $composerLockFile;
Expand All @@ -77,7 +77,7 @@

public function withFile(
PackagingContract\AssetInterface|PackagingContract\FileInterface $source,
string $destinationPath = null
?string $destinationPath = null
): self {
if (!$source instanceof PackagingContract\FileInterface) {
$source = new Packaging\VirtualFile($source);
Expand All @@ -85,14 +85,14 @@

$this->paths[] = [$source->getPath(), $destinationPath ?? $source->getPath()];

$this->files->append(new \ArrayIterator([

Check failure on line 88 in src/Adapter/Docker/SatelliteBuilder.php

View workflow job for this annotation

GitHub Actions / phpstan5

Parameter #1 $iterator of method AppendIterator<string,Kiboko\Contract\Packaging\FileInterface,Iterator<string, Kiboko\Contract\Packaging\FileInterface>>::append() expects Iterator<string, Kiboko\Contract\Packaging\FileInterface>, ArrayIterator<int, Kiboko\Component\Packaging\File> given.
new Packaging\File($destinationPath, $source),
]));

return $this;
}

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

Expand Down Expand Up @@ -152,13 +152,13 @@

if (null !== $this->composerJsonFile) {
$dockerfile->push(new Dockerfile\Dockerfile\Copy('composer.json', 'composer.json'));
$this->files->append(new \ArrayIterator([

Check failure on line 155 in src/Adapter/Docker/SatelliteBuilder.php

View workflow job for this annotation

GitHub Actions / phpstan5

Parameter #1 $iterator of method AppendIterator<string,Kiboko\Contract\Packaging\FileInterface,Iterator<string, Kiboko\Contract\Packaging\FileInterface>>::append() expects Iterator<string, Kiboko\Contract\Packaging\FileInterface>, ArrayIterator<int, Kiboko\Component\Packaging\File> given.
new Packaging\File('composer.json', $this->composerJsonFile),
]));

if (null !== $this->composerLockFile) {
$dockerfile->push(new Dockerfile\Dockerfile\Copy('composer.json', 'composer.lock'));
$this->files->append(new \ArrayIterator([

Check failure on line 161 in src/Adapter/Docker/SatelliteBuilder.php

View workflow job for this annotation

GitHub Actions / phpstan5

Parameter #1 $iterator of method AppendIterator<string,Kiboko\Contract\Packaging\FileInterface,Iterator<string, Kiboko\Contract\Packaging\FileInterface>>::append() expects Iterator<string, Kiboko\Contract\Packaging\FileInterface>, ArrayIterator<int, Kiboko\Component\Packaging\File> given.
new Packaging\File('composer.lock', $this->composerLockFile),
]));
}
Expand Down
10 changes: 5 additions & 5 deletions src/Adapter/Filesystem/SatelliteBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
];
private array $authenticationTokens = [];
private array $repositories = [];
private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile = null;
private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null;
private PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerJsonFile = null;
private PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerLockFile = null;
/** @var iterable<array<string, string>> */
private iterable $paths = [];

Check failure on line 26 in src/Adapter/Filesystem/SatelliteBuilder.php

View workflow job for this annotation

GitHub Actions / phpstan5

Property Kiboko\Component\Satellite\Adapter\Filesystem\SatelliteBuilder::$paths is never read, only written.
/** @var \AppendIterator<string,PackagingContract\FileInterface, \Iterator<string,PackagingContract\FileInterface>> */
private readonly iterable $files;

Expand Down Expand Up @@ -55,7 +55,7 @@

public function withComposerFile(
PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile,
PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null
PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerLockFile = null
): self {
$this->composerJsonFile = $composerJsonFile;
$this->composerLockFile = $composerLockFile;
Expand All @@ -65,7 +65,7 @@

public function withFile(
PackagingContract\AssetInterface|PackagingContract\FileInterface $source,
string $destinationPath = null
?string $destinationPath = null
): self {
if (!$source instanceof PackagingContract\FileInterface) {
$source = new Packaging\VirtualFile($source);
Expand All @@ -73,14 +73,14 @@

$this->paths[] = [$source->getPath(), $destinationPath ?? $source->getPath()];

$this->files->append(new \ArrayIterator([

Check failure on line 76 in src/Adapter/Filesystem/SatelliteBuilder.php

View workflow job for this annotation

GitHub Actions / phpstan5

Parameter #1 $iterator of method AppendIterator<string,Kiboko\Contract\Packaging\FileInterface,Iterator<string, Kiboko\Contract\Packaging\FileInterface>>::append() expects Iterator<string, Kiboko\Contract\Packaging\FileInterface>, ArrayIterator<int, Kiboko\Component\Packaging\File> given.
new Packaging\File($destinationPath, $source),
]));

return $this;
}

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

Expand Down
10 changes: 5 additions & 5 deletions src/Adapter/Tar/SatelliteBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ final class SatelliteBuilder implements Configurator\SatelliteBuilderInterface
{
/** @var iterable<string> */
private iterable $composerRequire = [];
private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile = null;
private null|PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null;
private PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerJsonFile = null;
private PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerLockFile = null;
/** @var \AppendIterator<string,PackagingContract\FileInterface, \Iterator<string,PackagingContract\FileInterface>> */
private readonly iterable $files;
/** @var array<string, array<string, string>> */
Expand Down Expand Up @@ -48,7 +48,7 @@ public function withComposerRequire(string ...$package): self

public function withComposerFile(
PackagingContract\AssetInterface|PackagingContract\FileInterface $composerJsonFile,
PackagingContract\AssetInterface|PackagingContract\FileInterface $composerLockFile = null
PackagingContract\AssetInterface|PackagingContract\FileInterface|null $composerLockFile = null
): self {
$this->composerJsonFile = $composerJsonFile;
$this->composerLockFile = $composerLockFile;
Expand All @@ -58,7 +58,7 @@ public function withComposerFile(

public function withFile(
PackagingContract\AssetInterface|PackagingContract\FileInterface $source,
string $destinationPath = null
?string $destinationPath = null
): self {
if (!$source instanceof PackagingContract\FileInterface) {
$source = new Packaging\VirtualFile($source);
Expand All @@ -71,7 +71,7 @@ public function withFile(
return $this;
}

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

Expand Down
2 changes: 1 addition & 1 deletion src/Cloud/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class Auth
private string $pathName;
private array $configuration;

public function __construct(string $pathName = null)
public function __construct(?string $pathName = null)
{
if (null === $pathName) {
$this->pathName = getenv('HOME').'/.gyroscops/';
Expand Down
21 changes: 10 additions & 11 deletions src/Cloud/CommandBus.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Kiboko\Component\Satellite\Cloud;

use Gyroscops\Api\Client;
use Kiboko\Component\Satellite;
use React\Promise\Deferred;
use React\Promise\PromiseInterface;

Expand All @@ -22,16 +21,16 @@ public function __construct(
public static function withStandardHandlers(Client $client): self
{
return new self([
Satellite\Cloud\Command\Pipeline\DeclarePipelineCommand::class => new Satellite\Cloud\Handler\Pipeline\DeclarePipelineCommandHandler($client),
Satellite\Cloud\Command\Pipeline\AddPipelineComposerPSR4AutoloadCommand::class => new Satellite\Cloud\Handler\Pipeline\AddPipelineComposerPSR4AutoloadCommandHandler($client),
Satellite\Cloud\Command\Pipeline\AppendPipelineStepCommand::class => new Satellite\Cloud\Handler\Pipeline\AppendPipelineStepCommandHandler($client),
Satellite\Cloud\Command\Pipeline\RemovePipelineCommand::class => new Satellite\Cloud\Handler\Pipeline\RemovePipelineCommandHandler($client),
Satellite\Cloud\Command\Pipeline\AddAfterPipelineStepCommand::class => new Satellite\Cloud\Handler\Pipeline\AddAfterPipelineStepCommandHandler($client),
Satellite\Cloud\Command\Pipeline\AddBeforePipelineStepCommand::class => new Satellite\Cloud\Handler\Pipeline\AddBeforePipelineStepCommandHandler($client),
Satellite\Cloud\Command\Pipeline\ReplacePipelineStepCommand::class => new Satellite\Cloud\Handler\Pipeline\ReplacePipelineStepCommandHandler($client),
Satellite\Cloud\Command\Pipeline\RemovePipelineStepCommand::class => new Satellite\Cloud\Handler\Pipeline\RemovePipelineStepCommandHandler($client),
Satellite\Cloud\Command\Workflow\DeclareWorkflowCommand::class => new Satellite\Cloud\Handler\Workflow\DeclareWorkflowCommandHandler($client),
Satellite\Cloud\Command\Workflow\RemoveWorkflowCommand::class => new Satellite\Cloud\Handler\Workflow\RemoveWorkflowCommandHandler($client),
Command\Pipeline\DeclarePipelineCommand::class => new Handler\Pipeline\DeclarePipelineCommandHandler($client),
Command\Pipeline\AddPipelineComposerPSR4AutoloadCommand::class => new Handler\Pipeline\AddPipelineComposerPSR4AutoloadCommandHandler($client),
Command\Pipeline\AppendPipelineStepCommand::class => new Handler\Pipeline\AppendPipelineStepCommandHandler($client),
Command\Pipeline\RemovePipelineCommand::class => new Handler\Pipeline\RemovePipelineCommandHandler($client),
Command\Pipeline\AddAfterPipelineStepCommand::class => new Handler\Pipeline\AddAfterPipelineStepCommandHandler($client),
Command\Pipeline\AddBeforePipelineStepCommand::class => new Handler\Pipeline\AddBeforePipelineStepCommandHandler($client),
Command\Pipeline\ReplacePipelineStepCommand::class => new Handler\Pipeline\ReplacePipelineStepCommandHandler($client),
Command\Pipeline\RemovePipelineStepCommand::class => new Handler\Pipeline\RemovePipelineStepCommandHandler($client),
Command\Workflow\DeclareWorkflowCommand::class => new Handler\Workflow\DeclareWorkflowCommandHandler($client),
Command\Workflow\RemoveWorkflowCommand::class => new Handler\Workflow\RemoveWorkflowCommandHandler($client),
]);
}

Expand Down
12 changes: 5 additions & 7 deletions src/Cloud/DTO/JobList.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@

namespace Kiboko\Component\Satellite\Cloud\DTO;

use Kiboko\Component\Satellite\Cloud\DTO;

readonly class JobList implements \Countable, \IteratorAggregate
{
private array $jobs;

public function __construct(
DTO\Workflow\JobInterface ...$job,
Workflow\JobInterface ...$job,
) {
$this->jobs = $job;
}
Expand All @@ -21,7 +19,7 @@ public function getIterator(): \Traversable
$jobs = $this->jobs;

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

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

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

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

public function get(string $code): DTO\Workflow\JobInterface
public function get(string $code): Workflow\JobInterface
{
foreach ($this->jobs as $job) {
if ($job->code->asString() === $code) {
Expand Down
4 changes: 2 additions & 2 deletions src/Cloud/Normalizer/ExpressionNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

class ExpressionNormalizer implements NormalizerInterface
{
public function normalize(mixed $object, string $format = null, array $context = []): string
public function normalize(mixed $object, ?string $format = null, array $context = []): string
{
return (string) $object;
}

public function supportsNormalization(mixed $data, string $format = null): bool
public function supportsNormalization(mixed $data, ?string $format = null): bool
{
return $data instanceof Expression;
}
Expand Down
7 changes: 3 additions & 4 deletions src/ConfigLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

namespace Kiboko\Component\Satellite;

use Kiboko\Component\Satellite;
use Kiboko\Contract\Configurator\InvalidConfigurationException;
use Symfony\Component\Config;

class ConfigLoader implements Satellite\ConfigLoaderInterface
class ConfigLoader implements ConfigLoaderInterface
{
public function __construct(private readonly string $basePath)
{
Expand Down Expand Up @@ -120,8 +119,8 @@ public function loadFile(string $file): array
$locator = new Config\FileLocator([$this->basePath]);

$loaderResolver = new Config\Loader\LoaderResolver([
new Satellite\Console\Config\YamlFileLoader($locator),
new Satellite\Console\Config\JsonFileLoader($locator),
new Console\Config\YamlFileLoader($locator),
new Console\Config\JsonFileLoader($locator),
]);

$delegatingLoader = new Config\Loader\DelegatingLoader($loaderResolver);
Expand Down
2 changes: 1 addition & 1 deletion src/ExpressionLanguage/ExpressionLanguage.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

final class ExpressionLanguage extends BaseExpressionLanguage
{
public function __construct(CacheItemPoolInterface $cache = null, array $providers = [])
public function __construct(?CacheItemPoolInterface $cache = null, array $providers = [])
{
parent::__construct($cache, [

Check warning on line 14 in src/ExpressionLanguage/ExpressionLanguage.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ { public function __construct(?CacheItemPoolInterface $cache = null, array $providers = []) { - parent::__construct($cache, [...$providers, new Provider()]); + parent::__construct($cache, [new Provider()]); } }

Check warning on line 14 in src/ExpressionLanguage/ExpressionLanguage.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ { public function __construct(?CacheItemPoolInterface $cache = null, array $providers = []) { - parent::__construct($cache, [...$providers, new Provider()]); + } }
...$providers,
new Provider(),
]);
Expand Down
4 changes: 2 additions & 2 deletions src/Feature/Logger/Builder/Monolog/GelfBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function withLevel(string $level): self
return $this;
}

public function withTCPTransport(string $host = null, int $port = null): self
public function withTCPTransport(?string $host = null, ?int $port = null): self
{
$this->transport = 'tcp';
$this->host = $host;
Expand All @@ -34,7 +34,7 @@ public function withTCPTransport(string $host = null, int $port = null): self
return $this;
}

public function withAMQPTransport(string $queue, string $channel, string $vhost, string $host = null, int $port = null, float $timeout = null): self
public function withAMQPTransport(string $queue, string $channel, string $vhost, ?string $host = null, ?int $port = null, ?float $timeout = null): self
{
$this->transport = 'amqp';
$this->queue = $queue;
Expand Down
4 changes: 2 additions & 2 deletions src/Feature/Logger/Factory/ElasticSearchFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function validate(array $config): bool
return false;
}

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

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

return new Logger\Factory\Repository\ElasticSearchRepository($builder);
return new Repository\ElasticSearchRepository($builder);
}
}
4 changes: 2 additions & 2 deletions src/Feature/Logger/Factory/GelfFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function validate(array $config): bool
return false;
}

public function compile(array $config): Logger\Factory\Repository\GelfRepository
public function compile(array $config): Repository\GelfRepository
{
$builder = new Logger\Builder\Monolog\GelfBuilder();

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

return new Logger\Factory\Repository\GelfRepository($builder);
return new Repository\GelfRepository($builder);
}
}
4 changes: 2 additions & 2 deletions src/Feature/Logger/Factory/StreamFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function validate(array $config): bool
return false;
}

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

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

return new Logger\Factory\Repository\StreamRepository($builder);
return new Repository\StreamRepository($builder);
}
}
Loading
Loading