Total Complexity | 6 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
9 | class Assert |
||
10 | { |
||
11 | public static function instanceOf(string $expected, $subject, $where) |
||
12 | { |
||
13 | if (!is_a($subject, $expected)) { |
||
14 | throw new InvalidArgumentException( |
||
15 | sprintf( |
||
16 | "[%s] Expected an instance of (%s). Got (%s).", |
||
17 | self::getType($where), |
||
18 | self::getType($subject), |
||
19 | self::getType($expected) |
||
20 | ) |
||
21 | ); |
||
22 | } |
||
23 | } |
||
24 | |||
25 | public static function requiredParameters(array $required, array $parameters, $where) |
||
36 | } |
||
37 | } |
||
38 | |||
39 | protected static function getType($subject): string |
||
44 |