Skip to content

Commit

Permalink
Simplify NumericHelper::normalize() usage (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Oct 23, 2023
1 parent 1a45a4b commit 0429b31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"php": "^8.0",
"psr/container": "^2.0",
"yiisoft/injector": "^1.1",
"yiisoft/strings": "^2.1"
"yiisoft/strings": "^2.3"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.4",
Expand Down
4 changes: 2 additions & 2 deletions src/TypeCaster/PhpNativeTypeCaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function cast(mixed $value, TypeCastContext $context): Result
return Result::success((int) $value);
}
if ($value instanceof Stringable || is_string($value)) {
return Result::success((int) NumericHelper::normalize((string) $value));
return Result::success((int) NumericHelper::normalize($value));
}
break;

Expand All @@ -117,7 +117,7 @@ public function cast(mixed $value, TypeCastContext $context): Result
return Result::success((float) $value);
}
if ($value instanceof Stringable || is_string($value)) {
return Result::success((float) NumericHelper::normalize((string) $value));
return Result::success((float) NumericHelper::normalize($value));
}
break;

Expand Down

0 comments on commit 0429b31

Please sign in to comment.