Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
7 / 7 |
| TableIdentifier | |
100.00% |
1 / 1 |
|
100.00% |
4 / 4 |
6 | |
100.00% |
7 / 7 |
| __construct | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| fromString | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| toString | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| equals | |
100.00% |
1 / 1 |
3 | |
100.00% |
3 / 3 |
|||
| <?php | |
| declare(strict_types=1); | |
| namespace App\Order\Domain\ValueObject; | |
| use App\Shared\ValueObjectInterface; | |
| final class TableIdentifier implements ValueObjectInterface | |
| { | |
| private string $identifier; | |
| private function __construct(string $identifier) | |
| { | |
| $this->identifier = $identifier; | |
| } | |
| public static function fromString(string $identifier): self | |
| { | |
| return new self($identifier); | |
| } | |
| public function toString(): string | |
| { | |
| return $this->identifier; | |
| } | |
| public function equals(ValueObjectInterface $other): bool | |
| { | |
| if (!$other instanceof self) { | |
| return false; | |
| } | |
| return get_class($this) === get_class($other) && $this->identifier === $other->identifier; | |
| } | |
| } |