@@ -15,7 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function register() |
| 17 | 17 | { |
| 18 | - Auth::extend('api', function ($app, $name, array $config) { |
|
| 18 | + Auth::extend('api', function($app, $name, array $config) { |
|
| 19 | 19 | return new ApiGuard(Auth::createUserProvider($config['provider']), $app['request'], $app['config']->get('api-core.api-key')); |
| 20 | 20 | }); |
| 21 | 21 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $rules = $this->rules(); |
| 59 | 59 | if (false === empty(array_diff_key($input, $rules))) { |
| 60 | 60 | $exception = new InvalidFieldException(); |
| 61 | - $exception->statusMessage = $exception->statusMessage.': '.implode(',', array_keys(array_diff_key($input, $rules))); |
|
| 61 | + $exception->statusMessage = $exception->statusMessage . ': ' . implode(',', array_keys(array_diff_key($input, $rules))); |
|
| 62 | 62 | |
| 63 | 63 | throw $exception; |
| 64 | 64 | } |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | /** |
| 73 | 73 | * Remove input fields like _method, _token, etc. |
| 74 | 74 | */ |
| 75 | - $input = array_filter($this->input(), function ($key) { |
|
| 76 | - return ! Str::startsWith($key, '_'); |
|
| 75 | + $input = array_filter($this->input(), function($key) { |
|
| 76 | + return !Str::startsWith($key, '_'); |
|
| 77 | 77 | }, ARRAY_FILTER_USE_KEY); |
| 78 | 78 | |
| 79 | 79 | return $this->getTransformer()->transformInput($input); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | { |
| 115 | 115 | $message = $validator->messages()->first(); |
| 116 | 116 | $exception = new ValidationException(); |
| 117 | - $exception->statusMessage = $exception->statusMessage.': '.$message; |
|
| 117 | + $exception->statusMessage = $exception->statusMessage . ': ' . $message; |
|
| 118 | 118 | $exception->validation = $this->transformValidationOutput($validator); |
| 119 | 119 | |
| 120 | 120 | throw $exception; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | protected function transformValidationOutput($validator): array |
| 155 | 155 | { |
| 156 | 156 | return collect($this->getTransformer()->transformOutputKeys($validator->getMessageBag()->toArray())) |
| 157 | - ->reject(function ($error) { |
|
| 157 | + ->reject(function($error) { |
|
| 158 | 158 | return false === \is_array($error); |
| 159 | 159 | }) |
| 160 | 160 | ->toArray(); |