function Assert::isTraversable
@psalm-pure @psalm-assert iterable $value
Parameters
mixed $value:
string $message:
Throws
Deprecated
use "isIterable" or "isInstanceOf" instead
File
-
vendor/
webmozart/ assert/ src/ Assert.php, line 319
Class
- Assert
- Efficient assertions to validate the input/output of your methods.
Namespace
Webmozart\AssertCode
public static function isTraversable($value, $message = '') {
@\trigger_error(\sprintf('The "%s" assertion is deprecated. You should stop using it, as it will soon be removed in 2.0 version. Use "isIterable" or "isInstanceOf" instead.', __METHOD__), \E_USER_DEPRECATED);
if (!\is_array($value) && !$value instanceof Traversable) {
static::reportInvalidArgument(\sprintf($message ?: 'Expected a traversable. Got: %s', static::typeToString($value)));
}
}