Total Complexity | 6 |
Total Lines | 64 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
11 | final class PropertyMetadata |
||
12 | { |
||
13 | /** @var string */ |
||
14 | private $name; |
||
15 | |||
16 | /** @var array<string, string>|null */ |
||
17 | private $type; |
||
18 | |||
19 | /** @var bool */ |
||
20 | private $required; |
||
21 | |||
22 | /** @var bool */ |
||
23 | private $default; |
||
24 | |||
25 | /** @var array<int|float|string|bool>|null */ |
||
26 | private $enum; |
||
27 | |||
28 | /** |
||
29 | * @param array<string, string> $type |
||
30 | * @param array<int|float|string|bool>|null $enum |
||
31 | */ |
||
32 | 294 | public function __construct( |
|
33 | string $name, |
||
34 | ?array $type, |
||
35 | bool $required = false, |
||
36 | bool $default = false, |
||
37 | ?array $enum = null |
||
38 | ) { |
||
39 | 294 | $this->name = $name; |
|
40 | 294 | $this->type = $type; |
|
41 | 294 | $this->required = $required; |
|
42 | 294 | $this->default = $default; |
|
43 | 294 | $this->enum = $enum; |
|
44 | 294 | } |
|
45 | |||
46 | 294 | public function getName() : string |
|
49 | } |
||
50 | |||
51 | 205 | public function isRequired() : bool |
|
52 | { |
||
53 | 205 | return $this->required; |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * @return array<string, string>|null |
||
58 | */ |
||
59 | 234 | public function getType() : ?array |
|
60 | { |
||
61 | 234 | return $this->type; |
|
62 | } |
||
63 | |||
64 | 294 | public function isDefault() : bool |
|
67 | } |
||
68 | |||
69 | /** |
||
70 | * @return array<int|float|string|bool>|null |
||
71 | */ |
||
72 | 234 | public function getEnum() : ?array |
|
75 | } |
||
76 | } |
||
77 |