Skip to content
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

Merged
merged 2 commits into from
Jan 17, 2018

Conversation

fracz
Copy link
Contributor

@fracz fracz commented Jan 16, 2018

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.

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.
Copy link
Member

@Oliboy50 Oliboy50 left a 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;
}

Copy link
Member

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;
Copy link
Member

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 )

@Oliboy50
Copy link
Member

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 v2.15.1, thanks again for your contribution :)

@Oliboy50 Oliboy50 merged commit 70bc097 into BedrockStreaming:master Jan 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants