Skip to content

refactor: Move the checksum mode to the --diff option #1143

refactor: Move the checksum mode to the --diff option

refactor: Move the checksum mode to the --diff option #1143

Triggered via pull request October 11, 2023 14:47
Status Failure
Total duration 11m 2s
Artifacts

unit-tests.yaml

on: pull_request
Matrix: infection
Matrix: unit-tests
Unit tests status
0s
Unit tests status
Fit to window
Zoom out
Zoom in

Annotations

2 errors and 2 warnings
Infection (PHP 8.1)
Process completed with exit code 2.
Unit tests status
Process completed with exit code 1.
Infection (PHP 8.1): src/Console/Command/Diff.php#L231
Escaped Mutant for Mutator "LogicalOr": --- Original +++ New @@ @@ $io->writeln(sprintf('⚠️ <warning>Using the option "%s" is deprecated. Use "--%s=%s" instead.</warning>', self::LIST_FILES_DIFF_OPTION, self::DIFF_OPTION, DiffMode::FILE_NAME->value)); return DiffMode::FILE_NAME; } - if ($io->hasOption('-c') || $io->hasOption('--check')) { + if ($io->hasOption('-c') && $io->hasOption('--check')) { $io->writeln(sprintf('⚠️ <warning>Using the option "%s" is deprecated. Use "--%s=%s" instead.</warning>', self::CHECK_OPTION, self::DIFF_OPTION, DiffMode::CHECKSUM->value)); return DiffMode::FILE_NAME; }
Infection (PHP 8.1): src/Console/Command/Diff.php#L263
Escaped Mutant for Mutator "Coalesce": --- Original +++ New @@ @@ $io->writeln(sprintf('⚠️ <warning>Using the option "%s" is deprecated. Use "--%s=\\<algorithm\\>" instead.</warning>', self::CHECK_OPTION, self::CHECKSUM_ALGORITHM_OPTION)); return $checksumAlgorithm; } - return $io->getOption(self::CHECKSUM_ALGORITHM_OPTION)->asNullableNonEmptyString() ?? self::DEFAULT_CHECKSUM_ALGO; + return self::DEFAULT_CHECKSUM_ALGO ?? $io->getOption(self::CHECKSUM_ALGORITHM_OPTION)->asNullableNonEmptyString(); } private function renderContentsDiff(PharDiff $diff, DiffMode $diffMode, string $checksumAlgorithm, IO $io) : void {