Fix phpdoc and tests for NamingStrategy #9761
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While working on #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 thinkClassMetadataInfo::$name
is always a non-nullable stringSee
orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
Line 1635 in 45e196e
For
joinTableName()
I think related mapping are always defined based on some property and cannot be null either.orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
Line 2050 in 45e196e