diff --git a/src/Context.php b/src/Context.php index 7e05016..3de3d80 100644 --- a/src/Context.php +++ b/src/Context.php @@ -68,7 +68,7 @@ public function __construct() { public function setRegistration($value) { if (isset($value) && ! preg_match(Util::UUID_REGEX, $value)) { - throw new InvalidArgumentException('arg1 must be a UUIDv4'); + throw new InvalidArgumentException('arg1 must be a UUID'); } $this->registration = $value; return $this; diff --git a/src/State.php b/src/State.php index 4b6ad63..93b805b 100644 --- a/src/State.php +++ b/src/State.php @@ -52,7 +52,7 @@ public function getAgent() { return $this->agent; } public function setRegistration($value) { if (isset($value) && ! preg_match(Util::UUID_REGEX, $value)) { - throw new InvalidArgumentException('arg1 must be a UUIDv4'); + throw new InvalidArgumentException('arg1 must be a UUID'); } $this->registration = $value; diff --git a/src/Statement.php b/src/Statement.php index c730f60..0e227be 100644 --- a/src/Statement.php +++ b/src/Statement.php @@ -89,7 +89,7 @@ public function stamp() { public function setId($value) { if (isset($value) && ! preg_match(Util::UUID_REGEX, $value)) { - throw new InvalidArgumentException('arg1 must be a UUIDv4'); + throw new InvalidArgumentException('arg1 must be a UUID'); } $this->id = $value; return $this; diff --git a/src/StatementRef.php b/src/StatementRef.php index 0f4a147..dd25446 100644 --- a/src/StatementRef.php +++ b/src/StatementRef.php @@ -42,7 +42,7 @@ public function getObjectType() { return $this->objectType; } public function setId($value) { if (isset($value) && ! preg_match(Util::UUID_REGEX, $value)) { - throw new InvalidArgumentException('arg1 must be a UUIDv4'); + throw new InvalidArgumentException('arg1 must be a UUID'); } $this->id = $value; return $this; diff --git a/src/Util.php b/src/Util.php index 0a533cf..a8c6c0a 100644 --- a/src/Util.php +++ b/src/Util.php @@ -19,7 +19,7 @@ class Util { - const UUID_REGEX = '/[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}/'; + const UUID_REGEX = '/[a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}/i'; // // Based on code from