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