Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
37 | 2 | public function toArray(): array |
|
38 | { |
||
39 | 2 | $response = [ |
|
40 | 'type' => 'http', |
||
41 | 2 | 'uris' => $this->uris, |
|
42 | ]; |
||
43 | |||
44 | 2 | if (!empty($this->username)) { |
|
45 | 1 | $response['httpAuthenticationUsername'] = $this->username; |
|
46 | } |
||
47 | |||
48 | 2 | if (!empty($this->password)) { |
|
49 | 1 | $response['httpAuthenticationPassword'] = $this->password; |
|
50 | } |
||
51 | |||
52 | 2 | return $response; |
|
53 | } |
||
54 | } |