Conditions | 6 |
Paths | 6 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
12 | public function isCompatible(AssociationStubBase $otherStub) : bool |
||
13 | { |
||
14 | if (!parent::isCompatible($otherStub)) { |
||
15 | return false; |
||
16 | } |
||
17 | |||
18 | if ($this->getThroughFieldChain() !== array_reverse($otherStub->getThroughFieldChain())) { |
||
19 | return false; |
||
20 | } |
||
21 | |||
22 | return ($this->getTargType() === $otherStub->getBaseType()) |
||
23 | && ($this->getBaseType() === $otherStub->getTargType()) |
||
24 | && ($this->getForeignFieldName() === $otherStub->getKeyFieldName()) |
||
25 | && ($this->getKeyFieldName() === $otherStub->getForeignFieldName()); |
||
26 | } |
||
48 |