| 1 | <?php |
||
| 13 | class Ipv6Type extends \SwaggerGen\Swagger\Type\StringType implements \SwaggerGen\Swagger\Type\Custom\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 | |||
| 18 | /** |
||
| 19 | * List of formats recognized by this class |
||
| 20 | * @var string[] |
||
| 21 | */ |
||
| 22 | private static $formats = array('ipv6'); |
||
|
|
|||
| 23 | |||
| 24 | /** |
||
| 25 | * Construct and setup the regular expression for this type |
||
| 26 | * |
||
| 27 | * @param \SwaggerGen\Swagger\AbstractObject $parent |
||
| 28 | * @param string $definition |
||
| 29 | */ |
||
| 30 | public function __construct(\SwaggerGen\Swagger\AbstractObject $parent, $definition) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Parse a type definition string, assuming it belongs to this type |
||
| 39 | * |
||
| 40 | * @param string $definition |
||
| 41 | * @throws \SwaggerGen\Exception |
||
| 42 | */ |
||
| 43 | protected function parseDefinition($definition) |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Check (and optionally reformat) a default value |
||
| 61 | * |
||
| 62 | * @param string $value |
||
| 63 | * @return string |
||
| 64 | * @throws \SwaggerGen\Exception |
||
| 65 | */ |
||
| 66 | protected function validateDefault($value) |
||
| 78 | |||
| 79 | public static function getFormats() |
||
| 83 | |||
| 84 | public static function setFormats(array $formats) |
||
| 88 | |||
| 89 | } |
||
| 90 |