Skip to content

Commit

Permalink
Use is_iterable().
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Sep 1, 2019
1 parent ccaa796 commit a07681b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Operation/Flatten.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function on(iterable $collection): \Closure

return static function () use ($depth, $collection): \Generator {
foreach ($collection as $value) {
if ((false === \is_array($value)) && (false === ($value instanceof \Traversable))) {
if (false === \is_iterable($value)) {
yield $value;
} elseif (1 === $depth) {
foreach ($value as $subValue) {
Expand Down

0 comments on commit a07681b

Please sign in to comment.