DDC-3985: Drop support for same-namespace names resolution #4862

Closed
opened 2026-01-22 14:50:49 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 8, 2015).

Originally assigned to: @Majkl578 on GitHub.

Jira issue originally created by user @ocramius:

When resolving target classes, the ORM currently allows to reference classes in the same namespace via their short name.

Given a class Foo\Bar\Baz, when referencing a class Foo\Bar\Tab, it is possible to simply reference it as Tab inside the mappings of Foo\Bar\Baz.

This is just a useless complication that causes confusion and makes introspection harder. Additionally, since annotation mappings support the ::class meta-constant, it now is a useless feature, as the PHP namespace system already solves the problem.

Therefore, this sort of "magic resolving" should be dropped.

Originally created by @doctrinebot on GitHub (Nov 8, 2015). Originally assigned to: @Majkl578 on GitHub. Jira issue originally created by user @ocramius: When resolving target classes, the ORM currently allows to reference classes in the same namespace via their short name. Given a class `Foo\Bar\Baz`, when referencing a class `Foo\Bar\Tab`, it is possible to simply reference it as `Tab` inside the mappings of `Foo\Bar\Baz`. This is just a useless complication that causes confusion and makes introspection harder. Additionally, since annotation mappings support the `::class` meta-constant, it now is a useless feature, as the PHP namespace system already solves the problem. Therefore, this sort of "magic resolving" should be dropped.
admin added the ImprovementBC Break labels 2026-01-22 14:50:49 +01:00
admin closed this issue 2026-01-22 14:50:50 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 8, 2015):

@doctrinebot commented on GitHub (Nov 8, 2015): - is referenced by [DDC-3984: Drop support for backslash-prefixed class names](http://www.doctrine-project.org/jira/browse/DDC-3984)
Author
Owner

@Majkl578 commented on GitHub (Jan 12, 2018):

Handled in #6936.

@Majkl578 commented on GitHub (Jan 12, 2018): Handled in #6936.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4862