You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve type annotations by making use of templates, callable signatures
and other type system features supported by psalm and phpstan.
Additionally, this makes the following changes:
* Fix CI to work on PHP 7.1 again.
* Add psalm and phpstan to require-dev for validation.
* Handle IteratorAggregate returning a non-Iterator in isEmpty().
* In functions that take a `$levels = INF` parameter or similar, changed
`INF` to `PHP_INT_MAX` as `INF` is a float type and not int as declared.
In these cases, `$levels` can never exceed the `PHP_INT_MAX` anyhow.
* Split off RewindableGenerator from RewindableIterator.
* Psalm does not have support for recursive types. Functions which use
recursive types have had a note added to the docblock to explain this.
* I've not added docblocks to the functions in the `\iter\rewindable`
namespace, as that would necessarily mean that any changes to the
regular function would also need to be reflected in the docblocks for
these methods. This does mean that these functions do not benefit from
the Psalm type annotations currently.
Co-authored-by: Andrew Moyes <[email protected]>
0 commit comments