Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalidly required array instead of iterable #292

Open
jkuchar opened this issue Nov 15, 2019 · 3 comments
Open

Invalidly required array instead of iterable #292

jkuchar opened this issue Nov 15, 2019 · 3 comments

Comments

@jkuchar
Copy link

jkuchar commented Nov 15, 2019

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

More information in comments at this commit: 4fd15cd

@rquadling
Copy link
Contributor

rquadling commented Dec 19, 2019

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
Copy link
Author

jkuchar commented Jan 5, 2020

That unfortunatelly does not say much.

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

  • IDE should understand the first part
  • static analyzer whould translate type as string[]|Traversable<mixed,string> -> array<mixed,string>|Traversable<mixed,string> -> Traversable<mixed,string>

@rquadling
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants