Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[PropertyInfo] Bug creating the Type for a property 'self' with PHPDocumentor #37149

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

Closed
silverbackdan opened this issue Jun 8, 2020 · 1 comment

Comments

@silverbackdan
Copy link

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

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.

@xabbuh
Copy link
Member

xabbuh commented Feb 16, 2021

see #40208

nicolas-grekas added a commit that referenced this issue Feb 16, 2021
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants