@@ -34,8 +34,8 @@ |
||
| 34 | 34 | { |
| 35 | 35 | $modelName = $this->replaceModelName($this->argument('model')); |
| 36 | 36 | $stub = str_replace( |
| 37 | - ['NamespacedDummyModel', 'DummyNamespace', 'DummyModel', 'dummies'], |
|
| 38 | - [$this->repalceModelNamespace($this->argument('model')), $this->getNamespace($name), $modelName, strtolower(Str::plural($modelName))], |
|
| 37 | + [ 'NamespacedDummyModel', 'DummyNamespace', 'DummyModel', 'dummies' ], |
|
| 38 | + [ $this->repalceModelNamespace($this->argument('model')), $this->getNamespace($name), $modelName, strtolower(Str::plural($modelName)) ], |
|
| 39 | 39 | $stub |
| 40 | 40 | ); |
| 41 | 41 | |
@@ -18,8 +18,8 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function rejectNullValues($resource) |
| 20 | 20 | { |
| 21 | - return array_filter($resource, function ($value) { |
|
| 22 | - return ! is_null($value) || ! empty($value); |
|
| 21 | + return array_filter($resource, function($value) { |
|
| 22 | + return !is_null($value) || !empty($value); |
|
| 23 | 23 | }); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -19,13 +19,13 @@ |
||
| 19 | 19 | * @param array $data |
| 20 | 20 | * @return Model |
| 21 | 21 | */ |
| 22 | - public function update(Model $model, array $data = []): ?Model |
|
| 22 | + public function update(Model $model, array $data = [ ]): ?Model |
|
| 23 | 23 | { |
| 24 | - if (! $this->allowUpdating) { |
|
| 24 | + if (!$this->allowUpdating) { |
|
| 25 | 25 | return null; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - return tap($model, function ($model) use ($data) { |
|
| 28 | + return tap($model, function($model) use ($data) { |
|
| 29 | 29 | $model->update(Arr::only($data, $this->getUpdatableColumns())); |
| 30 | 30 | }); |
| 31 | 31 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | public function create(array $data): ?Model |
| 22 | 22 | { |
| 23 | - if (! $this->allowCreation) { |
|
| 23 | + if (!$this->allowCreation) { |
|
| 24 | 24 | return null; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | public function destroy($ids): ?bool |
| 20 | 20 | { |
| 21 | 21 | $ids = (array) $ids; |
| 22 | - if (! $this->allowDeleting) { |
|
| 22 | + if (!$this->allowDeleting) { |
|
| 23 | 23 | return null; |
| 24 | 24 | } |
| 25 | 25 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | static $builder = null; |
| 39 | 39 | |
| 40 | - if (! is_null($builder) && ! app()->environment('testing')) { |
|
| 40 | + if (!is_null($builder) && !app()->environment('testing')) { |
|
| 41 | 41 | return $builder; |
| 42 | 42 | } |
| 43 | 43 | $builder = $this->query()->newQuery(); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | $primaryKey = $this->getModel()->getKeyName(); |
| 54 | 54 | |
| 55 | - return array_filter($columns, function ($column) use ($primaryKey) { |
|
| 55 | + return array_filter($columns, function($column) use ($primaryKey) { |
|
| 56 | 56 | return $primaryKey !== $column; |
| 57 | 57 | }); |
| 58 | 58 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | return $model->getCustomColumnNames(); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - return []; |
|
| 71 | + return [ ]; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * @var mixed |
| 98 | 98 | */ |
| 99 | 99 | static $model = null; |
| 100 | - if (! is_null($model)) { |
|
| 100 | + if (!is_null($model)) { |
|
| 101 | 101 | return $model; |
| 102 | 102 | } |
| 103 | 103 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $request->limit ?? -1 |
| 136 | 136 | )->get(); |
| 137 | 137 | } catch (QueryException $e) { |
| 138 | - return collect([]); |
|
| 138 | + return collect([ ]); |
|
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | protected function hasSearchQuery(Request $request): bool |
| 237 | 237 | { |
| 238 | - return count(array_filter($request->only(['column', 'operator', 'value']))) === 3; |
|
| 238 | + return count(array_filter($request->only([ 'column', 'operator', 'value' ]))) === 3; |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |