@@ -49,12 +49,12 @@ |
||
| 49 | 49 | /** |
| 50 | 50 | * {@inheritDoc} |
| 51 | 51 | */ |
| 52 | - public function shortenAsync($url, array $options = []) |
|
| 52 | + public function shortenAsync($url, array $options = [ ]) |
|
| 53 | 53 | { |
| 54 | 54 | $options = array_merge_recursive(Arr::add($this->defaults, 'json.dynamicLinkInfo.link', $url), $options); |
| 55 | 55 | $request = new Request('POST', '/v1/shortLinks'); |
| 56 | 56 | |
| 57 | - return $this->client->sendAsync($request, $options)->then(function (ResponseInterface $response) { |
|
| 57 | + return $this->client->sendAsync($request, $options)->then(function(ResponseInterface $response) { |
|
| 58 | 58 | return json_decode($response->getBody()->getContents())->shortLink; |
| 59 | 59 | }); |
| 60 | 60 | } |
@@ -41,12 +41,12 @@ |
||
| 41 | 41 | /** |
| 42 | 42 | * {@inheritDoc} |
| 43 | 43 | */ |
| 44 | - public function shortenAsync($url, array $options = []) |
|
| 44 | + public function shortenAsync($url, array $options = [ ]) |
|
| 45 | 45 | { |
| 46 | 46 | $options = array_merge_recursive(Arr::add($this->defaults, 'json.long_url', $url), $options); |
| 47 | 47 | $request = new Request('POST', '/v4/shorten'); |
| 48 | 48 | |
| 49 | - return $this->client->sendAsync($request, $options)->then(function (ResponseInterface $response) { |
|
| 49 | + return $this->client->sendAsync($request, $options)->then(function(ResponseInterface $response) { |
|
| 50 | 50 | return str_replace('http://', 'https://', json_decode($response->getBody()->getContents())->link); |
| 51 | 51 | }); |
| 52 | 52 | } |
@@ -47,12 +47,12 @@ |
||
| 47 | 47 | /** |
| 48 | 48 | * {@inheritDoc} |
| 49 | 49 | */ |
| 50 | - public function shortenAsync($url, array $options = []) |
|
| 50 | + public function shortenAsync($url, array $options = [ ]) |
|
| 51 | 51 | { |
| 52 | 52 | $options = array_merge_recursive(Arr::add($this->defaults, 'query.url', $url), $options); |
| 53 | 53 | $request = new Request('GET', '/api/v2/action/shorten'); |
| 54 | 54 | |
| 55 | - return $this->client->sendAsync($request, $options)->then(function (ResponseInterface $response) { |
|
| 55 | + return $this->client->sendAsync($request, $options)->then(function(ResponseInterface $response) { |
|
| 56 | 56 | return json_decode($response->getBody()->getContents())->result; |
| 57 | 57 | }); |
| 58 | 58 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $this->client = $client; |
| 26 | 26 | $this->defaults = [ |
| 27 | 27 | 'allow_redirects' => false, |
| 28 | - 'base_uri' => (string)$baseUri, |
|
| 28 | + 'base_uri' => (string) $baseUri, |
|
| 29 | 29 | 'query' => [ |
| 30 | 30 | 'format' => 'simple', |
| 31 | 31 | 'logstats' => intval($statistics), |
@@ -36,12 +36,12 @@ discard block |
||
| 36 | 36 | /** |
| 37 | 37 | * {@inheritDoc} |
| 38 | 38 | */ |
| 39 | - public function shortenAsync($url, array $options = []) |
|
| 39 | + public function shortenAsync($url, array $options = [ ]) |
|
| 40 | 40 | { |
| 41 | 41 | $options = Arr::add(array_merge_recursive($this->defaults, $options), 'query.url', $url); |
| 42 | 42 | $request = new Request('GET', '/create.php'); |
| 43 | 43 | |
| 44 | - return $this->client->sendAsync($request, $options)->then(function (ResponseInterface $response) { |
|
| 44 | + return $this->client->sendAsync($request, $options)->then(function(ResponseInterface $response) { |
|
| 45 | 45 | return $response->getBody()->getContents(); |
| 46 | 46 | }); |
| 47 | 47 | } |
@@ -36,12 +36,12 @@ |
||
| 36 | 36 | /** |
| 37 | 37 | * {@inheritDoc} |
| 38 | 38 | */ |
| 39 | - public function shortenAsync($url, array $options = []) |
|
| 39 | + public function shortenAsync($url, array $options = [ ]) |
|
| 40 | 40 | { |
| 41 | 41 | $options = array_merge_recursive($this->defaults, $options); |
| 42 | - $request = new Request('PUT', '/v1/data/url', [], http_build_query(['urlToShorten' => $url])); |
|
| 42 | + $request = new Request('PUT', '/v1/data/url', [ ], http_build_query([ 'urlToShorten' => $url ])); |
|
| 43 | 43 | |
| 44 | - return $this->client->sendAsync($request, $options)->then(function (ResponseInterface $response) { |
|
| 44 | + return $this->client->sendAsync($request, $options)->then(function(ResponseInterface $response) { |
|
| 45 | 45 | return json_decode($response->getBody()->getContents())->shortenedUrl; |
| 46 | 46 | }); |
| 47 | 47 | } |