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

Convert @psalm-* annotations to generic or @phpstan-* annotation #2685

Merged
merged 12 commits into from
Oct 14, 2024

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Oct 8, 2024

Q A
Type improvement
BC Break no
Fixed issues Related to doctrine/.github#50

Summary

  • Convert any @psalm-* to @phpstan-*
  • non-empty-string, non-empty-array are supported by in PHPStorm.
  • Remove = in custom type definition
  • $ prefixed key in array-shape need quotes
  • Detect deprecation usage with phpstan/phpstan-deprecation-rules

@GromNaN GromNaN requested a review from alcaeus October 8, 2024 15:52
Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

There are a few instances of phpstan-return and phpstan-param that we could replace with the non-prefixed variants. Essentially, anytime we use a type defined using phpstan-type we need to use a phpstan prefix, for all other types we can skip the prefix. I'll let you decide whether you want to do this in this pull request or in a separate one.

As for the aggregation builder types, I believe the issue is that we have duplicate type declarations for Stage and Pipeline, which is responsible for the circular reference issues we've encountered before. We might want to revisit those as well.

lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php Outdated Show resolved Hide resolved
lib/Doctrine/ODM/MongoDB/Aggregation/Stage.php Outdated Show resolved Hide resolved
lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php Outdated Show resolved Hide resolved
lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php Outdated Show resolved Hide resolved
lib/Doctrine/ODM/MongoDB/DocumentManager.php Outdated Show resolved Hide resolved
lib/Doctrine/ODM/MongoDB/DocumentManager.php Outdated Show resolved Hide resolved
lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php Outdated Show resolved Hide resolved
@GromNaN GromNaN requested a review from alcaeus October 9, 2024 13:40
Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

LGTM #yolo

@GromNaN GromNaN merged commit fe0f1ff into doctrine:2.10.x Oct 14, 2024
15 checks passed
@GromNaN GromNaN deleted the remove-psalm branch October 14, 2024 13:00
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.

2 participants