functional-php / fantasy-land

Specification for interoperability of common algebraic structures in PHP
BSD 3-Clause "New" or "Revised" License
34 stars 10 forks source link

Add template types to DocBlocks for static analysis tools #20

Closed athrawes closed 1 year ago

athrawes commented 1 year ago

In the last several years, static analysis tools such as Psalm and PhpStan have become relatively popular to use for PHP development.

In general, these tools are able to parse and use generics in docblocks to provide additional type hints during analysis. Having these generic types hinted in code, especially in libraries such as this, make life in PHP much nicer.

Would you consider adding these in?

athrawes commented 1 year ago

I've added a PR to add these to a majority of functions and classes here: https://github.com/functional-php/fantasy-land/pull/21

krtek4 commented 1 year ago

PR merged