function Assert::inArray
Does strict comparison, so Assert::inArray(3, ['3']) does not pass the assertion.
@psalm-pure
Parameters
mixed $value:
array $values:
string $message:
Throws
1 call to Assert::inArray()
- Assert::oneOf in vendor/
webmozart/ assert/ src/ Assert.php - A more human-readable alias of Assert::inArray().
File
-
vendor/
webmozart/ assert/ src/ Assert.php, line 972
Class
- Assert
- Efficient assertions to validate the input/output of your methods.
Namespace
Webmozart\AssertCode
public static function inArray($value, array $values, $message = '') {
if (!\in_array($value, $values, true)) {
static::reportInvalidArgument(\sprintf($message ?: 'Expected one of: %2$s. Got: %s', static::valueToString($value), \implode(', ', \array_map(array(
static::class,
'valueToString',
), $values))));
}
}