Total Complexity | 6 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | final class PropertyMetadata |
||
10 | { |
||
11 | /** @var string */ |
||
12 | private $name; |
||
13 | |||
14 | /** @var Type */ |
||
15 | private $type; |
||
16 | |||
17 | /** @var bool */ |
||
18 | private $isRequired; |
||
19 | |||
20 | /** @var mixed[] */ |
||
21 | private $enumValues; |
||
22 | |||
23 | /** @var bool */ |
||
24 | private $default; |
||
25 | |||
26 | /** |
||
27 | * @param mixed[] $enumValues |
||
28 | */ |
||
29 | 9 | public function __construct(string $name, Type $type, bool $isDefault = false, array $enumValues = [], bool $isRequired = false) |
|
30 | { |
||
31 | 9 | $this->name = $name; |
|
32 | 9 | $this->type = $type; |
|
33 | 9 | $this->enumValues = $enumValues; |
|
34 | 9 | $this->isRequired = $isRequired; |
|
35 | 9 | $this->default = $isDefault; |
|
36 | 9 | } |
|
37 | |||
38 | 8 | public function getName() : string |
|
41 | } |
||
42 | |||
43 | 6 | public function type() : Type |
|
44 | { |
||
45 | 6 | return $this->type; |
|
46 | } |
||
47 | |||
48 | 6 | public function isRequired() : bool |
|
49 | { |
||
50 | 6 | return $this->isRequired; |
|
51 | } |
||
52 | |||
53 | 7 | public function isDefault() : bool |
|
54 | { |
||
55 | 7 | return $this->default; |
|
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return mixed[] |
||
60 | */ |
||
61 | 6 | public function enumValues() : array |
|
64 | } |
||
65 | } |
||
66 |