Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public static function validateArgument($expectedType, $argumentName, $currentValue, $code) |
||
27 | { |
||
28 | if (gettype($currentValue) !== $expectedType) { |
||
29 | throw new self( |
||
30 | sprintf( |
||
31 | "%s expected for argument '%s'. Got '%s'.", |
||
32 | ucfirst(strtolower($expectedType)), |
||
33 | $argumentName, |
||
34 | gettype($currentValue) |
||
35 | ), |
||
36 | $code |
||
37 | ); |
||
38 | } |
||
39 | |||
40 | return true; |
||
41 | } |
||
42 | } |
||
43 |