1 | <?php |
||
9 | class Format implements PropertyConstraint |
||
10 | { |
||
11 | const KEYWORD = 'format'; |
||
12 | |||
13 | // @codingStandardsIgnoreStart |
||
14 | 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})))?/'; |
||
15 | // @codingStandardsIgnoreEnd |
||
16 | |||
17 | const HOST_NAME_PATTERN = '/^[_a-z]+\.([_a-z]+\.?)+$/i'; |
||
18 | |||
19 | /** |
||
20 | * {@inheritdoc} |
||
21 | 8 | */ |
|
22 | public static function validate($value, $parameter, $pointer = null) |
||
75 | |||
76 | /** |
||
77 | * @param string $format |
||
78 | * @param mixed $value |
||
79 | * @param string $pattern |
||
80 | * @param string $pointer |
||
81 | 4 | * |
|
82 | * @return \League\JsonGuard\ValidationError|null |
||
83 | 4 | */ |
|
84 | 4 | private static function validateRegex($format, $value, $pattern, $pointer) |
|
98 | |||
99 | /** |
||
100 | * @param string $format |
||
101 | * @param mixed $value |
||
102 | * @param int $filter |
||
103 | * @param mixed $options |
||
104 | * @param string $pointer |
||
105 | 6 | * |
|
106 | * @return \League\JsonGuard\ValidationError|null |
||
107 | 6 | */ |
|
108 | 6 | private static function validateFilter($format, $value, $filter, $options, $pointer) |
|
130 | } |
||
131 |