Skip to content

Commit

Permalink
Implement reset() method in StatsdDataCollector
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fracz authored Jan 16, 2018
1 parent f5ca7cb commit 048449f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/DataCollector/StatsdDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,20 @@ class StatsdDataCollector extends DataCollector
* Construct the data collector
*/
public function __construct()
{
$this->reset();
}

/**
* Reset the data collector to initial state
*/
public function reset()
{
$this->statsdClients = [];
$this->data['clients'] = [];
$this->data['operations'] = 0;
}

/**
* Kernel event
*
Expand Down

0 comments on commit 048449f

Please sign in to comment.