| Total Complexity | 4 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| 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 | 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 | parent::__construct($name, $methods); |
||
| 36 | $this->constants = $constants; |
||
| 37 | $this->traits = $traits; |
||
| 38 | $this->interfaces = $interfaces; |
||
|
|
|||
| 39 | } |
||
| 40 | |||
| 41 | public function hasProperties(): bool |
||
| 42 | { |
||
| 43 | return $this->cases !== [] || $this->constants !== []; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** @return EnumCase[] */ |
||
| 47 | public function cases(): array |
||
| 50 | } |
||
| 51 | } |
||
| 52 |