diff --git a/src/JsonReader.php b/src/JsonReader.php index 202c779..b1b0e13 100644 --- a/src/JsonReader.php +++ b/src/JsonReader.php @@ -24,7 +24,7 @@ class JsonReader const END_OBJECT = "END_OBJECT"; /* Options */ - const FLOAT_AS_STRING = 0b00000001; + const FLOATS_AS_STRINGS = 0b00000001; /** * @var Parser|null @@ -278,7 +278,7 @@ private function buildTree(string $type, bool $writeCache): array private function castNumber(string $number) { $cast = +$number; - if (($this->options & self::FLOAT_AS_STRING) && \is_float($cast)) { + if (($this->options & self::FLOATS_AS_STRINGS) && \is_float($cast)) { return $number; } return $cast; diff --git a/test/JsonReaderTest.php b/test/JsonReaderTest.php index cfe89fd..8392297 100644 --- a/test/JsonReaderTest.php +++ b/test/JsonReaderTest.php @@ -190,7 +190,7 @@ public function testReadWithOptionFloatAsString() [JsonReader::END_OBJECT, null, null, 0], ]; - $reader = new JsonReader(JsonReader::FLOAT_AS_STRING); + $reader = new JsonReader(JsonReader::FLOATS_AS_STRINGS); $reader->init($this->parser); $i = 0;