Fix QA #5
quality-assurance.yml
on: push
coding-standards-analysis
/
coding-standards-php
21s
mutation-tests
1m 49s
Matrix: lint
Matrix: static-code-analysis
Matrix: unit-tests
Annotations
10 warnings
mutation-tests:
src/Type.php#L319
Escaped Mutant for Mutator "NotIdentical":
--- Original
+++ New
@@ @@
{
$name = $type->getName();
$name === 'resource' and $name = '\resource';
- $hasNull = $type->allowsNull() && $name !== 'null' && $name !== 'mixed';
+ $hasNull = $type->allowsNull() && $name !== 'null' && $name === 'mixed';
return [$name, $hasNull];
}
/**
|
mutation-tests:
src/Type.php#L319
Escaped Mutant for Mutator "LogicalAndAllSubExprNegation":
--- Original
+++ New
@@ @@
{
$name = $type->getName();
$name === 'resource' and $name = '\resource';
- $hasNull = $type->allowsNull() && $name !== 'null' && $name !== 'mixed';
+ $hasNull = !$type->allowsNull() && !($name !== 'null') && !($name !== 'mixed');
return [$name, $hasNull];
}
/**
|
mutation-tests:
src/Type.php#L471
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
if ($this->types === [['mixed']]) {
return true;
}
- if ($this->types === [['never']] || $this->types === [['void']]) {
+ if ($this->types === [[]] || $this->types === [['void']]) {
return false;
}
/** @infection-ignore-all */
|
mutation-tests:
src/Type.php#L471
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
if ($this->types === [['mixed']]) {
return true;
}
- if ($this->types === [['never']] || $this->types === [['void']]) {
+ if ($this->types === [] || $this->types === [['void']]) {
return false;
}
/** @infection-ignore-all */
|
mutation-tests:
src/Type.php#L471
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
if ($this->types === [['mixed']]) {
return true;
}
- if ($this->types === [['never']] || $this->types === [['void']]) {
+ if ($this->types === [['never']] || $this->types === [[]]) {
return false;
}
/** @infection-ignore-all */
|
mutation-tests:
src/Type.php#L471
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
if ($this->types === [['mixed']]) {
return true;
}
- if ($this->types === [['never']] || $this->types === [['void']]) {
+ if ($this->types === [['never']] || $this->types === []) {
return false;
}
/** @infection-ignore-all */
|
mutation-tests:
src/Type.php#L471
Escaped Mutant for Mutator "LogicalOr":
--- Original
+++ New
@@ @@
if ($this->types === [['mixed']]) {
return true;
}
- if ($this->types === [['never']] || $this->types === [['void']]) {
+ if ($this->types === [['never']] && $this->types === [['void']]) {
return false;
}
/** @infection-ignore-all */
|
mutation-tests:
src/Type.php#L502
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
public function matchedBy(Type|string $compare): bool
{
$compare instanceof Type or $compare = Type::byString($compare);
- if ($this->types === [['mixed']] || $compare->types === [['mixed']]) {
+ if ($this->types === [['mixed']] || $compare->types === [[]]) {
return $this->types === [['mixed']];
}
if ($this->types === $compare->types) {
|
mutation-tests:
src/Type.php#L502
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
public function matchedBy(Type|string $compare): bool
{
$compare instanceof Type or $compare = Type::byString($compare);
- if ($this->types === [['mixed']] || $compare->types === [['mixed']]) {
+ if ($this->types === [['mixed']] || $compare->types === []) {
return $this->types === [['mixed']];
}
if ($this->types === $compare->types) {
|
mutation-tests:
src/Type.php#L707
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
$isUnion = $this->types !== [];
// We are adding a union type, but if we already have types which must be standalone, or
// if we are adding now some standalone types while having already some types, we bail.
- if ($this->types === [['mixed']] || $this->types === [['void']] || $this->types === [['never']] || $isUnion && ($types === ['mixed'] || $types === ['void'] || $types === ['never'])) {
+ if ($this->types === [['mixed']] || $this->types === [[]] || $this->types === [['never']] || $isUnion && ($types === ['mixed'] || $types === ['void'] || $types === ['never'])) {
throw new \Error("'mixed', 'void', and 'never' only be used as standalone types.");
}
if ($this->types === [['resource']] || $isUnion && $types === ['resource']) {
|