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