Conditions | 5 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
32 | public function create(Constraint $constraint, PropertyMetadata $propertyMetadata): array |
||
33 | { |
||
34 | if ($constraint instanceof Email) { |
||
35 | return ['format' => 'email']; |
||
36 | } |
||
37 | |||
38 | if ($constraint instanceof Uuid) { |
||
39 | return ['format' => 'uuid']; |
||
40 | } |
||
41 | |||
42 | if ($constraint instanceof Ip) { |
||
43 | if ($constraint->version === $constraint::V4) { |
||
44 | return ['format' => 'ipv4']; |
||
45 | } |
||
46 | |||
47 | return ['format' => 'ipv6']; |
||
48 | } |
||
49 | |||
50 | return []; |
||
51 | } |
||
63 |