| Conditions | 6 |
| Paths | 32 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 75 | 2 | public function toJson() |
|
| 76 | { |
||
| 77 | 2 | $response = array(); |
|
| 78 | 2 | if ($this->id) { |
|
| 79 | 2 | $response['id'] = $this->id; |
|
| 80 | } |
||
| 81 | 2 | if ($this->name) { |
|
| 82 | 1 | $response['name'] = $this->name; |
|
| 83 | } |
||
| 84 | 2 | if ($this->publicId) { |
|
| 85 | 1 | $response['public_id'] = $this->publicId; |
|
| 86 | } |
||
| 87 | 2 | if ($this->email) { |
|
| 88 | 1 | $response['email'] = $this->email; |
|
| 89 | } |
||
| 90 | 2 | if ($this->phone) { |
|
| 91 | 1 | $response['phone'] = $this->phone; |
|
| 92 | } |
||
| 93 | |||
| 94 | 2 | return XsollaClient::jsonEncode(array('user' => $response)); |
|
| 95 | } |
||
| 96 | } |
||
| 97 |