Lines
100.00%
5 / 5
Methods
100.00%
5 / 5
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| named | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| entityName | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| isEntityName | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| equals | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| 8 | final readonly class EntityAlias | |
| 9 | { | |
| 10 | public function __construct(public ?string $phrase) {} | |
| 11 | ||
| 12 | public static function named(string $phrase): self | |
| 13 | { | |
| 14 | return new self($phrase); | |
| 15 | } | |
| 16 | ||
| 17 | public static function entityName(): self | |
| 18 | { | |
| 19 | return new self(null); | |
| 20 | } | |
| 21 | ||
| 22 | public function isEntityName(): bool | |
| 23 | { | |
| 24 | return $this->phrase === null; | |
| 25 | } | |
| 26 | ||
| 27 | public function equals(self $other): bool | |
| 28 | { | |
| 29 | return $this->phrase === $other->phrase; | |
| 30 | } | |
| 31 | } |