Open andig opened 4 years ago
I think root cause is getSeries
which has meanwhile been modified:
public function getSeries()
{
$series = array_map(
function ($object) {
if (isset($object['error'])) {
throw new ClientException($object['error']);
}
return isset($object['series']) ? $object['series'] : [];
},
$this->parsedResults['results']
);
return array_shift($series);
}
array_shift($series);
on empty array will yield NULL
and hence yield the notice.
Seems this was changed in https://github.com/influxdata/influxdb-php/commit/ba96a93c0cbe74c0c3ca49f525de5b389c07e718. However, upgrading to 1.15, I'm getting:
In ResultSet.php line 107: Invalid statement index provided
I feel the reason is that in https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/ResultSet.php#L74 getSeries()
is called without parameter which means default value of 0
.
In getSeries()
, in https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/ResultSet.php#L106 this will throw when the result does not contain any and hence no 0
series.
Is that the desired behaviour?
Getting this warning when writing against Telegraf v1 listener