Total Complexity | 4 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
14 | final class EnumDefinition extends Definition implements HasConstants, UseTraits, ImplementsInterfaces |
||
15 | { |
||
16 | use WithConstants; |
||
17 | use WithTraits; |
||
18 | use WithInterfaces; |
||
19 | |||
20 | /** |
||
21 | * @param Method[] $methods |
||
22 | * @param EnumCase[] $cases |
||
23 | * @param Constant[] $constants |
||
24 | * @param Name[] $interfaces |
||
25 | * @param Name[] $traits |
||
26 | */ |
||
27 | 27 | public function __construct( |
|
28 | Name $name, |
||
29 | private readonly array $cases, |
||
30 | array $methods = [], |
||
31 | array $constants = [], |
||
32 | array $interfaces = [], |
||
33 | array $traits = [], |
||
34 | ) { |
||
35 | 27 | parent::__construct($name, $methods); |
|
36 | 27 | $this->constants = $constants; |
|
37 | 27 | $this->traits = $traits; |
|
38 | 27 | $this->interfaces = $interfaces; |
|
|
|||
39 | } |
||
40 | |||
41 | 11 | public function hasProperties(): bool |
|
42 | { |
||
43 | 11 | return $this->cases !== [] || $this->constants !== []; |
|
44 | } |
||
45 | |||
46 | /** @return EnumCase[] */ |
||
47 | 10 | public function cases(): array |
|
50 | } |
||
51 | } |
||
52 |