Skip to content

Commit

Permalink
Merge pull request #2 from brianjmiller/uuid-drop-version
Browse files Browse the repository at this point in the history
Remove restriction of version on UUID
  • Loading branch information
bscSCORM committed Mar 13, 2014
2 parents c6e19cb + a6bc256 commit b3ad2d1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/StatementRef.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b3ad2d1

Please sign in to comment.