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