Skip to content

Commit 9837263

Browse files
committed
handle both ints and floats
1 parent e908c2c commit 9837263

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Accessor/StringValue.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public function toInt(): int {
4949
}
5050

5151
public function toFloat(): float {
52-
if (is_int($this->raw)) {
53-
return $this->raw;
52+
if (is_float($this->raw) || is_int($this->raw)) {
53+
return (float) $this->raw;
5454
}
5555

5656
if (false === is_numeric($this->value)) {

0 commit comments

Comments
 (0)