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