| 1 | <?php |
||
| 13 | class Ipv6Type extends \SwaggerGen\Swagger\Type\StringType implements ICustomType |
||
| 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 TYPE = 'ipv6'; |
||
| 18 | |||
| 19 | public static function register($type = null) |
||
| 23 | |||
| 24 | public static function unregister($type = null) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Construct and setup the regular expression for this type |
||
| 31 | * |
||
| 32 | * @param \SwaggerGen\Swagger\AbstractObject $parent |
||
| 33 | * @param string $definition |
||
| 34 | */ |
||
| 35 | public function __construct(\SwaggerGen\Swagger\AbstractObject $parent, $definition) |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Parse a type definition string, assuming it belongs to this type |
||
| 44 | * |
||
| 45 | * @param string $definition |
||
| 46 | * @throws \SwaggerGen\Exception |
||
| 47 | */ |
||
| 48 | protected function parseDefinition($definition) |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Check (and optionally reformat) a default value |
||
| 66 | * |
||
| 67 | * @param string $value |
||
| 68 | * @return string |
||
| 69 | * @throws \SwaggerGen\Exception |
||
| 70 | */ |
||
| 71 | protected function validateDefault($value) |
||
| 83 | |||
| 84 | } |
||
| 85 |