You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Symfony version(s) affected: All current supported versions
Description
The class name specified if the return type is self will become elf. However ideally it should return the name of the class that the property belongs to.
How to reproduce
It has been picked up as an issue in API Platform here: api-platform/core#3344 - if there is an annotation @return self - the Type object returned will define the class as elf
If possible it'd be better to return the FQCN of the object - but I'm not sure how that would work if a patch is applied to also support the return type static that looks to be coming in PHP 8.
The text was updated successfully, but these errors were encountered:
…class (xabbuh)
This PR was merged into the 4.4 branch.
Discussion
----------
[PropertyInfo] fix resolving self to name of the analyzed class
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37149
| License | MIT
| Doc PR |
Commits
-------
e9f2ece fix resolving parent/self/static type annotations
Symfony version(s) affected: All current supported versions
Description
The class name specified if the return type is
self
will becomeelf
. However ideally it should return the name of the class that the property belongs to.How to reproduce
It has been picked up as an issue in API Platform here: api-platform/core#3344 - if there is an annotation
@return self
- theType
object returned will define the class aself
Possible Solution
The simplest fix that I can see would be adding it to the list of unsupported return types here:
https://github.com/symfony/property-info/blob/82d9fc8b6a531f479d9545e229f8a5e35dc12775/Util/PhpDocTypeHelper.php#L98
If possible it'd be better to return the FQCN of the object - but I'm not sure how that would work if a patch is applied to also support the return type
static
that looks to be coming in PHP 8.The text was updated successfully, but these errors were encountered: