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;
}