Skip to content

fix: skip node build for NullType when value is not null #1078

fix: skip node build for NullType when value is not null

fix: skip node build for NullType when value is not null #1078

Triggered via pull request April 10, 2024 18:01
Status Success
Total duration 32s
Artifacts

mutation.yml

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

Annotations

4 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/Mapper/Tree/Builder/UnionNodeBuilder.php#L44
Escaped Mutant for Mutator "InstanceOf_": --- Original +++ New @@ @@ foreach ($type->types() as $subType) { // Performance optimisation: No need to perform a node build for NullType if the value is not null. // This speeds up the very common case of nullable types by halving the amount of node build calls. - if ($subType instanceof NullType && $shell->value() !== null) { + if (false && $shell->value() !== null) { continue; } $node = $rootBuilder->build($shell->withType($subType));
Mutation tests: src/Mapper/Tree/Builder/UnionNodeBuilder.php#L44
Escaped Mutant for Mutator "NotIdentical": --- Original +++ New @@ @@ foreach ($type->types() as $subType) { // Performance optimisation: No need to perform a node build for NullType if the value is not null. // This speeds up the very common case of nullable types by halving the amount of node build calls. - if ($subType instanceof NullType && $shell->value() !== null) { + if ($subType instanceof NullType && $shell->value() === null) { continue; } $node = $rootBuilder->build($shell->withType($subType));
Mutation tests: src/Mapper/Tree/Builder/UnionNodeBuilder.php#L44
Escaped Mutant for Mutator "LogicalAndAllSubExprNegation": --- Original +++ New @@ @@ foreach ($type->types() as $subType) { // Performance optimisation: No need to perform a node build for NullType if the value is not null. // This speeds up the very common case of nullable types by halving the amount of node build calls. - if ($subType instanceof NullType && $shell->value() !== null) { + if (!$subType instanceof NullType && !($shell->value() !== null)) { continue; } $node = $rootBuilder->build($shell->withType($subType));