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

Fix discriminatorValue 0 #2715

Closed
wants to merge 4 commits into from

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