Total Complexity | 5 |
Total Lines | 46 |
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 | /** |
||
24 | * @param mixed[] $enumValues |
||
25 | */ |
||
26 | 9 | public function __construct(string $name, Type $type, array $enumValues = [], bool $isRequired = false) |
|
27 | { |
||
28 | 9 | $this->name = $name; |
|
29 | 9 | $this->type = $type; |
|
30 | 9 | $this->enumValues = $enumValues; |
|
31 | 9 | $this->isRequired = $isRequired; |
|
32 | 9 | } |
|
33 | |||
34 | 8 | public function getName() : string |
|
37 | } |
||
38 | |||
39 | 6 | public function type() : Type |
|
40 | { |
||
41 | 6 | return $this->type; |
|
42 | } |
||
43 | |||
44 | 6 | public function isRequired() : bool |
|
45 | { |
||
46 | 6 | return $this->isRequired; |
|
47 | } |
||
48 | |||
49 | /** |
||
50 | * @return mixed[] |
||
51 | */ |
||
52 | 6 | public function enumValues() : array |
|
55 | } |
||
56 | } |
||
57 |