1 | <?php |
||
10 | final 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 $pointer |
||
18 | */ |
||
19 | 28 | public static function notEmpty(array $value, $keyword, $pointer) |
|
27 | |||
28 | /** |
||
29 | * Validate an integer is non-negative. |
||
30 | * |
||
31 | * @param integer $value |
||
32 | * @param string $keyword |
||
33 | * @param string $pointer |
||
34 | */ |
||
35 | 48 | public static function nonNegative($value, $keyword, $pointer) |
|
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 $pointer |
||
55 | * |
||
56 | * @throws InvalidSchemaException |
||
57 | */ |
||
58 | 250 | public static function type($value, $choices, $keyword, $pointer) |
|
75 | |||
76 | /** |
||
77 | * @param object $schema |
||
78 | * @param string $property |
||
79 | * @param string $keyword |
||
80 | * @param string $pointer |
||
81 | */ |
||
82 | 8 | public static function hasProperty($schema, $property, $keyword, $pointer) |
|
94 | } |
||
95 |