Skip to content

Add NullTypeCaster #343

Add NullTypeCaster

Add NullTypeCaster #343

Triggered via pull request February 8, 2024 15:16
@vjikvjik
opened #74
improve
Status Failure
Total duration 46s
Artifacts

mutation.yml

on: pull_request
Matrix: mutation / roave-infection
Fit to window
Zoom out
Zoom in

Annotations

1 error and 3 warnings
mutation / PHP 8.2-ubuntu-latest
Process completed with exit code 1.
mutation / PHP 8.2-ubuntu-latest: src/TypeCaster/PhpNativeTypeCaster.php#L112
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ } if ($value instanceof Stringable || is_string($value)) { $value = NumericHelper::normalize($value); - return Result::success($t->allowsNull() && $value === '' ? null : (int) $value); + return Result::success($t->allowsNull() || $value === '' ? null : (int) $value); } break; case 'float':
mutation / PHP 8.2-ubuntu-latest: src/TypeCaster/PhpNativeTypeCaster.php#L122
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ } if ($value instanceof Stringable || is_string($value)) { $value = NumericHelper::normalize($value); - return Result::success($t->allowsNull() && $value === '' ? null : (float) $value); + return Result::success($t->allowsNull() || $value === '' ? null : (float) $value); } break; case 'bool':
mutation / PHP 8.2-ubuntu-latest: src/TypeCaster/PhpNativeTypeCaster.php#L127
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ } break; case 'bool': - if ($t->allowsNull() && $value === '') { + if ($t->allowsNull() || $value === '') { return Result::success(null); } if (is_scalar($value) || $value === null || is_array($value) || is_object($value)) {