Skip to content

Commit

Permalink
Allow another LID as constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
choval committed Aug 12, 2019
1 parent 48a34bd commit cd9d32d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Lid.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ class Lid {
public function __construct($id) {
if(is_numeric($id)) {
$this->number = $id;
} else if(is_a($id, self::class)) {
$this->number = $id->number();
} else {
$this->number = static::parse($id, $this->mode);
}
if($this->number === false) {
throw new \Exception('Not a valid IdHash');
throw new \Exception('Not a valid LID');
}
}

Expand Down

0 comments on commit cd9d32d

Please sign in to comment.