Skip to content

Non-literal parameter default parsing incorrectly adding NULL to parameter types #3629

@dktapps

Description

@dktapps

Bug report

Code snippet that reproduces the problem

A new issue cropped up since you updated the stubs that I can't make sense of, other than perhaps PHPStan is incorrectly parsing the $options default from the stubs: https://phpstan.org/r/eb28e725-c7ba-4f56-9dde-fe948c3f2d56

Since there's nowhere that says that this accepts null (not native reflection, and not stubs either, I cross-checked this everywhereI could think of to try and figure out where the null was coming from), it's my belief that PHPStan is incorrectly interpreting the default value to be NULL and therefore showing this problem.

Expected output

No error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions