Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
15 | public function __construct(string $value) |
||
16 | { |
||
17 | if (!preg_match('/^[a-z0-9\-]{3,40}$/', $value)) { |
||
18 | throw new \InvalidArgumentException( |
||
19 | 'Invalid value: '.$value.' for TranslatedAlias. Value should be '. |
||
20 | 'between 3 and 40 characters long and consist only of lowercase letters, numbers and "-"' |
||
21 | ); |
||
22 | } |
||
23 | |||
24 | $this->value = $value; |
||
25 | } |
||
44 |