Skip to content

Conditional param type should provide the same analysis as condition in code #7915

@mvorisek

Description

@mvorisek

Feature request

demo: https://phpstan.org/r/db87d84e-9483-4a85-9506-39e25605ee7a

I would expect

@param ($name is array ? null : int) $value

to be strictly equal to

@param int $value

+

if (is_array($name)) {
    $value = null;
}

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