Conditions | 1 |
Paths | 1 |
Total Lines | 7 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
44 | 34 | public function shortenAsync($url, array $options = []) |
|
45 | { |
||
46 | 34 | $options = array_merge(Arr::add($this->defaults, 'json.long_url', $url), $options); |
|
47 | 34 | $request = new Request('POST', '/v4/shorten'); |
|
48 | |||
49 | 22 | return $this->client->sendAsync($request, $options)->then(function (ResponseInterface $response) { |
|
50 | 34 | return str_replace('http://', 'https://', json_decode($response->getBody()->getContents())->link); |
|
51 | 34 | }); |
|
54 |