1 | <?php |
||
13 | class Ipv6Type extends \SwaggerGen\Swagger\Type\StringType |
||
14 | { |
||
15 | |||
16 | const PATTERN = '(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))'; |
||
17 | const FORMAT = 'ipv6'; |
||
18 | |||
19 | /** |
||
20 | * Construct and setup the regular expression for this type |
||
21 | * |
||
22 | * @param \SwaggerGen\Swagger\AbstractObject $parent |
||
23 | * @param string $definition |
||
24 | */ |
||
25 | public function __construct(\SwaggerGen\Swagger\AbstractObject $parent, $definition) |
||
31 | |||
32 | /** |
||
33 | * Parse a type definition string, assuming it belongs to this type |
||
34 | * |
||
35 | * @param string $definition |
||
36 | * @throws \SwaggerGen\Exception |
||
37 | */ |
||
38 | protected function parseDefinition($definition) |
||
53 | |||
54 | /** |
||
55 | * Check (and optionally reformat) a default value |
||
56 | * |
||
57 | * @param string $value |
||
58 | * @return string |
||
59 | * @throws \SwaggerGen\Exception |
||
60 | */ |
||
61 | protected function validateDefault($value) |
||
73 | |||
74 | } |
||
75 |