Skip to content

[FrameworkBundle] Allow to leverage autoconfiguration for DataCollectors with template #37332

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

Merged
merged 1 commit into from
Aug 13, 2020

Conversation

l-vo
Copy link
Contributor

@l-vo l-vo commented Jun 18, 2020

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets
License MIT
Doc PR symfony/symfony-docs#14085

When creating a datacollector with a template for the profiler display, an id must be set in the data_collector tag and must be the same as this returned by DataCollectorInterface::getName. A template path can also be added to the tag. We lose in this case the ability to use autoconfigure. This PR suggests:

  • To guess the id configured in the data_collector tag. To follow the principle already used for services ids or events names, if not specified, the id is the data collector class name.
  • To allow data collectors to provide the template path from the code. Note that the template path configuration via the data_collector tags still takes precedence over configuration from the code.

This PR also provides an AbstractDataCollector to avoid to implement methods that might be considered as boilerplate: reset and getName.

@l-vo l-vo force-pushed the leverage_autoconfigure_data_collectors branch 2 times, most recently from 16bf031 to 02e3138 Compare June 18, 2020 08:30
@nicolas-grekas nicolas-grekas added this to the next milestone Jun 18, 2020
@l-vo l-vo force-pushed the leverage_autoconfigure_data_collectors branch from 02e3138 to 1b65514 Compare August 12, 2020 18:50
@l-vo l-vo force-pushed the leverage_autoconfigure_data_collectors branch from 1b65514 to 986a0a2 Compare August 12, 2020 18:59
@l-vo
Copy link
Contributor Author

l-vo commented Aug 12, 2020

Rebased and requested changes processed

@fabpot
Copy link
Member

fabpot commented Aug 13, 2020

Thank you @l-vo.

@fabpot fabpot merged commit fee690a into symfony:master Aug 13, 2020
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Sep 22, 2020
…/autoconfigure (l-vo)

This PR was merged into the master branch.

Discussion
----------

Documentation about custom data collectors with autowire/autoconfigure

Feature integrated in symfony/symfony#37332

Close #14060

Commits
-------

54eafd3 Documentation about custom data collectors with autowire/autoconfigure
@l-vo l-vo deleted the leverage_autoconfigure_data_collectors branch September 22, 2020 15:42
@nicolas-grekas nicolas-grekas modified the milestones: next, 5.2 Oct 5, 2020
@fabpot fabpot mentioned this pull request Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants