| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 49 | 4 | public function equals(ValueObjectInterface $other): bool |
|
| 50 | { |
||
| 51 | 4 | if (get_class($this) !== get_class($other)) { |
|
| 52 | 1 | throw new InvalidVOArgumentException( |
|
| 53 | 1 | sprintf( |
|
| 54 | 1 | 'A Value Object of type %s can not be compared to another of type %s', |
|
| 55 | 1 | get_class($this), |
|
| 56 | 1 | get_class($other) |
|
| 57 | ), |
||
| 58 | [ |
||
| 59 | 1 | 'original' => $this, |
|
| 60 | 1 | 'destination' => $other |
|
| 61 | ] |
||
| 62 | ); |
||
| 63 | } |
||
| 64 | 3 | return $this->getValue() === $other->getValue(); |
|
| 65 | } |
||
| 88 |