Enhancement: Require ergebnis/json-normalizer:^4.5.0
#2392
Annotations
10 warnings
Run mutation tests with Xdebug and infection/infection:
src/Command/NormalizeCommand.php#L151
Escaped Mutant for Mutator "NotIdentical":
--- Original
+++ New
@@ @@
$io->writeError(\sprintf('<error>%s</error>', $exception->getMessage()));
return 1;
}
- if (null !== $indentFromExtra) {
+ if (null === $indentFromExtra) {
$indent = $indentFromExtra;
}
if (null !== $indentFromInput && null !== $indentFromExtra) {
|
Run mutation tests with Xdebug and infection/infection:
src/Command/NormalizeCommand.php#L156
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
if (null !== $indentFromExtra) {
$indent = $indentFromExtra;
}
- if (null !== $indentFromInput && null !== $indentFromExtra) {
+ if (null !== $indentFromInput || null !== $indentFromExtra) {
$io->write('<warning>Configuration provided via options and composer extra. Using configuration from composer extra.</warning>');
}
if (false === $input->getOption('dry-run') && !\is_writable($composerFile)) {
|
Run mutation tests with Xdebug and infection/infection:
src/Command/NormalizeCommand.php#L163
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
if (null !== $indentFromInput && null !== $indentFromExtra) {
$io->write('<warning>Configuration provided via options and composer extra. Using configuration from composer extra.</warning>');
}
- if (false === $input->getOption('dry-run') && !\is_writable($composerFile)) {
+ if (true === $input->getOption('dry-run') && !\is_writable($composerFile)) {
$io->writeError(\sprintf('<error>%s is not writable.</error>', $composerFile));
return 1;
}
|
Run mutation tests with Xdebug and infection/infection:
src/Command/NormalizeCommand.php#L163
Escaped Mutant for Mutator "Identical":
--- Original
+++ New
@@ @@
if (null !== $indentFromInput && null !== $indentFromExtra) {
$io->write('<warning>Configuration provided via options and composer extra. Using configuration from composer extra.</warning>');
}
- if (false === $input->getOption('dry-run') && !\is_writable($composerFile)) {
+ if (false !== $input->getOption('dry-run') && !\is_writable($composerFile)) {
$io->writeError(\sprintf('<error>%s is not writable.</error>', $composerFile));
return 1;
}
|
Run mutation tests with Xdebug and infection/infection:
src/Command/NormalizeCommand.php#L228
Escaped Mutant for Mutator "CatchBlockRemoval":
--- Original
+++ New
@@ @@
});
try {
$normalized = $normalizer->normalize($json);
- } catch (Normalizer\Exception\OriginalInvalidAccordingToSchema $exception) {
- $io->writeError('<error>Original composer.json does not match the expected JSON schema:</error>');
- self::showValidationErrors($io, ...$exception->errors());
- return 1;
} catch (Normalizer\Exception\NormalizedInvalidAccordingToSchema $exception) {
$io->writeError('<error>Normalized composer.json does not match the expected JSON schema:</error>');
self::showValidationErrors($io, ...$exception->errors());
|
Run mutation tests with Xdebug and infection/infection:
src/Command/NormalizeCommand.php#L228
Escaped Mutant for Mutator "CatchBlockRemoval":
--- Original
+++ New
@@ @@
$io->writeError('<error>Original composer.json does not match the expected JSON schema:</error>');
self::showValidationErrors($io, ...$exception->errors());
return 1;
- } catch (Normalizer\Exception\NormalizedInvalidAccordingToSchema $exception) {
- $io->writeError('<error>Normalized composer.json does not match the expected JSON schema:</error>');
- self::showValidationErrors($io, ...$exception->errors());
- return 1;
} catch (\RuntimeException $exception) {
$io->writeError(\sprintf('<error>%s</error>', $exception->getMessage()));
return 1;
|
Run mutation tests with Xdebug and infection/infection:
src/Command/NormalizeCommand.php#L228
Escaped Mutant for Mutator "CatchBlockRemoval":
--- Original
+++ New
@@ @@
$io->writeError('<error>Normalized composer.json does not match the expected JSON schema:</error>');
self::showValidationErrors($io, ...$exception->errors());
return 1;
- } catch (\RuntimeException $exception) {
- $io->writeError(\sprintf('<error>%s</error>', $exception->getMessage()));
- return 1;
}
if ($json->encoded() === $normalized->encoded()) {
$io->write(\sprintf('<info>%s is already normalized.</info>', $composerFile));
|
Run mutation tests with Xdebug and infection/infection:
src/Command/NormalizeCommand.php#L280
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
if (true === $input->getOption('diff') || true === $input->getOption('dry-run')) {
$io->writeError(\sprintf('<error>%s is not normalized.</error>', $composerFile));
$diff = $this->differ->diff($json->encoded(), $normalized->encoded());
- $io->write(['', '<fg=yellow>---------- begin diff ----------</>', self::formatDiff($diff), '<fg=yellow>----------- end diff -----------</>', '']);
+ $io->write(['<fg=yellow>---------- begin diff ----------</>', self::formatDiff($diff), '<fg=yellow>----------- end diff -----------</>', '']);
}
if (true === $input->getOption('dry-run')) {
return 1;
|
Run mutation tests with Xdebug and infection/infection:
src/Command/NormalizeCommand.php#L310
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
if (true === $input->getOption('no-update-lock') || !$locker->isLocked()) {
return 0;
}
- $io->write('<info>Updating lock file.</info>');
+
$application = new Application();
$application->setAutoExit(false);
return self::updateLockerInWorkingDirectory($application, $input, $output, \dirname($composerFile));
|
Run mutation tests with Xdebug and infection/infection:
src/Command/NormalizeCommand.php#L433
Escaped Mutant for Mutator "GreaterThan":
--- Original
+++ New
@@ @@
if (!\is_int($indentSize)) {
throw new \RuntimeException(\sprintf('Indent size needs to be an integer, got %s instead.', \gettype($indentSize)));
}
- if (1 > $indentSize) {
+ if (1 >= $indentSize) {
throw new \RuntimeException(\sprintf('Indent size needs to be an integer greater than 0, but %d is not.', $indentSize));
}
$indentStyle = $configuration['indent-style'];
|
The logs for this run have expired and are no longer available.
Loading