1 | <?php |
||
13 | class MacType extends \SwaggerGen\Swagger\Type\StringType |
||
14 | { |
||
15 | |||
16 | const PATTERN = '^([0-9A-F]){2}(:[0-9A-F]{2}){5}$'; |
||
17 | const FORMAT = 'mac'; |
||
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 |