Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
49 | public function getRelationship($name) |
||
50 | { |
||
51 | $method = $this->getRelationshipMethodName($name); |
||
52 | |||
53 | if (method_exists($this, $method)) { |
||
54 | $relationship = $this->$method(); |
||
55 | |||
56 | if ($relationship !== null && ! ($relationship instanceof Relationship)) { |
||
57 | throw new LogicException('Relationship method must return null or an instance of Tobscure\JsonApi\Relationship'); |
||
|
|||
58 | } |
||
59 | |||
60 | return $relationship; |
||
61 | } |
||
62 | } |
||
63 | |||
86 |
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.