nikic / iter

Iteration primitives using generators
Other
1.12k stars 76 forks source link

Use ^7.1 php with iterables #52

Closed enleur closed 6 years ago

enleur commented 6 years ago

Done

enleur commented 6 years ago

I'm a bit confused about the right return types in phpdoc blocks. Should it be iterable, \Iterable or \Iterator?

nikic commented 6 years ago

The right return type is one of iterable, \Traversable, \Iterator or \Generator, in order of increasing specificity. I prefer \Iterator in this case, because it guarantees the availability of the usual iterator methods, while not exposing the generator specific functionality (which is not used/supported here).

enleur commented 6 years ago

@nikic fixed

nikic commented 6 years ago

Merged as https://github.com/nikic/iter/commit/c40a7ecf400c7bec90d1517b261da2a062d5817a, thanks!