Total Complexity | 6 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
12 | final class PropertyMetadata |
||
13 | { |
||
14 | /** @var string */ |
||
15 | private $name; |
||
16 | |||
17 | /** @var Type */ |
||
18 | private $type; |
||
19 | |||
20 | /** @var bool */ |
||
21 | private $required; |
||
22 | |||
23 | /** @var bool */ |
||
24 | private $default; |
||
25 | |||
26 | /** @var mixed[]|null */ |
||
27 | private $enum; |
||
28 | |||
29 | /** |
||
30 | * @param mixed[]|null $enum |
||
31 | */ |
||
32 | 291 | public function __construct( |
|
33 | string $name, |
||
34 | Type $type, |
||
35 | bool $required = false, |
||
36 | bool $default = false, |
||
37 | ?array $enum = null |
||
38 | ) { |
||
39 | 291 | $this->name = $name; |
|
40 | 291 | $this->type = $type; |
|
41 | 291 | $this->required = $required; |
|
42 | 291 | $this->default = $default; |
|
43 | 291 | $this->enum = $enum; |
|
44 | 291 | } |
|
45 | |||
46 | 291 | public function getName() : string |
|
49 | } |
||
50 | |||
51 | 204 | public function isRequired() : bool |
|
54 | } |
||
55 | |||
56 | 233 | public function getType() : Type |
|
57 | { |
||
58 | 233 | return $this->type; |
|
59 | } |
||
60 | |||
61 | 290 | public function isDefault() : bool |
|
64 | } |
||
65 | |||
66 | /** |
||
67 | * @return mixed[]|null |
||
68 | */ |
||
69 | 232 | public function getEnum() : ?array |
|
72 | } |
||
73 | } |
||
74 |