symfony/symfony — pull request #11744 by Marmelatze (2014-08-23 14:30:02+00:00)
Title: [FrameworkBundle], [DependencyInjection] added logging of unused tags

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #11511
| License | MIT
| Doc PR | -

I gave this a short shot and added a new CompilerPass to log all tags, which are not queried by ``ContainerBuilder::findTaggedServiceIds()``.
Example log:
````
[2014-08-23 15:45:32] app.WARNING: Tag "kenrel.event_listener" was defined on the service(s) foo.bar_service, but was never used. Did you mean "kernel.event_listener"
````

This is maybe not the best solution, for tags defined in optional bundles. So I added a ``ignore`` configuration option for this case.

Configuration:
```yaml
framework:
compiler:
validate:
tags:
enabled: true
ignore:
- foo.bar
```

A better approach could be a explicit declaration of the tags and their arguments? Maybe in the extension class of the regarding bundle? But what should happen when a 3rd party bundle doesn't add such declaration?