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

Skip to content

[PropertyInfo] PHPDoc nullable property for "array type" not accounted #22203

Closed
@cyqui

Description

@cyqui
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.x

Description:
I am using the PropertyInfo component to read phpdoc comments.
Somewhere we got :

    /**
     * Array of categories IDs
     * @var array|null
     * @SWG\Property(@SWG\Items(type="string"))
     */

and in our code $type->isNullable() returns "false".
$type is a Symfony\Component\PropertyInfo\Type instance.

Fix:
https://github.com/symfony/symfony/blob/3.2/src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php#L107
The "nullable" argument should be used here i believe ?

I can provide a pull request to fix this if you agree that it is an issue (not sure if the argument is unused on purpose here ..)

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