public static function choice($value, array $choices, $message = null, $propertyPath = null)
{
if (!in_array($value, $choices, true)) {
$message = sprintf($message ?: 'Value "%s" is not an element of the valid values: %s', static::stringify($value), implode(", ", array_map('Assert\\Assertion::stringify', $choices)));
throw static::createException($value, $message, static::INVALID_CHOICE, $propertyPath, array('choices' => $choices));
}
return true;
}