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