-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement reset() method in StatsdDataCollector #63
Conversation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing to this project
Only 1 or 2 really small things to change IMO (see my comments), and this will be merged/released as soon as someone else from M6Web give their agreement 👍
{ | ||
$this->statsdClients = []; | ||
$this->data['clients'] = []; | ||
$this->data['operations'] = 0; | ||
} | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove those unneeded spaces here
/** | ||
* Reset the data collector to initial state | ||
*/ | ||
public function reset() | ||
{ | ||
$this->statsdClients = []; | ||
$this->data['clients'] = []; | ||
$this->data['operations'] = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please write the reset
function content this way:
$this->statsdClients = [];
$this->data = [
'clients' => [],
'operations' => 0,
];
as re-instanciating the whole data
property is how we already did the reset()
stuff in our other projects ( such as AmqpBundle or CassandraBundle )
Travis build was failing due to a down time on their side, I've restart it and now it's all green. I merge your PR and tag the release |
After upgrade to Symfony 3.4, there is a deprecation error caused by this class:
This PR introduces what the deprecation notice asks for.