Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 6 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
70 | public function getRelationship($model, $name) |
||
71 | { |
||
72 | $method = $this->getRelationshipMethodName($name); |
||
73 | |||
74 | if (method_exists($this, $method)) { |
||
75 | $relationship = $this->$method($model); |
||
76 | |||
77 | if ($relationship !== null && ! ($relationship instanceof Relationship)) { |
||
78 | throw new LogicException('Relationship method must return null or an instance of Tobscure\JsonApi\Relationship'); |
||
|
|||
79 | } |
||
80 | |||
81 | 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.