refactor: Move the checksum mode to the --diff option #1143
unit-tests.yaml
on: pull_request
Matrix: infection
Matrix: unit-tests
Unit tests status
0s
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
{
|