Skip to content

Commit 848a73a

Browse files
authored
Allow null $statement to be convert to empty array (#62)
* Allow null $statement to be convert to empty array Fixed neo4j-examples/movies-symfony-php-bolt#4 * Fixed code styles * Fixed CS
1 parent bb52b71 commit 848a73a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Collector/QueryLogger.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,11 @@ public function getElapsedTime()
159159
return $time;
160160
}
161161

162-
private function statisticsToArray(StatementStatisticsInterface $statementStatistics)
162+
private function statisticsToArray(?StatementStatisticsInterface $statementStatistics)
163163
{
164+
if (!$statementStatistics) {
165+
return [];
166+
}
164167
$data = [
165168
'contains_updates' => $statementStatistics->containsUpdates(),
166169
'nodes_created' => $statementStatistics->nodesCreated(),

0 commit comments

Comments
 (0)