Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 12 |
Ratio | 100 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php namespace League\Fractal\Test\Stub\Transformer; |
||
21 | View Code Duplication | public function includeAuthor(array $book) |
|
22 | { |
||
23 | if (!array_key_exists('_author', $book)) { |
||
24 | return; |
||
25 | } |
||
26 | |||
27 | if ($book['_author'] === null) { |
||
28 | return $this->null(); |
||
29 | } |
||
30 | |||
31 | return $this->item($book['_author'], new JsonApiAuthorTransformer(), 'people'); |
||
32 | } |
||
33 | |||
47 |