Skip to content

Generic<Type>[] incorrectly failing #36

Closed
@VincentLanglet

Description

@VincentLanglet

Bug report

Code snippet that reproduces the problem

Something like

Collection<int, int>[]

Should be a valid type

No error with psalm: https://psalm.dev/r/26d249d13d
An error with phpstan (the last one): https://phpstan.org/r/a42e2d1b-d1fe-4c8b-a4df-9c6e61b422b1

PHPDoc tag @param has invalid value (Collection<int, int>[] $bars): Unexpected token "[", expected variable at offset 38

An actual workaround is (Collection<int, int>)[] but I think the phpDoc parser should still be improved to handle the syntax.

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