Psalm annotation is missing allowed ENUM values #7089

Closed
opened 2026-01-22 15:44:27 +01:00 by admin · 4 comments
Owner

Originally created by @kevinpapst on GitHub (Dec 31, 2022).

Bug Report

Hey @derrabus, in your recent commit you added Psalm annotations:

99a37d864e/lib/Doctrine/ORM/Mapping/GeneratedValue.php (L18-L30)

Problem: TABLE and UUID are missing from the psalm annotation, while they are allowed in the ENUM.

My build is breaking, because I use UUID and phpstan now reports

  26     Parameter $strategy of attribute class                       
         Doctrine\ORM\Mapping\GeneratedValue constructor expects      
         'AUTO'|'CUSTOM'|'IDENTITY'|'NONE'|'SEQUENCE', 'UUID' given.  

... I can send a PR, just want to make sure that this was not on purpose, was it?

Originally created by @kevinpapst on GitHub (Dec 31, 2022). ### Bug Report Hey @derrabus, in your [recent commit](https://github.com/doctrine/orm/commit/1ad936a448e6841ee5bff988b2ab6fc0fd23e1d6#diff-4ee19c1ed755d34366c23e69ad18cca0ce4bf00228061d2854ccdbc59fb5835aR28) you added Psalm annotations: https://github.com/doctrine/orm/blob/99a37d864ed810c8bebe46ce36d40adde8b8b1ec/lib/Doctrine/ORM/Mapping/GeneratedValue.php#L18-L30 Problem: `TABLE` and `UUID` are missing from the psalm annotation, while they are allowed in the ENUM. My build is breaking, because I use `UUID` and phpstan now reports ``` 26 Parameter $strategy of attribute class Doctrine\ORM\Mapping\GeneratedValue constructor expects 'AUTO'|'CUSTOM'|'IDENTITY'|'NONE'|'SEQUENCE', 'UUID' given. ``` ... I can send a PR, just want to make sure that this was not on purpose, was it?
admin closed this issue 2026-01-22 15:44:27 +01:00
Author
Owner

@greg0ire commented on GitHub (Dec 31, 2022):

Both are deprecated IIRC. I'm not saying it was on purpose, but that might explain it. You might want to dig into the git history.

@greg0ire commented on GitHub (Dec 31, 2022): Both are deprecated IIRC. I'm not saying it was on purpose, but that might explain it. You might want to dig into the git history.
Author
Owner

@derrabus commented on GitHub (Dec 31, 2022):

"recent" as in two months ago! 😅

I think the reason was that both missing strategies are deprecated and we didn't see a better way to make this issue bubble up in your static analysis.

TABLE doesn't even have an implementation and the UUID strategy is being removed from DBAL, iirc.

@derrabus commented on GitHub (Dec 31, 2022): "recent" as in two months ago! 😅 I think the reason was that both missing strategies are deprecated and we didn't see a better way to make this issue bubble up in your static analysis. `TABLE` doesn't even have an implementation and the `UUID` strategy is being removed from DBAL, iirc.
Author
Owner

@kevinpapst commented on GitHub (Dec 31, 2022):

It was removed in 2018 ???

A bit odd: why does #[ORM\GeneratedValue(strategy: 'UUID')] not trigger any runtime deprecation?

Seems I have to say "Thank you 👍 " for reporting the deprecation in that rather unexpected way 😁

@kevinpapst commented on GitHub (Dec 31, 2022): It was [removed in 2018](https://github.com/doctrine/orm/pull/7330/files) ??? A bit odd: why does `#[ORM\GeneratedValue(strategy: 'UUID')]` not trigger any runtime deprecation? Seems I have to say "Thank you 👍 " for reporting the deprecation in that rather unexpected way 😁
Author
Owner

@derrabus commented on GitHub (Dec 31, 2022):

There should be a runtime deprecation as well I believe, haven't checked though.

@derrabus commented on GitHub (Dec 31, 2022): There should be a runtime deprecation as well I believe, haven't checked though.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7089