Skip to content

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Sep 26, 2025

Q A
Type improvement
BC Break no
Fixed issues -

Summary

In many places, the code deals with a generic ClassMetadata instances, having to specify the ClassMetadata<object> everywhere is pointless.

Copilot

This comment was marked as resolved.

@GromNaN GromNaN added this to the 2.13.0 milestone Sep 26, 2025
@GromNaN GromNaN changed the title Add default generic type for ClassMetadata Add default generic type for ClassMetadata<object> Sep 26, 2025
@GromNaN GromNaN changed the title Add default generic type for ClassMetadata<object> Add default generic type for ClassMetadata<object> and DocumentPersister<object> Sep 26, 2025
@GromNaN GromNaN requested a review from jmikola September 26, 2025 14:00
@GromNaN GromNaN changed the title Add default generic type for ClassMetadata<object> and DocumentPersister<object> Always ignore missing generic type for ClassMetadata and DocumentPersister Sep 28, 2025
@GromNaN GromNaN added Task and removed Enhancement labels Sep 28, 2025
path: tests/Doctrine/

- message: '#with generic class Doctrine\\ODM\\MongoDB\\Mapping\\ClassMetadata does not specify its types: T$#'
- message: '#generic class Doctrine\\ODM\\MongoDB\\(Mapping\\ClassMetadata|Persisters\\DocumentPersister) (but )?does not specify its types\: T$#'
Copy link
Member Author

Choose a reason for hiding this comment

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

Discussed with @alcaeus, we could probably remove this once every class is property typed with generic subtype.

@GromNaN GromNaN merged commit 594daf8 into doctrine:2.13.x Sep 30, 2025
23 checks passed
@GromNaN GromNaN deleted the phpstan-cleanup branch September 30, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants