Skip to content

Commit 70bc097

Browse files
authored
Merge pull request #63 from fracz/patch-1
Implement reset() method in StatsdDataCollector
2 parents f5ca7cb + 475fc1b commit 70bc097

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

src/DataCollector/StatsdDataCollector.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@ class StatsdDataCollector extends DataCollector
1919
*/
2020
public function __construct()
2121
{
22-
$this->statsdClients = [];
23-
$this->data['clients'] = [];
24-
$this->data['operations'] = 0;
22+
$this->reset();
23+
}
24+
25+
/**
26+
* Reset the data collector to initial state
27+
*/
28+
public function reset()
29+
{
30+
$this->statsdClients = [];
31+
$this->data = [
32+
'clients' => [],
33+
'operations' => 0,
34+
];
2535
}
2636

2737
/**

0 commit comments

Comments
 (0)