/** * Whether all entries of a given repeatable satisfy a given predicate. * * @param array|\Traversable $repeatable * The given repeatable. * @param PredicateInterface $predicate * The given predicate. * @throws \InvalidArgumentException * @return bool */ public static final function all($repeatable, PredicateInterface $predicate) : bool { if (self::isRepeatable($repeatable)) { if (Arrays::isArray($repeatable)) { return Arrays::all($repeatable, $predicate); } if (Traversables::isTraversable($repeatable)) { return Traversables::all($repeatable, $predicate); } } throw new \InvalidArgumentException(self::$MSG_ARGUMENT1_NOT_REPATABLE); }