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