[PR #9761] Fix phpdoc and tests for NamingStrategy #11866

Closed
opened 2026-01-22 16:12:09 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/9761

State: closed
Merged: Yes


While working on https://github.com/doctrine/orm/pull/9758, I noticed 2 things that need to be fixed.

When computing a foreign key column name, the referenced column name
may be null in the case of a self referencing entity with join columns
defined in the mapping. I wrongly introduced that phpdoc in #9756.
Also, some tests were using the fact that some arguments of some methods of
the naming strategy interface are optional or nullable for now to avoid
providing some. In practice, these arguments are always provided, and
that should also be the case in tests.

For propertyToColumnName, I think ClassMetadataInfo::$name is always a non-nullable string
See 45e196eb57/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php (L1635)

For joinTableName() I think related mapping are always defined based on some property and cannot be null either.
45e196eb57/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php (L2050)

**Original Pull Request:** https://github.com/doctrine/orm/pull/9761 **State:** closed **Merged:** Yes --- While working on https://github.com/doctrine/orm/pull/9758, I noticed 2 things that need to be fixed. When computing a foreign key column name, the referenced column name may be null in the case of a self referencing entity with join columns defined in the mapping. I wrongly introduced that phpdoc in #9756. Also, some tests were using the fact that some arguments of some methods of the naming strategy interface are optional or nullable for now to avoid providing some. In practice, these arguments are always provided, and that should also be the case in tests. For `propertyToColumnName`, I think `ClassMetadataInfo::$name` is always a non-nullable string See https://github.com/doctrine/orm/blob/45e196eb57034a90d0e4a7afb9109d9537132c24/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L1635 For `joinTableName()` I think related mapping are always defined based on some property and cannot be null either. https://github.com/doctrine/orm/blob/45e196eb57034a90d0e4a7afb9109d9537132c24/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L2050
admin added the pull-request label 2026-01-22 16:12:09 +01:00
admin closed this issue 2026-01-22 16:12:10 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#11866