Conditions | 6 |
Paths | 5 |
Total Lines | 22 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 7 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
35 | public function isCompatible(AssociationStubBase $otherStub) : bool |
||
36 | { |
||
37 | if (!parent::isCompatible($otherStub)) { |
||
38 | return false; |
||
39 | } |
||
40 | |||
41 | if (null === $this->getTargType() && null === $otherStub->getTargType()) { |
||
42 | return false; |
||
43 | } |
||
44 | |||
45 | $thisBase = $this->getBaseType(); |
||
46 | $thatBase = $otherStub->getBaseType(); |
||
47 | $thatTarg = $otherStub->getTargType() ?? $thisBase; |
||
48 | $thisTarg = $this->getTargType() ?? $thatBase; |
||
49 | if ($thatTarg != $thisBase) { |
||
50 | return false; |
||
51 | } |
||
52 | if ($thisTarg != $thatBase) { |
||
53 | return false; |
||
54 | } |
||
55 | |||
56 | return true; |
||
57 | } |
||
67 |