1 | <?php |
||
10 | class Assert |
||
11 | { |
||
12 | /** |
||
13 | * Validate an array has at least one element. |
||
14 | * |
||
15 | * @param array $value |
||
16 | * @param string $keyword |
||
17 | * @param string|null $pointer |
||
18 | */ |
||
19 | 40 | public static function notEmpty(array $value, $keyword, $pointer = null) |
|
27 | |||
28 | /** |
||
29 | * Validate an integer is non-negative. |
||
30 | * |
||
31 | * @param integer $value |
||
32 | * @param string $keyword |
||
33 | * @param string|null $pointer |
||
34 | */ |
||
35 | 68 | public static function nonNegative($value, $keyword, $pointer = null) |
|
47 | |||
48 | /** |
||
49 | * Validate a value is one of the allowed types. |
||
50 | * |
||
51 | * @param mixed $value |
||
52 | * @param array|string $choices |
||
53 | * @param string $keyword |
||
54 | * @param string|null $pointer |
||
55 | * |
||
56 | * @throws InvalidSchemaException |
||
57 | */ |
||
58 | 232 | public static function type($value, $choices, $keyword, $pointer = null) |
|
75 | } |
||
76 |