Skip to content

Fix discriminatorValue 0#2715

Closed
parada85 wants to merge 4 commits intodoctrine:2.10.xfrom
parada85:hotfix/discriminator0
Closed

Fix discriminatorValue 0#2715
parada85 wants to merge 4 commits intodoctrine:2.10.xfrom
parada85:hotfix/discriminator0

Conversation

@parada85
Copy link
Contributor

@parada85 parada85 commented Jan 10, 2025

Q A
Type bug
BC Break no
Fixed issues fix #2712

Summary

Fix discriminator value 0

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

Sounds good to me, once the type issue is solved.

#[ODM\Document(collection: 'documents')]
#[ODM\InheritanceType('SINGLE_COLLECTION')]
#[ODM\DiscriminatorField('type')]
#[ODM\DiscriminatorMap([0 => GH2158FirstType::class, 1 => GH2158SecondType::class])]
Copy link
Member

Choose a reason for hiding this comment

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

Using int as key is not permitted by the @param annotation, this rule is not enforced in the code.
I propose to relax the type.

-    /** @param array<string, class-string> $value */
+    /** @param array<class-string> $value */ 

@GromNaN
Copy link
Member

GromNaN commented Jan 10, 2025

Also, this is a bug fix. Could you reset the PR on 2.9.x. This will also ensure that the tests pass with #2714

@parada85 parada85 closed this Jan 10, 2025
@GromNaN
Copy link
Member

GromNaN commented Jan 10, 2025

@parada85 you don't need to create a new PR, you can reset your branch with git reset 2.9.x, git cherry-pick your commit and git push --force. Then change the target of the PR.

(See #2716)

@parada85 parada85 deleted the hotfix/discriminator0 branch January 10, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

problem discriminatorValue with 0

2 participants