| Conditions | 4 |
| Paths | 8 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 26 | 2 | private function buildResponse($userId, $userEmail, $userPhone, $userCountry) |
|
| 27 | { |
||
| 28 | 2 | $response = array('user_id' => $userId); |
|
| 29 | 2 | if ($userEmail) { |
|
| 30 | 1 | $response['email'] = $userEmail; |
|
| 31 | 1 | } |
|
| 32 | 2 | if ($userPhone) { |
|
| 33 | 1 | $response['phone'] = $userPhone; |
|
| 34 | 1 | } |
|
| 35 | 2 | if ($userCountry) { |
|
| 36 | 1 | $response['country'] = $userCountry; |
|
| 37 | 1 | } |
|
| 38 | |||
| 39 | 2 | return $response; |
|
| 40 | } |
||
| 41 | } |
||
| 42 |