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

Add missing proxy methods #348

Merged
merged 1 commit into from
Mar 1, 2024
Merged

Conversation

greg0ire
Copy link
Member

@greg0ire greg0ire commented Mar 1, 2024

I somehow thought I had a green build for the ORM after #343, but I really didn't.

Picked the patch release since it's something I forgot and the release is fresh, but please do tell if you think I should be strict about this and target 3.4.x instead.

@@ -10,6 +10,16 @@ parameters:
count: 1
path: src/Persistence/Reflection/EnumReflectionProperty.php

-
message: "#^Method Doctrine\\\\Persistence\\\\Reflection\\\\EnumReflectionProperty\\:\\:getDeclaringClass\\(\\) return type with generic class ReflectionClass does not specify its types\\: T$#"
Copy link
Member

Choose a reason for hiding this comment

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

This should be solved by making EnumReflectionProperty generic on the class name, as done in the stubs for ReflectionProperty in Psalm and phpstan instead of adding it in the baseline IMO.

Copy link
Member Author

@greg0ire greg0ire Mar 1, 2024

Choose a reason for hiding this comment

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

I agree, but I'm not sure how I can make the type flow from the constructor to there 🤔 I think I'm supposed to leverage ReflectionProperty's template types, if there are some, but I don't know where to find their definitions.

Copy link
Member

Choose a reason for hiding this comment

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

hmm, apparently, Psalm makes ReflectionProperty generic but phpstan does not. So I'm not sure solving this one is actually possible.

@greg0ire greg0ire marked this pull request as draft March 1, 2024 13:28
}

/** {@inheritDoc} */
public function getName(): string
Copy link
Member

Choose a reason for hiding this comment

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

you should be adding the @psalm-immutable annotation (which is not the same than @psalm-pure that you tried)

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried it locally, to no avail, then noticed I still had Psalm 4, apparently because Psalm 5 is not compatible with php 8.3 yet, so I just tried pushing, and it doesn't work with Psalm 5 either.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Just @psalm-external-mutation-free seems sufficient.

@greg0ire greg0ire force-pushed the missing-methods branch 3 times, most recently from 139c0e0 to 6f0e8b8 Compare March 1, 2024 13:58
I somehow thought I had a green build for the ORM after e70bc39, but I
really didn't.
@greg0ire greg0ire marked this pull request as ready for review March 1, 2024 14:59
@greg0ire greg0ire added this to the 3.3.1 milestone Mar 1, 2024
@greg0ire greg0ire added the Bug Something isn't working label Mar 1, 2024
@greg0ire greg0ire merged commit b6fd1f1 into doctrine:3.3.x Mar 1, 2024
14 checks passed
@greg0ire greg0ire deleted the missing-methods branch March 1, 2024 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants