Conditions | 5 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
58 | public static function type($value, $choices, $keyword, $pointer = null) |
||
59 | { |
||
60 | $actualType = gettype($value); |
||
61 | $choices = is_array($choices) ? $choices : [$choices]; |
||
62 | |||
63 | if (in_array($actualType, $choices) || |
||
64 | (is_json_number($value) && in_array('number', $choices))) { |
||
65 | return; |
||
66 | } |
||
67 | |||
68 | throw InvalidSchemaException::invalidParameterType( |
||
69 | $actualType, |
||
70 | $choices, |
||
71 | $keyword, |
||
72 | $pointer |
||
73 | ); |
||
74 | } |
||
75 | } |
||
76 |