Skip to content

Add support for value-of<BackedEnum> #1092

Add support for value-of<BackedEnum>

Add support for value-of<BackedEnum> #1092

Triggered via pull request May 3, 2024 06:56
Status Success
Total duration 1m 0s
Artifacts

mutation.yml

on: pull_request
Mutation tests
48s
Mutation tests
Fit to window
Zoom out
Zoom in

Annotations

6 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#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)) {