16) { throw new InvalidArgumentException(sprintf( 'Invalid argument value "%s". Max length for $id is 16 characters.', $name )); } if (strlen($id) > 38) { throw new InvalidArgumentException(sprintf( 'Invalid argument value "%s". Max length for $id is 38 characters.', $id )); } if (preg_match('/[^a-z]+/', $name) === 1) { throw new InvalidArgumentException(sprintf( 'Invalid argument value "%s". Valid characters for $name parameter: a-z', $name )); } $this->name = (string)$name; $this->id = is_numeric($id) ? (int)$id : (string)$id; } /** * @return string */ public function getName() { return $this->name; } /** * @return int|string */ public function getId() { return $this->id; } }