Add NullTypeCaster
#343
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)) {
|