Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | 42 | private function applyWith($query) |
|
28 | { |
||
29 | 42 | $requested_with = $this->resource_context->with(); |
|
30 | |||
31 | 42 | if ($this->allowed_with === ['*']) { |
|
32 | 1 | $with = $requested_with; |
|
33 | } else { |
||
34 | 41 | $with = array_intersect($this->allowed_with, $requested_with); |
|
35 | } |
||
36 | |||
37 | 42 | $with = array_unique(array_merge($with, $this->default_with)); |
|
38 | |||
39 | 42 | if (!empty($with)) { |
|
40 | 4 | $query->with($with); |
|
41 | } |
||
42 | |||
43 | 42 | return $this; |
|
44 | } |
||
46 |