1 | <?php |
||
13 | class MacType extends \SwaggerGen\Swagger\Type\StringType implements \SwaggerGen\Swagger\Type\Custom\ICustomType |
||
14 | { |
||
15 | |||
16 | const PATTERN = '^([0-9A-F]){2}(:[0-9A-F]{2}){5}$'; |
||
17 | |||
18 | /** |
||
19 | * List of formats recognized by this class |
||
20 | * @var string[] |
||
21 | */ |
||
22 | private static $formats = array('mac'); |
||
|
|||
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 |