@@ -11,5 +11,5 @@ |
||
| 11 | 11 | * @param array $options |
| 12 | 12 | * @return string |
| 13 | 13 | */ |
| 14 | - public function shorten($url, array $options = []); |
|
| 14 | + public function shorten($url, array $options = [ ]); |
|
| 15 | 15 | } |
@@ -11,5 +11,5 @@ |
||
| 11 | 11 | * @param array $options |
| 12 | 12 | * @return \GuzzleHttp\Promise\PromiseInterface |
| 13 | 13 | */ |
| 14 | - public function shortenAsync($url, array $options = []); |
|
| 14 | + public function shortenAsync($url, array $options = [ ]); |
|
| 15 | 15 | } |
@@ -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(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 | } |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | /** |
| 10 | 10 | * {@inheritDoc} |
| 11 | 11 | */ |
| 12 | - public function shorten($url, array $options = []) |
|
| 12 | + public function shorten($url, array $options = [ ]) |
|
| 13 | 13 | { |
| 14 | 14 | return $this->shortenAsync($url, $options)->wait(); |
| 15 | 15 | } |
@@ -29,12 +29,12 @@ |
||
| 29 | 29 | /** |
| 30 | 30 | * {@inheritDoc} |
| 31 | 31 | */ |
| 32 | - public function shortenAsync($url, array $options = []) |
|
| 32 | + public function shortenAsync($url, array $options = [ ]) |
|
| 33 | 33 | { |
| 34 | 34 | $options = array_merge(Arr::add(static::defaults, 'query.url', $url), $options); |
| 35 | 35 | $request = new Request('GET', '/api-create.php'); |
| 36 | 36 | |
| 37 | - return $this->client->sendAsync($request, $options)->then(function (ResponseInterface $response) { |
|
| 37 | + return $this->client->sendAsync($request, $options)->then(function(ResponseInterface $response) { |
|
| 38 | 38 | return str_replace('http://', 'https://', $response->getBody()->getContents()); |
| 39 | 39 | }); |
| 40 | 40 | } |
@@ -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($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 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function getDefaultDriver() |
| 77 | 77 | { |
| 78 | - return $this->app['config']['url-shortener.default']; |
|
| 78 | + return $this->app[ 'config' ][ 'url-shortener.default' ]; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -86,6 +86,6 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | protected function getDriverConfig(string $name) |
| 88 | 88 | { |
| 89 | - return $this->app['config']["url-shortener.drivers.$name"] ?: []; |
|
| 89 | + return $this->app[ 'config' ][ "url-shortener.drivers.$name" ] ?: [ ]; |
|
| 90 | 90 | } |
| 91 | 91 | } |
@@ -33,12 +33,12 @@ |
||
| 33 | 33 | /** |
| 34 | 34 | * {@inheritDoc} |
| 35 | 35 | */ |
| 36 | - public function shortenAsync($url, array $options = []) |
|
| 36 | + public function shortenAsync($url, array $options = [ ]) |
|
| 37 | 37 | { |
| 38 | 38 | $options = array_merge(Arr::add($this->defaults, 'query.s', $url), $options); |
| 39 | 39 | $request = new Request('GET', "/api/$this->token"); |
| 40 | 40 | |
| 41 | - return $this->client->sendAsync($request, $options)->then(function (ResponseInterface $response) { |
|
| 41 | + return $this->client->sendAsync($request, $options)->then(function(ResponseInterface $response) { |
|
| 42 | 42 | return $response->getBody()->getContents(); |
| 43 | 43 | }); |
| 44 | 44 | } |
@@ -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 = Arr::add(array_merge($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 | } |