Skip to content

Commit 800a060

Browse files
angelovNyholm
authored andcommitted
Implementing reset method in Neo4jDataCollector (#43)
* implementing reset method in datacollector * resetting the query logger * removed docblocks as suggested by styleci * removed empty spaces
1 parent b6846de commit 800a060

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Collector/Neo4jDataCollector.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ public function collect(Request $request, Response $response, \Exception $except
3636
});
3737
}
3838

39+
public function reset()
40+
{
41+
$this->data = [];
42+
$this->queryLogger->reset();
43+
}
44+
3945
/**
4046
* @return int
4147
*/

Collector/QueryLogger.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ public function finish(StatementResultInterface $statementResult)
9090
]);
9191
}
9292

93+
public function reset()
94+
{
95+
$this->nbQueries = 0;
96+
$this->statements = [];
97+
$this->statementsHash = [];
98+
}
99+
93100
/**
94101
* @param Neo4jExceptionInterface $exception
95102
*/

0 commit comments

Comments
 (0)