jkoudys / immutable.php

Immutable collections, with filter, map, join, sort, slice, and other methods. Well-suited for functional programming and memory-intensive applications. Runs especially fast in PHP7.
MIT License
346 stars 20 forks source link

Docblock return type #12

Closed Petah closed 5 years ago

Petah commented 5 years ago

Hi,

In these lines

https://github.com/jkoudys/immutable.php/blob/master/src/Collection/ImmArray.php#L84

Shouldn't it be:

 * @return static
svenluijten commented 5 years ago

It can be either static, self, or ImmArray. Each will have the same effect on IDEs like PhpStorm and static analysis tools like PHPStan.

Petah commented 5 years ago

Well not if you extend the ImmArray class though.

svenluijten commented 5 years ago

You're right. You can submit a PR to fix this 🙂

JarJak commented 5 years ago

Fixed in #15