public static function uuid($value, $message = '')
{
$value = str_replace(array('urn:', 'uuid:', '{', '}'), '', $value);
// The nil UUID is special form of UUID that is specified to have all
// 128 bits set to zero.
if ('00000000-0000-0000-0000-000000000000' === $value) {
return;
}
if (!preg_match('/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/', $value)) {
static::reportInvalidArgument(sprintf($message ?: 'Value %s is not a valid UUID.', static::valueToString($value)));
}
}