1 | <?php |
||
8 | class Format implements PropertyConstraint |
||
9 | { |
||
10 | const KEYWORD = 'format'; |
||
11 | |||
12 | // @codingStandardsIgnoreStart |
||
13 | const DATE_TIME_PATTERN = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})([Tt]([0-9]{2}):([0-9]{2}):([0-9]{2})(\\.[0-9]+)?)?(([Zz]|([+-])([0-9]{2}):([0-9]{2})))?/'; |
||
14 | // @codingStandardsIgnoreEnd |
||
15 | |||
16 | const HOST_NAME_PATTERN = '/^[_a-z]+\.([_a-z]+\.?)+$/i'; |
||
17 | |||
18 | /** |
||
19 | * {@inheritdoc} |
||
20 | */ |
||
21 | 8 | public static function validate($value, $parameter, $pointer = null) |
|
72 | |||
73 | /** |
||
74 | * @param string $format |
||
75 | * @param mixed $value |
||
76 | * @param string $pattern |
||
77 | * @param string $pointer |
||
78 | * |
||
79 | * @return \League\JsonGuard\ValidationError|null |
||
80 | */ |
||
81 | 4 | private static function validateRegex($format, $value, $pattern, $pointer) |
|
95 | |||
96 | /** |
||
97 | * @param string $format |
||
98 | * @param mixed $value |
||
99 | * @param int $filter |
||
100 | * @param mixed $options |
||
101 | * @param string $pointer |
||
102 | * |
||
103 | * @return \League\JsonGuard\ValidationError|null |
||
104 | */ |
||
105 | 6 | private static function validateFilter($format, $value, $filter, $options, $pointer) |
|
127 | } |
||
128 |