Skip to content

Commit

Permalink
Removed use of is_iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
prewk committed Feb 6, 2018
1 parent 0adb967 commit b0cf339
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Option/From.php
Expand Up @@ -10,6 +10,7 @@

namespace Prewk\Option;

use Traversable;
use Prewk\Option;

/**
Expand Down Expand Up @@ -59,7 +60,7 @@ public static function emptyable($thing): Option
*/
public static function first($iterable): Option
{
if (!is_iterable($iterable)) {
if (!is_array($iterable) && !($iterable instanceof Traversable)) {
throw new OptionException("Couldn't create Option from first item in non-iterable");
}

Expand Down

0 comments on commit b0cf339

Please sign in to comment.