Skip to content

[CodingStyle] Import plain partially qualified names again, keep Doctrine/Symfony aliases covered - #8933

Merged
TomasVotruba merged 1 commit into
mainfrom
keep-doctrine-symfony-alias-imports
Nov 14, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
keep-doctrine-symfony-alias-imports

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Follow-up to #8932.

#8932 kept every partially qualified name as written. That caused a regression: a node copied from another file (e.g. an inherited constructor param typed Sub\Dep in the parent file) keeps its partially qualified originalName, so it stayed fully qualified in the child instead of being imported.

This PR:

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

#[ORM\Column]
#[Assert\Length(max: 255)]
public string $name;

The fixtures cover attributes, annotations, @var, new, ::class, param/return types, and an alias used next to a direct import of the same class.

…rine/Symfony aliases covered

Revert the partially qualified name guard from #8932: a node copied from another file keeps its partially qualified originalName and was left fully qualified instead of imported. Aliased names like ORM\Column and Assert\Length are already kept, so keep regression fixtures for them using the Doctrine and Symfony stubs.
@TomasVotruba
TomasVotruba merged commit 9f30de4 into main Nov 14, 2026
51 checks passed
@TomasVotruba
TomasVotruba deleted the keep-doctrine-symfony-alias-imports branch November 14, 2026 20:45
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