Conditions | 4 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
25 | function assertMap(string $key, string $value, MapInterface $map, int $position = null): void |
||
26 | { |
||
27 | 2 | $message = ''; |
|
28 | |||
29 | 2 | if (is_int($position)) { |
|
30 | 2 | $message = "Argument $position must be of type MapInterface<$key, $value>"; |
|
31 | } |
||
32 | |||
33 | if ( |
||
34 | 2 | (string) $map->keyType() !== $key || |
|
35 | 2 | (string) $map->valueType() !== $value |
|
36 | ) { |
||
37 | 2 | throw new \TypeError($message); |
|
38 | } |
||
56 |