Skip to content

Commit ab774ac

Browse files
galritobaywet
andauthored
Update src/JsonParseNode.php
Co-authored-by: Vincent Biret <[email protected]>
1 parent 0644551 commit ab774ac

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/JsonParseNode.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,13 @@ public function getIntegerValue(): ?int {
7474
* @inheritDoc
7575
*/
7676
public function getFloatValue(): ?float {
77-
return is_float($this->jsonNode) || is_int($this->jsonNode) ? floatval($this->jsonNode) : null;
77+
if (is_float($this->jsonNode)) {
78+
return $this->jsonNode;
79+
}
80+
if (is_int($this->jsonNode)) {
81+
return floatval($this->jsonNode);
82+
}
83+
return null;
7884
}
7985

8086
/**

0 commit comments

Comments
 (0)