| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.0312 |
| Changes | 6 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 70 | 9 | public function getRelationship($model, $name) |
|
| 71 | { |
||
| 72 | 9 | $method = $this->getRelationshipMethodName($name); |
|
| 73 | |||
| 74 | 9 | if (method_exists($this, $method)) { |
|
| 75 | 9 | $relationship = $this->$method($model); |
|
| 76 | |||
| 77 | 9 | if ($relationship !== null && ! ($relationship instanceof Relationship)) { |
|
| 78 | 3 | throw new LogicException('Relationship method must return null or an instance of Tobscure\JsonApi\Relationship'); |
|
|
|
|||
| 79 | } |
||
| 80 | |||
| 81 | 6 | return $relationship; |
|
| 82 | } |
||
| 83 | } |
||
| 84 | |||
| 102 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.