Closed (duplicate)
Project:
Drupal core
Version:
9.4.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 Sep 2021 at 08:21 UTC
Updated:
15 Feb 2022 at 15:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
daffie commentedIn core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php on line #144-145 we have the code:
I have taken that as the return value for the 3 methods that get the type hint:
?T.Comment #3
longwaveI am not sure this is right. I guess this is the Symfony debug class loader reading the docblock for the Doctrine classes and making an assumption that because there are @return with class declarations, a return type will be added - but has Doctrine actually announced this?
Comment #4
catchComment #6
longwaveMarking as postponed, as I believe this is a false positive caused by the over-eager DebugClassLoader reading docblocks in third party code and assuming they mean that typehints will be added.
Comment #7
gábor hojtsyThis was postponed on #3232131: [Symfony 5] Symfony's DebugClassLoader triggers deprecation messages for missing return type hints, where there is no deprecation I believe which landed. So unpostponing.
Comment #8
longwaveI still think this is a false positive and hence should be won't fix. There is no guarantee that:
Comment #9
catchAgreed, let's mark this as duplicate of #3232131: [Symfony 5] Symfony's DebugClassLoader triggers deprecation messages for missing return type hints, where there is no deprecation since we came up with a solution there. We may also do #3252386: Use PHP attributes instead of doctrine annotations.