| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function getForeignKey($relation) |
||
| 35 | { |
||
| 36 | if (method_exists($relation, 'getForeignKey')) { |
||
| 37 | return $relation->getForeignKey(); |
||
| 38 | } |
||
| 39 | |||
| 40 | if (method_exists($relation, 'getForeignKeyName')) { |
||
| 41 | return $relation->getForeignKeyName(); |
||
| 42 | } |
||
| 43 | |||
| 44 | throw new Exception("Unable to resolve foreign key."); |
||
|
|
|||
| 45 | } |
||
| 47 |