beberlei / assert

Thin assertion library for use in libraries and business-model
Other
2.41k stars 188 forks source link

Invalidly required array instead of iterable #292

Open jkuchar opened 4 years ago

jkuchar commented 4 years ago

All methods require iterable, however array is in the annotation.

More information in comments at this commit: https://github.com/beberlei/assert/commit/4fd15cd95f8659407bc5afb5d8248a3458318cc6

rquadling commented 4 years ago

As the pseudo-type iterable is only available in PHP 7.1+, what would you recommend for PHP 7.0 support?

My guess would be mixed[]|Traversable.

jkuchar commented 4 years ago

That unfortunatelly does not say much.

I would prefer for string[] replace with string[]|Traversable<mixed,string>. As:

rquadling commented 4 years ago

If you want to make a PR, the work is in the documentation generator. Happy to review it.