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