1 | <?php |
||
13 | class Ipv4Type extends \SwaggerGen\Swagger\Type\StringType implements ICustomType |
||
14 | { |
||
15 | |||
16 | const PATTERN = '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.|$)){4}$'; |
||
17 | const TYPE = 'ipv4'; |
||
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 |