| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | 62 | public function __construct(string $value) |
|
| 16 | { |
||
| 17 | 62 | if (!\preg_match('/^([A-Z_])([A-Z_0-9]+)?$/', $value)) { |
|
| 18 | 7 | throw new InvalidArgumentException( |
|
| 19 | 'The key %s have invalid chars. |
||
| 20 | The key must be UPPERCASE and have only letters (A-Z) digits (0-9) and _. |
||
| 21 | And starts with A-Z or _' |
||
| 22 | ); |
||
| 23 | } |
||
| 24 | 56 | $this->value = $value; |
|
| 25 | } |
||
| 37 |