Skip to content

Add PHPStan types #107

Closed
@HendrikN

Description

@HendrikN

We all know that PHP is super awesome, of course! But it lacks some handy tooling, like generics, for example. While they are currently being re-evaluated, we're still years away from any kind of actual implementation.

Tools like Psalm or PHPStan (living in the phpdocs) would help our IDEs when dealing with the Collection and Itemresponses, providing better type inference for the entities they entail.

Psalm vs PHPStan
PHPStan is already supported by Illuminate\Support\Collection (and has more stars on GitHub), making it my preferred option.

For clarity, I'm not opting for making this package target some PHPStan level, just adding some @template-annotations for making our lives (and that of our IDE's) a little bit easier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions