Skip to content

[symfony] Make NoFindTaggedServiceIdsCallRule context-aware - #317

Merged
TomasVotruba merged 2 commits into
mainfrom
context-aware-find-tagged-service-ids
Sep 24, 2026
Merged

TomasVotruba merged 2 commits into
mainfrom
context-aware-find-tagged-service-ids

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

The rule reported every findTaggedServiceIds() call, including cases that a tagged iterator cannot replace.

A registerForAutoconfiguration() + tagged iterator cannot expose per-tag attributes. When the foreach body reads tag attributes (e.g. $tags[0]['alias']), the call must stay - so it is now skipped.

Simple usage (value passed directly, no attribute offset access) is still reported.

  • skip when the foreach value variable is accessed via array offset (tag attributes)
  • report otherwise, incl. no-foreach assignments and plain-value foreach

@TomasVotruba
TomasVotruba enabled auto-merge (squash) September 24, 2026 08:38
@TomasVotruba
TomasVotruba merged commit de06599 into main Sep 24, 2026
8 checks passed
@TomasVotruba
TomasVotruba deleted the context-aware-find-tagged-service-ids branch September 24, 2026 08:39
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.

1 participant