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

Skip to content

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

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
cyqui opened this issue Mar 28, 2017 · 1 comment
Closed

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

cyqui opened this issue Mar 28, 2017 · 1 comment

Comments

@cyqui
Copy link
Contributor

cyqui commented Mar 28, 2017

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 ..)

@cyqui cyqui changed the title PHPDoc nullable property for "array type" not accounted [PropertyInfo] PHPDoc nullable property for "array type" not accounted Mar 28, 2017
@xabbuh
Copy link
Member

xabbuh commented Apr 5, 2017

Thanks for reporting. Closing here as a duplicate of #22248 which was fixed by #22251.

@xabbuh xabbuh closed this as completed Apr 5, 2017
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