Add support for value-of<BackedEnum> #1091
Annotations
8 warnings
Mutation tests
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions/cache@v3, actions/cache@v3.2.5. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
Mutation tests:
src/Type/Parser/Lexer/Token/ValueOfToken.php#L32
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
throw new OpeningBracketMissing($this->symbol());
}
$subType = $stream->read();
- if ($stream->done() || !$stream->forward() instanceof ClosingBracketToken) {
+ if ($stream->done() || !true) {
throw new ClosingBracketMissing($this->symbol());
}
if ($subType instanceof UnionType && count($subType->types()) === 1) {
|
Mutation tests:
src/Type/Parser/Lexer/Token/ValueOfToken.php#L32
Escaped Mutant for Mutator "LogicalOr":
--- Original
+++ New
@@ @@
throw new OpeningBracketMissing($this->symbol());
}
$subType = $stream->read();
- if ($stream->done() || !$stream->forward() instanceof ClosingBracketToken) {
+ if ($stream->done() && !$stream->forward() instanceof ClosingBracketToken) {
throw new ClosingBracketMissing($this->symbol());
}
if ($subType instanceof UnionType && count($subType->types()) === 1) {
|
Mutation tests:
src/Type/Parser/Lexer/Token/ValueOfToken.php#L36
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
if ($stream->done() || !$stream->forward() instanceof ClosingBracketToken) {
throw new ClosingBracketMissing($this->symbol());
}
- if ($subType instanceof UnionType && count($subType->types()) === 1) {
+ if (false && count($subType->types()) === 1) {
$subType = $subType->types()[0];
}
if (!$subType instanceof EnumType) {
|
Mutation tests:
src/Type/Parser/Lexer/Token/ValueOfToken.php#L36
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
if ($stream->done() || !$stream->forward() instanceof ClosingBracketToken) {
throw new ClosingBracketMissing($this->symbol());
}
- if ($subType instanceof UnionType && count($subType->types()) === 1) {
+ if ($subType instanceof UnionType && count($subType->types()) === 2) {
$subType = $subType->types()[0];
}
if (!$subType instanceof EnumType) {
|
Mutation tests:
src/Type/Parser/Lexer/Token/ValueOfToken.php#L36
Escaped Mutant for Mutator "Identical":
--- Original
+++ New
@@ @@
if ($stream->done() || !$stream->forward() instanceof ClosingBracketToken) {
throw new ClosingBracketMissing($this->symbol());
}
- if ($subType instanceof UnionType && count($subType->types()) === 1) {
+ if ($subType instanceof UnionType && count($subType->types()) !== 1) {
$subType = $subType->types()[0];
}
if (!$subType instanceof EnumType) {
|
Mutation tests:
src/Type/Parser/Lexer/Token/ValueOfToken.php#L40
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
if ($subType instanceof UnionType && count($subType->types()) === 1) {
$subType = $subType->types()[0];
}
- if (!$subType instanceof EnumType) {
+ if (!true) {
throw new NotBackedEnum($subType->toString());
}
$list = [];
|
Mutation tests:
src/Type/Parser/Lexer/Token/ValueOfToken.php#L46
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
}
$list = [];
foreach ($subType->cases() as $case) {
- if (!$case instanceof BackedEnum) {
+ if (!true) {
throw new NotBackedEnum($this->symbol());
}
if (is_string($case->value)) {
|