-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PropertyInfo] Invalid type extracted when property defined in trait #28732
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
Comments
I believe this is a limitation within PHP |
I also think that it's a limitation within PHP that us hard to circumvent. Two possible solutions:
cc @soyuka |
Switching to phpdoc-parser might be good, lot of work I don't have the time for this for now... see also api-platform/core#3349 for research material / ways to reproduce. |
Hey, thanks for your report! |
yes @carsonbot it is still relevant :) |
Can you confirm that #40175 fixes this? |
…ed in traits (xabbuh) This PR was merged into the 4.4 branch. Discussion ---------- [PropertyInfo] use the right context for properties defined in traits | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #28732, #34191 | License | MIT | Doc PR | Commits ------- 1572491 use the right context for properties defined in traits
this may also fix #37149 then |
@soyuka Are you sure? |
it doesn't seem so, but #40208 should fix it |
Uh oh!
There was an error while loading. Please reload this page.
Description
When using the
PhpDocExtractor
to extract information about a property, if that property is defined within a trait, the resulting type does not take into consideration the use statements in that trait.How to reproduce
Got:
App\Entity\Collection
Expected:
Doctrine\Common\Collections\Collection
Additional information
use Doctrine\Common\Collections\Collection;
to theTestEntity
class, then it works as expected.\Doctrine\Common\Collections\Collection
) to the@var
tag on the$myCollection
property, then it also works as expected.The text was updated successfully, but these errors were encountered: