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

Skip to content

Tighten return type in DocBlock #703

@JakeQZ

Description

@JakeQZ

For example, preg_split should have its return type as list<string> and not merely list.

A more complex case is preg_replace, where the return type depends on the argument type. PHPStan has a solution for that.

I realize that the code is generated from an XML version of the documentation, so am not sure how these issues can be solved without special-casing, which I'd prefer to avoid.

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