| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function validate($value, $parameter, Validator $validator) |
||
| 19 | { |
||
| 20 | Assert::type($parameter, 'string', self::KEYWORD, $validator->getSchemaPath()); |
||
| 21 | |||
| 22 | if (!is_string($value)) { |
||
| 23 | return null; |
||
| 24 | } |
||
| 25 | |||
| 26 | if (preg_match(JsonGuard\delimit_pattern($parameter), $value) === 1) { |
||
| 27 | return null; |
||
| 28 | } |
||
| 29 | |||
| 30 | return error('The string must match the pattern {parameter}.', $validator); |
||
| 31 | } |
||
| 32 | } |
||
| 33 |