Conditions | 3 |
Paths | 4 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
9 | function assertSet(string $type, SetInterface $set, int $position = null): void |
||
10 | { |
||
11 | 2 | $message = ''; |
|
12 | |||
13 | 2 | if (is_int($position)) { |
|
14 | 2 | $message = "Argument $position must be of type SetInterface<$type>"; |
|
15 | } |
||
16 | |||
17 | 2 | if ((string) $set->type() !== $type) { |
|
18 | 2 | throw new \TypeError($message); |
|
19 | } |
||
56 |