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

Closed
@silverbackdan

Description

@silverbackdan

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions