| Conditions | 4 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function isSame($other): bool |
||
| 41 | { |
||
| 42 | if (null === $other || !is_object($other)) { |
||
| 43 | return false; |
||
| 44 | } |
||
| 45 | |||
| 46 | $thisClass = ClassUtils::getRealClass(get_class($this)); |
||
| 47 | $otherClass = ClassUtils::getRealClass(get_class($other)); |
||
| 48 | |||
| 49 | if ($thisClass !== $otherClass) { |
||
| 50 | return false; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** @var EntityInterface $otherEntity */ |
||
| 54 | $otherEntity = $other; |
||
| 55 | |||
| 56 | return $this->getId() === $otherEntity->getId(); |
||
| 57 | } |
||
| 58 | } |
||
| 59 |