@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | /** |
| 34 | 34 | * @param array $params Here you can provide 'key', 'domain', 'version' to override the default ones. |
| 35 | 35 | */ |
| 36 | - public function __construct(array $params = []) |
|
| 36 | + public function __construct(array $params = [ ]) |
|
| 37 | 37 | { |
| 38 | 38 | $this->key = data_get($params, 'key') ?? config('ghost.admin_key'); |
| 39 | 39 | $this->domain = data_get($params, 'domain') ?? config('ghost.admin_domain'); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | public function create(array $data) |
| 97 | 97 | { |
| 98 | 98 | $response = $this->getHttpClient()->post($this->makeApiUrl(), [ |
| 99 | - $this->resource->getResourceName() => [$data], |
|
| 99 | + $this->resource->getResourceName() => [ $data ], |
|
| 100 | 100 | ]); |
| 101 | 101 | |
| 102 | 102 | return $this->handleResponse($response); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $this->resourceId = $id; |
| 113 | 113 | |
| 114 | 114 | $response = $this->getHttpClient()->put($this->makeApiUrl(), [ |
| 115 | - $this->resource->getResourceName() => [$data], |
|
| 115 | + $this->resource->getResourceName() => [ $data ], |
|
| 116 | 116 | ]); |
| 117 | 117 | |
| 118 | 118 | return $this->handleResponse($response); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * @param array $params Here you can provide 'key', 'domain', 'version' to override the default ones. |
| 19 | 19 | */ |
| 20 | - public function __construct(array $params = []) |
|
| 20 | + public function __construct(array $params = [ ]) |
|
| 21 | 21 | { |
| 22 | 22 | $this->key = data_get($params, 'key') ?? config('ghost.content_key'); |
| 23 | 23 | $this->domain = data_get($params, 'domain') ?? config('ghost.admin_domain'); |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | return $response; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - return data_get($response->data, 0, []); |
|
| 161 | + return data_get($response->data, 0, [ ]); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | return $response; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - return data_get($response->data, 0, []); |
|
| 210 | + return data_get($response->data, 0, [ ]); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /** |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * @param array $params |
| 12 | 12 | * @return ContentApi|\Illuminate\Contracts\Foundation\Application|mixed |
| 13 | 13 | */ |
| 14 | - public function content(array $params = []): ContentApi |
|
| 14 | + public function content(array $params = [ ]): ContentApi |
|
| 15 | 15 | { |
| 16 | 16 | return resolve(ContentApi::class, compact('params')); |
| 17 | 17 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * @param array $params |
| 21 | 21 | * @return AdminApi |
| 22 | 22 | */ |
| 23 | - public function admin(array $params = []): AdminApi |
|
| 23 | + public function admin(array $params = [ ]): AdminApi |
|
| 24 | 24 | { |
| 25 | 25 | return resolve(AdminApi::class, compact('params')); |
| 26 | 26 | } |
@@ -12,9 +12,9 @@ |
||
| 12 | 12 | /** |
| 13 | 13 | * @param array $data |
| 14 | 14 | */ |
| 15 | - public function __construct(array $data = []) |
|
| 15 | + public function __construct(array $data = [ ]) |
|
| 16 | 16 | { |
| 17 | - $this->pagination = (object) $data['pagination']; |
|
| 17 | + $this->pagination = (object) $data[ 'pagination' ]; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | { |
| 29 | 29 | protected string $resourceName = 'users'; |
| 30 | 30 | |
| 31 | - public function __construct(array $data = []) |
|
| 31 | + public function __construct(array $data = [ ]) |
|
| 32 | 32 | { |
| 33 | 33 | parent::__construct($data); |
| 34 | 34 | $this->postsCount = data_get($data, 'count.posts'); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | { |
| 25 | 25 | protected string $resourceName = 'tags'; |
| 26 | 26 | |
| 27 | - public function __construct(array $data = []) |
|
| 27 | + public function __construct(array $data = [ ]) |
|
| 28 | 28 | { |
| 29 | 29 | parent::__construct($data); |
| 30 | 30 | $this->postsCount = data_get($data, 'count.posts'); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | /** |
| 50 | 50 | * @param array $data |
| 51 | 51 | */ |
| 52 | - public function __construct(array $data = []) { |
|
| 52 | + public function __construct(array $data = [ ]) { |
|
| 53 | 53 | if (!empty($data)) { |
| 54 | 54 | $this->fill($data); |
| 55 | 55 | } |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | $property = Str::camel($key); |
| 71 | 71 | |
| 72 | 72 | if (array_key_exists($property, $this->modelCollectionProperties)) { |
| 73 | - $propertyModel = $this->modelCollectionProperties[$property]; |
|
| 73 | + $propertyModel = $this->modelCollectionProperties[ $property ]; |
|
| 74 | 74 | |
| 75 | - $this->{$property} = collect($value)->map(function ($item) use (&$propertyModel) { |
|
| 75 | + $this->{$property} = collect($value)->map(function($item) use (&$propertyModel) { |
|
| 76 | 76 | return new $propertyModel($item); |
| 77 | 77 | }); |
| 78 | 78 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | if (array_key_exists($property, $this->modelProperties)) { |
| 83 | - $propertyModel = $this->modelProperties[$property]; |
|
| 83 | + $propertyModel = $this->modelProperties[ $property ]; |
|
| 84 | 84 | $this->{$property} = !empty($value) ? new $propertyModel($value) : null; |
| 85 | 85 | continue; |
| 86 | 86 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | $this->mergeConfigFrom(__DIR__.'/../config/ghost.php', 'laravel-ghost'); |
| 54 | 54 | |
| 55 | 55 | // Register the main class to use with the facade |
| 56 | - $this->app->singleton('laravel-ghost', function () { |
|
| 56 | + $this->app->singleton('laravel-ghost', function() { |
|
| 57 | 57 | return new Ghost; |
| 58 | 58 | }); |
| 59 | 59 | } |