Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use valid relationships #10649

Merged
merged 1 commit into from
Apr 23, 2023
Merged

Use valid relationships #10649

merged 1 commit into from
Apr 23, 2023

Conversation

greg0ire
Copy link
Member

@greg0ire greg0ire commented Apr 23, 2023

During a recent refactoring, I had to pick a relationship type for this piece of code, and I chose wrong, because a many-to-one cannot have a mappedBy field.

During a recent refactoring, I had to pick a relationship type for this
piece of code, and I chose wrong, because a many-to-one cannot have a
mappedBy field.
Copy link
Member

@SenseException SenseException left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the psalm/phpstan array annotation of fromMappingArray can be improved. In AssociationMapping the keys are defined like

    /**
     * @psalm-param array{
     *     fieldName: string,
     *     sourceEntity: class-string,
     *     targetEntity: class-string,
     *     joinTable?: mixed[]|null,
     *     type?: int,
     *     isOwningSide: bool, ...} $mappingArray
     */

and in OneToManyAssociationMapping it's /** @param mixed[] $mappingArray */.

@greg0ire greg0ire merged commit bd9cd98 into doctrine:3.0.x Apr 23, 2023
@greg0ire greg0ire deleted the wrong-field branch April 23, 2023 20:13
@greg0ire greg0ire added this to the 3.0.0 milestone Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants