@@ -11,8 +11,7 @@ |
||
| 11 | 11 | * |
| 12 | 12 | * @return string |
| 13 | 13 | */ |
| 14 | - protected static function getFacadeAccessor() |
|
| 15 | - { |
|
| 14 | + protected static function getFacadeAccessor() { |
|
| 16 | 15 | return 'flickr'; |
| 17 | 16 | } |
| 18 | 17 | } |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | { |
| 87 | 87 | $parameters['photo_id'] = $photoId; |
| 88 | 88 | |
| 89 | - if (! is_null($secretId)) { |
|
| 89 | + if ( ! is_null($secretId)) { |
|
| 90 | 90 | $parameters['secret'] = $secretId; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -16,8 +16,7 @@ discard block |
||
| 16 | 16 | * |
| 17 | 17 | * @param \JeroenG\Flickr\Api $api |
| 18 | 18 | */ |
| 19 | - public function __construct(Api $api) |
|
| 20 | - { |
|
| 19 | + public function __construct(Api $api) { |
|
| 21 | 20 | $this->api = $api; |
| 22 | 21 | } |
| 23 | 22 | |
@@ -28,8 +27,7 @@ discard block |
||
| 28 | 27 | * @param array|null $parameters |
| 29 | 28 | * @return \JeroenG\Flickr\Response |
| 30 | 29 | */ |
| 31 | - public function request($method, $parameters = null) |
|
| 32 | - { |
|
| 30 | + public function request($method, $parameters = null) { |
|
| 33 | 31 | return $this->api->request($method, $parameters); |
| 34 | 32 | } |
| 35 | 33 | |
@@ -39,8 +37,7 @@ discard block |
||
| 39 | 37 | * @param string $string |
| 40 | 38 | * @return \JeroenG\Flickr\Response |
| 41 | 39 | */ |
| 42 | - public function echoThis($string) |
|
| 43 | - { |
|
| 40 | + public function echoThis($string) { |
|
| 44 | 41 | return $this->request('flickr.test.echo', ['this' => $string]); |
| 45 | 42 | } |
| 46 | 43 | |
@@ -50,8 +47,7 @@ discard block |
||
| 50 | 47 | * @param array|null $parameters |
| 51 | 48 | * @return \JeroenG\Flickr\Response |
| 52 | 49 | */ |
| 53 | - public function listSets($parameters = null) |
|
| 54 | - { |
|
| 50 | + public function listSets($parameters = null) { |
|
| 55 | 51 | return $this->request('flickr.photosets.getList', $parameters); |
| 56 | 52 | } |
| 57 | 53 | |
@@ -63,8 +59,7 @@ discard block |
||
| 63 | 59 | * @param array|null $otherParameters |
| 64 | 60 | * @return \JeroenG\Flickr\Response |
| 65 | 61 | */ |
| 66 | - public function photosForSet($setId, $userId, $otherParameters = null) |
|
| 67 | - { |
|
| 62 | + public function photosForSet($setId, $userId, $otherParameters = null) { |
|
| 68 | 63 | $parameters['photoset_id'] = $setId; |
| 69 | 64 | $parameters['user_id'] = $userId; |
| 70 | 65 | |
@@ -82,8 +77,7 @@ discard block |
||
| 82 | 77 | * @param string|null $secretId |
| 83 | 78 | * @return \JeroenG\Flickr\Response |
| 84 | 79 | */ |
| 85 | - public function photoInfo($photoId, $secretId = null) |
|
| 86 | - { |
|
| 80 | + public function photoInfo($photoId, $secretId = null) { |
|
| 87 | 81 | $parameters['photo_id'] = $photoId; |
| 88 | 82 | |
| 89 | 83 | if (! is_null($secretId)) { |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | */ |
| 83 | 83 | protected function parameters($array) |
| 84 | 84 | { |
| 85 | - if (! is_array($array)) { |
|
| 85 | + if ( ! is_array($array)) { |
|
| 86 | 86 | return; |
| 87 | 87 | } |
| 88 | 88 | $encoded = []; |
@@ -35,8 +35,7 @@ discard block |
||
| 35 | 35 | * @param string $endpoint |
| 36 | 36 | * @return void |
| 37 | 37 | */ |
| 38 | - public function __construct($apiKey, $format = 'php_serial', $endpoint = 'https://api.flickr.com/services/rest/') |
|
| 39 | - { |
|
| 38 | + public function __construct($apiKey, $format = 'php_serial', $endpoint = 'https://api.flickr.com/services/rest/') { |
|
| 40 | 39 | $this->key = $apiKey; |
| 41 | 40 | $this->format = $format; |
| 42 | 41 | |
@@ -53,8 +52,7 @@ discard block |
||
| 53 | 52 | * @param array|null $parameters |
| 54 | 53 | * @return \JeroenG\Flickr\Response |
| 55 | 54 | */ |
| 56 | - public function request($call, $parameters = null) |
|
| 57 | - { |
|
| 55 | + public function request($call, $parameters = null) { |
|
| 58 | 56 | $guzzleResponse = $this->client->get($this->api().'&method='.$call.$this->parameters($parameters)); |
| 59 | 57 | |
| 60 | 58 | if ($guzzleResponse->getStatusCode() == 200) { |
@@ -69,8 +67,7 @@ discard block |
||
| 69 | 67 | * |
| 70 | 68 | * @return string |
| 71 | 69 | */ |
| 72 | - protected function api() |
|
| 73 | - { |
|
| 70 | + protected function api() { |
|
| 74 | 71 | return '?api_key='.$this->key.'&format='.$this->format; |
| 75 | 72 | } |
| 76 | 73 | |
@@ -80,8 +77,7 @@ discard block |
||
| 80 | 77 | * @param array $array |
| 81 | 78 | * @return string |
| 82 | 79 | */ |
| 83 | - protected function parameters($array) |
|
| 84 | - { |
|
| 80 | + protected function parameters($array) { |
|
| 85 | 81 | if (! is_array($array)) { |
| 86 | 82 | return; |
| 87 | 83 | } |
@@ -18,8 +18,7 @@ discard block |
||
| 18 | 18 | * |
| 19 | 19 | * @param \Psr\Http\Message\ResponseInterface $guzzleResponse |
| 20 | 20 | */ |
| 21 | - public function __construct(ResponseInterface $guzzleResponse) |
|
| 22 | - { |
|
| 21 | + public function __construct(ResponseInterface $guzzleResponse) { |
|
| 23 | 22 | $this->contents = unserialize($guzzleResponse->getBody()->getContents()); |
| 24 | 23 | } |
| 25 | 24 | |
@@ -28,8 +27,7 @@ discard block |
||
| 28 | 27 | * |
| 29 | 28 | * @return string |
| 30 | 29 | */ |
| 31 | - public function getStatus() |
|
| 32 | - { |
|
| 30 | + public function getStatus() { |
|
| 33 | 31 | return $this->contents['stat']; |
| 34 | 32 | } |
| 35 | 33 | |
@@ -39,8 +37,7 @@ discard block |
||
| 39 | 37 | * @param string $method |
| 40 | 38 | * @return string |
| 41 | 39 | */ |
| 42 | - public function getContent($method) |
|
| 43 | - { |
|
| 40 | + public function getContent($method) { |
|
| 44 | 41 | return $this->contents[$method]['_content']; |
| 45 | 42 | } |
| 46 | 43 | |
@@ -50,8 +47,7 @@ discard block |
||
| 50 | 47 | * @param string $variable |
| 51 | 48 | * @return mixed |
| 52 | 49 | */ |
| 53 | - public function __get($variable) |
|
| 54 | - { |
|
| 50 | + public function __get($variable) { |
|
| 55 | 51 | return $this->contents[$variable]; |
| 56 | 52 | } |
| 57 | 53 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | public function register() |
| 21 | 21 | { |
| 22 | - $this->app->singleton('flickr', function ($app) { |
|
| 22 | + $this->app->singleton('flickr', function($app) { |
|
| 23 | 23 | $api = new Api(config('services.flickr.key', env('FLICKR_KEY'))); |
| 24 | 24 | |
| 25 | 25 | return new Flickr($api); |
@@ -9,16 +9,14 @@ discard block |
||
| 9 | 9 | /** |
| 10 | 10 | * Perform post-registration booting of services. |
| 11 | 11 | */ |
| 12 | - public function boot() |
|
| 13 | - { |
|
| 12 | + public function boot() { |
|
| 14 | 13 | // |
| 15 | 14 | } |
| 16 | 15 | |
| 17 | 16 | /** |
| 18 | 17 | * Register any package services. |
| 19 | 18 | */ |
| 20 | - public function register() |
|
| 21 | - { |
|
| 19 | + public function register() { |
|
| 22 | 20 | $this->app->singleton('flickr', function ($app) { |
| 23 | 21 | $api = new Api(config('services.flickr.key', env('FLICKR_KEY'))); |
| 24 | 22 | |
@@ -31,8 +29,7 @@ discard block |
||
| 31 | 29 | * |
| 32 | 30 | * @return array |
| 33 | 31 | */ |
| 34 | - public function provides() |
|
| 35 | - { |
|
| 32 | + public function provides() { |
|
| 36 | 33 | return ['flickr']; |
| 37 | 34 | } |
| 38 | 35 | } |