Skip to content

Commit 048449f

Browse files
authored
Implement reset() method in StatsdDataCollector
After upgrade to Symfony 3.4, there is a deprecation error caused by this class: > Implementing "Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface" without the "reset()" method is deprecated since Symfony 3.4 and will be unsupported in 4.0 for class "M6Web\Bundle\StatsdBundle\DataCollector\StatsdDataCollector" This PR introduces what the deprecation notice asks for.
1 parent f5ca7cb commit 048449f

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/DataCollector/StatsdDataCollector.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,20 @@ class StatsdDataCollector extends DataCollector
1818
* Construct the data collector
1919
*/
2020
public function __construct()
21+
{
22+
$this->reset();
23+
}
24+
25+
/**
26+
* Reset the data collector to initial state
27+
*/
28+
public function reset()
2129
{
2230
$this->statsdClients = [];
2331
$this->data['clients'] = [];
2432
$this->data['operations'] = 0;
2533
}
26-
34+
2735
/**
2836
* Kernel event
2937
*

0 commit comments

Comments
 (0)