-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
added logging of unused tags #15963
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
added logging of unused tags #15963
Conversation
…during container compilation
$tags = array_values(array_diff($this->findTags(), $this->usedTags)); | ||
$tags = array_unique($tags); | ||
|
||
return $tags; |
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.
return array_unique($tags)
(overwriting variables usually not nice)
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.
actually, the array_unique is useless because findTags
already ensures that
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.
yep
IMO it's enough to add the |
* @var array | ||
*/ | ||
protected $whitelist = array( | ||
"console.command", |
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.
use single quotes please
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.
indeed
9dcab2b
to
2054135
Compare
Indeed, the pass is now only enabled on debug. That makes sense as the compile log is only dumped in debug mode anyway. Should be ready now. |
/** | ||
* Returns all tags not queried by findTaggedServiceIds | ||
* | ||
* @return array An array of tags |
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.
lets use string[]
to be more specific
👍 Status: Reviewed |
Thank you @Marmelatze. |
This PR was merged into the 2.8 branch. Discussion ---------- added logging of unused tags | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #11511, #11744 | License | MIT | Doc PR | - This is the same as #11744 but with some minor tweaks and some unit tests for the compiler pass. Commits ------- 95c9f50 added some tests d3271e1 missing tags in whitelist f51fe4a [FrameworkBundle] [DependencyInjection] added logging of unused tags during container compilation
This is the same as #11744 but with some minor tweaks and some unit tests for the compiler pass.