diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ea574d0..f2c7c112 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## 3.9.0 [unreleased] +### Bug Fixes +1. [#170](https://github.com/influxdata/influxdb-client-php/pull/170): Fix PHP 8.5 deprecations. + ### Others 1. [#171](https://github.com/influxdata/influxdb-client-php/pull/171): Bring CI pipeline up to date. diff --git a/src/InfluxDB2/FluxCsvParser.php b/src/InfluxDB2/FluxCsvParser.php index 30da573e..78830149 100644 --- a/src/InfluxDB2/FluxCsvParser.php +++ b/src/InfluxDB2/FluxCsvParser.php @@ -283,7 +283,7 @@ private function toValue($strVal, FluxColumn $column) if ($strVal == '-Inf') { return -INF; } - return (double)$strVal; + return (float)$strVal; } if ('base64Binary' == $column->dataType) { diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 9c6cf7a4..26d3a2c2 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -4,7 +4,6 @@ use Exception; use InfluxDB2\Client; -use IntegrationBaseTestCase; require_once('IntegrationBaseTestCase.php'); diff --git a/tests/DefaultApiTest.php b/tests/DefaultApiTest.php index c9f8f6df..a979a49b 100644 --- a/tests/DefaultApiTest.php +++ b/tests/DefaultApiTest.php @@ -156,7 +156,9 @@ private function property_value(object $object, string $property_name): object { $reflection = new ReflectionObject($object); $property = $reflection->getProperty($property_name); - $property->setAccessible(true); + if (PHP_VERSION_ID < 80100) { + $property->setAccessible(true); + } return $property->getValue($object); } } diff --git a/tests/FluxCsvParserTest.php b/tests/FluxCsvParserTest.php index 338ffb4e..1117b5fd 100644 --- a/tests/FluxCsvParserTest.php +++ b/tests/FluxCsvParserTest.php @@ -515,7 +515,7 @@ private function assertMultipleRecords(array $tables) private function assertRecord(FluxRecord $fluxRecord, array $values, $size = 0, $value = null) { foreach ($values as $key => $val) { - $this->assertEquals($values[$key], $fluxRecord->values[$key]); + $this->assertEquals($val, $fluxRecord->values[$key]); } if ($value == null) { diff --git a/tests/ITBucketServiceTest.php b/tests/ITBucketServiceTest.php index db762fb3..9346d68d 100644 --- a/tests/ITBucketServiceTest.php +++ b/tests/ITBucketServiceTest.php @@ -1,5 +1,7 @@ setAccessible(true); + if (PHP_VERSION_ID < 80100) { + $method->setAccessible(true); + } return $this->getMockBuilder(UdpWriter::class) - ->setMethods(['writeSocket']) + ->onlyMethods(['writeSocket']) ->setConstructorArgs([$this->baseConfig + ['udpPort' => 1000]]) ->getMock(); }