| Conditions | 1 |
| Paths | 1 |
| Total Lines | 7 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function shortenAsync($url, array $options = []) |
||
| 40 | { |
||
| 41 | $options = array_merge_recursive($this->defaults, $options); |
||
| 42 | $request = new Request('PUT', '/v1/data/url', [], http_build_query(['urlToShorten' => $url])); |
||
| 43 | |||
| 44 | return $this->client->sendAsync($request, $options)->then(function (ResponseInterface $response) { |
||
| 45 | return json_decode($response->getBody()->getContents())->shortenedUrl; |
||
| 46 | }); |
||
| 49 |