1 | <?php |
||
13 | class Ipv4Type extends \SwaggerGen\Swagger\Type\StringType |
||
14 | { |
||
15 | |||
16 | const PATTERN = '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.|$)){4}$'; |
||
17 | const FORMAT = 'ipv4'; |
||
18 | |||
19 | /** |
||
20 | * Return a list of formats recognized by this type |
||
21 | * @return string[] |
||
22 | */ |
||
23 | public static function getFormats() |
||
27 | |||
28 | /** |
||
29 | * Construct and setup the regular expression for this type |
||
30 | * |
||
31 | * @param \SwaggerGen\Swagger\AbstractObject $parent |
||
32 | * @param string $definition |
||
33 | */ |
||
34 | public function __construct(\SwaggerGen\Swagger\AbstractObject $parent, $definition) |
||
40 | |||
41 | /** |
||
42 | * Parse a type definition string, assuming it belongs to this type |
||
43 | * |
||
44 | * @param string $definition |
||
45 | * @throws \SwaggerGen\Exception |
||
46 | */ |
||
47 | protected function parseDefinition($definition) |
||
62 | |||
63 | /** |
||
64 | * Check (and optionally reformat) a default value |
||
65 | * |
||
66 | * @param string $value |
||
67 | * @return string |
||
68 | * @throws \SwaggerGen\Exception |
||
69 | */ |
||
70 | protected function validateDefault($value) |
||
82 | |||
83 | } |
||
84 |