Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4.0119 |
Changes | 0 |
1 | <?php |
||
31 | 2 | public function buildPrefix(Query $query) |
|
32 | { |
||
33 | 2 | if ($query->from === 'repo') { |
|
34 | 2 | if (!empty($query->where['organization'])) { |
|
35 | 1 | $organization = $query->where['organization']; |
|
36 | 1 | unset($query->where['organization']); |
|
37 | |||
38 | 1 | return "orgs/$organization"; |
|
39 | 1 | } elseif (!empty($query->where['user'])) { |
|
40 | 1 | $user = $query->where['user']; |
|
41 | 1 | unset($query->where['user']); |
|
42 | |||
43 | 1 | return "users/$user"; |
|
44 | } |
||
45 | } |
||
46 | } |
||
47 | } |
||
48 |