Assert\Assertion::notInArray PHP Метод

notInArray() публичный статический Метод

Assert that value is not in array of choices.
public static notInArray ( mixed $value, array $choices, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$choices array
$message string | null
$propertyPath string | null
Результат boolean
    public static function notInArray($value, array $choices, $message = null, $propertyPath = null)
    {
        if (in_array($value, $choices) === true) {
            $message = sprintf($message ?: 'Value "%s" is in given "%s".', static::stringify($value), static::stringify($choices));
            throw static::createException($value, $message, static::INVALID_VALUE_IN_ARRAY, $propertyPath);
        }
        return true;
    }