Skip to content

[Php80] Drop import-adding from NestedAnnotationToAttributeRector - #8561

Merged
TomasVotruba merged 1 commit into
mainfrom
remove-nested-annotation-extra-use-imports
Oct 9, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
remove-nested-annotation-extra-use-imports

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

The rule reached into $this->file->getFileNode()->getPendingImports() via a completeExtraUseImports() method to register a use for the nested attribute class. Adding imports from inside a rule crosses the layer that the PostRector/NameImporter path owns.

Instead, PhpNestedAttributeGroupFactory now emits a FullyQualified attribute name when a new import is needed, so the standard name-importing path handles it when importNames is on, and the output stays valid FQN otherwise. No rule-level import manipulation remains.

Removed along with the method: the now-unused AttributeKey::EXTRA_USE_IMPORT constant.

@TomasVotruba
TomasVotruba merged commit 8e989bc into main Oct 9, 2026
50 checks passed
@TomasVotruba
TomasVotruba deleted the remove-nested-annotation-extra-use-imports branch October 9, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant