@@ -38,6 +38,6 @@ |
||
38 | 38 | */ |
39 | 39 | public function getDefaultDriver() |
40 | 40 | { |
41 | - return $this->app['config']['url-shortener.default']; |
|
41 | + return $this->app[ 'config' ][ 'url-shortener.default' ]; |
|
42 | 42 | } |
43 | 43 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | throw new UnsupportedOperationException('Async URL shortening is not supported'); |
50 | 50 | } |
51 | 51 | |
52 | - return $promise->then(function ($uri) { |
|
52 | + return $promise->then(function($uri) { |
|
53 | 53 | return $this->parseUri($uri); |
54 | 54 | }); |
55 | 55 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | if (is_string($uri) || (is_object($uri) && method_exists($uri, '__toString'))) { |
122 | - return new Uri((string)$uri); |
|
122 | + return new Uri((string) $uri); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | throw new InvalidArgumentException('URI must be a string or UriInterface'); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | if (is_array($key)) { |
157 | 157 | $this->options = array_merge($this->options, $key); |
158 | 158 | } else { |
159 | - $this->options[$key] = $value; |
|
159 | + $this->options[ $key ] = $value; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | return $this; |
@@ -169,6 +169,6 @@ discard block |
||
169 | 169 | */ |
170 | 170 | public function __toString() |
171 | 171 | { |
172 | - return (string)$this->get(); |
|
172 | + return (string) $this->get(); |
|
173 | 173 | } |
174 | 174 | } |
@@ -35,10 +35,10 @@ |
||
35 | 35 | */ |
36 | 36 | public function toPromise(UriInterface $uri, array $options): PromiseInterface |
37 | 37 | { |
38 | - $options = array_merge_recursive(Arr::add($this->defaults, 'query.url', (string)$uri), $options); |
|
38 | + $options = array_merge_recursive(Arr::add($this->defaults, 'query.url', (string) $uri), $options); |
|
39 | 39 | $request = new Request('POST', '/api-create.php'); |
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 str_replace('http://', 'https://', $response->getBody()->getContents()); |
43 | 43 | }); |
44 | 44 | } |
@@ -18,5 +18,5 @@ |
||
18 | 18 | * @param array $options |
19 | 19 | * @return \LaraCrafts\UrlShortener\Builder |
20 | 20 | */ |
21 | - public function shorten($uri, array $options = []); |
|
21 | + public function shorten($uri, array $options = [ ]); |
|
22 | 22 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | /** |
31 | 31 | * {@inheritDoc} |
32 | 32 | */ |
33 | - public function shorten($uri, array $options = []) |
|
33 | + public function shorten($uri, array $options = [ ]) |
|
34 | 34 | { |
35 | 35 | return new Builder($this, $uri, $options); |
36 | 36 | } |