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