Conditions | 4 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 4.3731 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 23 | public function __construct(array $values) |
|
21 | { |
||
22 | 23 | if (!is_string($values['value'])) { |
|
23 | throw new RuntimeException('"value" must be a string.'); |
||
24 | } |
||
25 | |||
26 | 23 | $this->value = strtoupper($values['value']); |
|
27 | |||
28 | 23 | if (self::NONE !== $this->value && self::ALL !== $this->value) { |
|
29 | throw new RuntimeException('Exclusion policy must either be "ALL", or "NONE".'); |
||
30 | } |
||
31 | 23 | } |
|
32 | |||
43 |