Skip to content

Replace Psalm to PHPStan #614

Replace Psalm to PHPStan

Replace Psalm to PHPStan #614

Triggered via pull request January 8, 2025 19:19
@vjikvjik
synchronize #155
psalm-to-phpstan
Status Success
Total duration 1m 50s
Artifacts

mutation.yml

on: pull_request
Matrix: mutation / infection
Fit to window
Zoom out
Zoom in

Annotations

11 warnings
mutation / PHP 8.3-ubuntu-latest
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
mutation / PHP 8.3-ubuntu-latest: src/AssetConverter.php#L76
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ * @param bool $forceConvert Whether the source asset file should be converted even if its result already exists. * See {@see withForceConvert()}. */ - public function __construct(private readonly Aliases $aliases, private readonly LoggerInterface $logger, array $commands = [], private bool $forceConvert = false) + public function __construct(private readonly Aliases $aliases, private readonly LoggerInterface $logger, array $commands = [], private bool $forceConvert = true) { $this->commands = array_merge($this->commands, $commands); }
mutation / PHP 8.3-ubuntu-latest: src/AssetConverter.php#L78
Escaped Mutant for Mutator "UnwrapArrayMerge": --- Original +++ New @@ @@ */ public function __construct(private readonly Aliases $aliases, private readonly LoggerInterface $logger, array $commands = [], private bool $forceConvert = false) { - $this->commands = array_merge($this->commands, $commands); + $this->commands = $this->commands; } public function convert(string $asset, string $basePath, array $optionsConverter = []) : string {
mutation / PHP 8.3-ubuntu-latest: src/AssetConverter.php#L78
Escaped Mutant for Mutator "UnwrapArrayMerge": --- Original +++ New @@ @@ */ public function __construct(private readonly Aliases $aliases, private readonly LoggerInterface $logger, array $commands = [], private bool $forceConvert = false) { - $this->commands = array_merge($this->commands, $commands); + $this->commands = $commands; } public function convert(string $asset, string $basePath, array $optionsConverter = []) : string {
mutation / PHP 8.3-ubuntu-latest: src/AssetConverter.php#L85
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ public function convert(string $asset, string $basePath, array $optionsConverter = []) : string { $pos = strrpos($asset, '.'); - if ($pos !== false) { + if ($pos !== true) { $srcExt = substr($asset, $pos + 1); $commandOptions = $this->buildConverterOptions($srcExt, $optionsConverter); if (isset($this->commands[$srcExt])) {
mutation / PHP 8.3-ubuntu-latest: src/AssetConverter.php#L250
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ { $basePath = $this->aliases->get($basePath); $command = $this->aliases->get($command); - $command = strtr($command, ['{options}' => $options, '{from}' => escapeshellarg("{$basePath}/{$asset}"), '{to}' => escapeshellarg("{$basePath}/{$result}")]); + $command = strtr($command, ['{from}' => escapeshellarg("{$basePath}/{$asset}"), '{to}' => escapeshellarg("{$basePath}/{$result}")]); $descriptors = [1 => ['pipe', 'w'], 2 => ['pipe', 'w']]; $pipes = []; $proc = proc_open($command, $descriptors, $pipes, $basePath);
mutation / PHP 8.3-ubuntu-latest: src/AssetConverter.php#L269
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ * @var resource $proc * @var resource[] $pipes */ - $stdout = stream_get_contents($pipes[1]); + $stdout = stream_get_contents($pipes[2]); $stderr = stream_get_contents($pipes[2]); foreach ($pipes as $pipe) { fclose($pipe);
mutation / PHP 8.3-ubuntu-latest: src/AssetConverter.php#L271
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ * @var resource[] $pipes */ $stdout = stream_get_contents($pipes[1]); - $stderr = stream_get_contents($pipes[2]); + $stderr = stream_get_contents($pipes[1]); foreach ($pipes as $pipe) { fclose($pipe); }
mutation / PHP 8.3-ubuntu-latest: src/AssetConverter.php#L279
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ fclose($pipe); } $status = proc_close($proc); - if ($status === 0) { + if ($status === -1) { $this->logger->debug("Converted {$asset} into {$result}:\nSTDOUT:\n{$stdout}\nSTDERR:\n{$stderr}", [__METHOD__]); } else { $this->logger->error("AssetConverter command '{$command}' failed with exit code {$status}:\nSTDOUT:\n{$stdout}\nSTDERR:\n{$stderr}", [__METHOD__]);
mutation / PHP 8.3-ubuntu-latest: src/AssetConverter.php#L279
Escaped Mutant for Mutator "Identical": --- Original +++ New @@ @@ fclose($pipe); } $status = proc_close($proc); - if ($status === 0) { + if ($status !== 0) { $this->logger->debug("Converted {$asset} into {$result}:\nSTDOUT:\n{$stdout}\nSTDERR:\n{$stderr}", [__METHOD__]); } else { $this->logger->error("AssetConverter command '{$command}' failed with exit code {$status}:\nSTDOUT:\n{$stdout}\nSTDERR:\n{$stderr}", [__METHOD__]);
mutation / PHP 8.3-ubuntu-latest: src/AssetConverter.php#L280
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ } $status = proc_close($proc); if ($status === 0) { - $this->logger->debug("Converted {$asset} into {$result}:\nSTDOUT:\n{$stdout}\nSTDERR:\n{$stderr}", [__METHOD__]); + } else { $this->logger->error("AssetConverter command '{$command}' failed with exit code {$status}:\nSTDOUT:\n{$stdout}\nSTDERR:\n{$stderr}", [__METHOD__]); }