| Conditions | 2 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 20 | public function send($filename, $content) |
|
| 26 | { |
||
| 27 | 20 | $client = $this->getClient(); |
|
| 28 | 20 | $result = new BillResult(); |
|
| 29 | |||
| 30 | try { |
||
| 31 | $params = [ |
||
| 32 | 20 | 'fileName' => $filename, |
|
| 33 | 20 | 'contentFile' => $content, |
|
| 34 | 20 | ]; |
|
| 35 | 20 | $response = $client->call('sendBill', [ 'parameters' => $params ]); |
|
| 36 | 10 | $cdrZip = $response->applicationResponse; |
|
| 37 | $result |
||
| 38 | 10 | ->setCdrResponse($this->extractResponse($cdrZip)) |
|
| 39 | 10 | ->setCdrZip($cdrZip) |
|
| 40 | 10 | ->setSuccess(true); |
|
| 41 | } |
||
| 42 | 20 | catch (\SoapFault $e) { |
|
| 43 | 10 | $result->setError($this->getErrorFromFault($e)); |
|
| 44 | } |
||
| 45 | |||
| 46 | 20 | return $result; |
|
| 47 | } |
||
| 48 | } |