Normalise extension requirements #2661
Annotations
1 error and 10 warnings
Run mutation tests with Xdebug and infection/infection
Process completed with exit code 1.
|
Run mutation tests with Xdebug and infection/infection:
src/ChainNormalizer.php#L27
Escaped Mutant for Mutator "UnwrapArrayValues":
--- Original
+++ New
@@ @@
private array $normalizers;
public function __construct(Normalizer ...$normalizers)
{
- $this->normalizers = \array_values($normalizers);
+ $this->normalizers = $normalizers;
}
public function normalize(Json $json) : Json
{
|
Run mutation tests with Xdebug and infection/infection:
src/Exception/InvalidIndentStyle.php#L39
Escaped Mutant for Mutator "UnwrapArrayValues":
--- Original
+++ New
@@ @@
{
$exception = new self(\sprintf('Style needs to be one of "%s", but "%s" is not.', \implode('", "', $allowedStyles), $style));
$exception->style = $style;
- $exception->allowedStyles = \array_values($allowedStyles);
+ $exception->allowedStyles = $allowedStyles;
return $exception;
}
public function style() : string
|
Run mutation tests with Xdebug and infection/infection:
src/Exception/NormalizedInvalidAccordingToSchema.php#L35
Escaped Mutant for Mutator "UnwrapArrayValues":
--- Original
+++ New
@@ @@
{
$exception = new self(\sprintf('Normalized JSON is not valid according to schema "%s".', $schemaUri));
$exception->schemaUri = $schemaUri;
- $exception->errors = \array_values($errors);
+ $exception->errors = $errors;
return $exception;
}
public function schemaUri() : string
|
Run mutation tests with Xdebug and infection/infection:
src/Exception/OriginalInvalidAccordingToSchema.php#L35
Escaped Mutant for Mutator "UnwrapArrayValues":
--- Original
+++ New
@@ @@
{
$exception = new self(\sprintf('Original JSON is not valid according to schema "%s".', $schemaUri));
$exception->schemaUri = $schemaUri;
- $exception->errors = \array_values($errors);
+ $exception->errors = $errors;
return $exception;
}
public function schemaUri() : string
|
Run mutation tests with Xdebug and infection/infection:
src/Vendor/Composer/PackageHashNormalizer.php#L106
Escaped Mutant for Mutator "ConcatOperandRemoval":
--- Original
+++ New
@@ @@
if (1 === \preg_match(self::PLATFORM_PACKAGE_REGEX, $requirement)) {
return \preg_replace(['/^php/', '/^hhvm/', '/^ext/', '/^lib/', '/^\\D/'], ['0-$0', '1-$0', '2-$0', '3-$0', '4-$0'], $requirement);
}
- return '5-' . $requirement;
+ return $requirement;
};
\uksort($packages, static function (string $a, string $b) use($prefix) : int {
return \strnatcmp($prefix($a), $prefix($b));
|
Run mutation tests with Xdebug and infection/infection:
src/Vendor/Composer/PackageHashNormalizer.php#L106
Escaped Mutant for Mutator "ConcatOperandRemoval":
--- Original
+++ New
@@ @@
if (1 === \preg_match(self::PLATFORM_PACKAGE_REGEX, $requirement)) {
return \preg_replace(['/^php/', '/^hhvm/', '/^ext/', '/^lib/', '/^\\D/'], ['0-$0', '1-$0', '2-$0', '3-$0', '4-$0'], $requirement);
}
- return '5-' . $requirement;
+ return '5-';
};
\uksort($packages, static function (string $a, string $b) use($prefix) : int {
return \strnatcmp($prefix($a), $prefix($b));
|
Run mutation tests with Xdebug and infection/infection:
src/Vendor/Composer/PackageHashNormalizer.php#L106
Escaped Mutant for Mutator "Concat":
--- Original
+++ New
@@ @@
if (1 === \preg_match(self::PLATFORM_PACKAGE_REGEX, $requirement)) {
return \preg_replace(['/^php/', '/^hhvm/', '/^ext/', '/^lib/', '/^\\D/'], ['0-$0', '1-$0', '2-$0', '3-$0', '4-$0'], $requirement);
}
- return '5-' . $requirement;
+ return $requirement . '5-';
};
\uksort($packages, static function (string $a, string $b) use($prefix) : int {
return \strnatcmp($prefix($a), $prefix($b));
|
Run mutation tests with Xdebug and infection/infection:
src/Vendor/Composer/PackageHashNormalizer.php#L131
Escaped Mutant for Mutator "Foreach_":
--- Original
+++ New
@@ @@
*/
private static function mergeDuplicateExtensions($packages) : array
{
- foreach ($packages as $name => $value) {
+ foreach (array() as $name => $value) {
if (!\str_starts_with($name, 'ext-')) {
continue;
}
|
Run mutation tests with Xdebug and infection/infection:
src/Vendor/Composer/PackageHashNormalizer.php#L132
Escaped Mutant for Mutator "LogicalNot":
--- Original
+++ New
@@ @@
private static function mergeDuplicateExtensions($packages) : array
{
foreach ($packages as $name => $value) {
- if (!\str_starts_with($name, 'ext-')) {
+ if (\str_starts_with($name, 'ext-')) {
continue;
}
$newName = \str_replace(' ', '-', \strtolower($name));
|
Run mutation tests with Xdebug and infection/infection:
src/Vendor/Composer/PackageHashNormalizer.php#L133
Escaped Mutant for Mutator "Continue_":
--- Original
+++ New
@@ @@
{
foreach ($packages as $name => $value) {
if (!\str_starts_with($name, 'ext-')) {
- continue;
+ break;
}
$newName = \str_replace(' ', '-', \strtolower($name));
if ($name === $newName) {
|
Loading