Пример #1
0
 /**
  * @param string $value
  * @throws InvalidArgumentExpection
  */
 public function __construct($value = StringLiteral::EMPTY_STR)
 {
     parent::__construct($value);
     if (empty($this->value)) {
         $this->generateV4();
     }
     if (!$this->isValidV4()) {
         throw new InvalidArgumentExpection(__METHOD__ . '(): $value is not a valid v4 uuid');
     }
 }
Пример #2
0
 public function __construct($value = '')
 {
     parent::__construct($value);
     if (empty($this->value)) {
         $this->generateV4();
     }
     if (!$this->isValidV4()) {
         throw new InvalidArgumentException(__METHOD__ . '(): $value must be a valid V4 UUID');
     }
 }
Пример #3
0
 public function __construct($value = StringLiteral::EMPTY_STR)
 {
     //must use this to call the constructor
     parent::__construct($value);
     if (empty($this->value)) {
         $this->generateV4();
     }
     if (!$this->isValidV4()) {
         throw new InvalidArgumentException(__METHOD__ . '(): $value is not a valid v4 UUID');
     }
 }