@@ -55,7 +55,7 @@ |
||
| 55 | 55 | /** |
| 56 | 56 | * Returns builder is $mode. |
| 57 | 57 | * |
| 58 | - * @param $mode |
|
| 58 | + * @param string $mode |
|
| 59 | 59 | * |
| 60 | 60 | * @return bool |
| 61 | 61 | */ |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | */ |
| 250 | 250 | public function field($name) |
| 251 | 251 | { |
| 252 | - return $this->fields()->first(function (Field $field) use ($name) { |
|
| 252 | + return $this->fields()->first(function(Field $field) use ($name) { |
|
| 253 | 253 | return $field->column() == $name; |
| 254 | 254 | }); |
| 255 | 255 | } |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | $this->form->model()->getUpdatedAtColumn(), |
| 491 | 491 | ]; |
| 492 | 492 | |
| 493 | - $this->fields = $this->fields()->reject(function (Field $field) use ($reservedColumns) { |
|
| 493 | + $this->fields = $this->fields()->reject(function(Field $field) use ($reservedColumns) { |
|
| 494 | 494 | return in_array($field->column(), $reservedColumns); |
| 495 | 495 | }); |
| 496 | 496 | } |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | |
| 55 | 55 | $this->value = array_get($inputs, $this->column); |
| 56 | 56 | |
| 57 | - $value = array_filter($this->value, function ($val) { |
|
| 57 | + $value = array_filter($this->value, function($val) { |
|
| 58 | 58 | return $val !== ''; |
| 59 | 59 | }); |
| 60 | 60 | |
@@ -158,7 +158,7 @@ |
||
| 158 | 158 | |
| 159 | 159 | list($relation, $args[0]) = explode('.', $this->column); |
| 160 | 160 | |
| 161 | - return ['whereHas' => [$relation, function ($relation) use ($args) { |
|
| 161 | + return ['whereHas' => [$relation, function($relation) use ($args) { |
|
| 162 | 162 | call_user_func_array([$relation, $this->query], $args); |
| 163 | 163 | }]]; |
| 164 | 164 | } |
@@ -331,7 +331,7 @@ |
||
| 331 | 331 | * |
| 332 | 332 | * @param Presenter $presenter |
| 333 | 333 | * |
| 334 | - * @return mixed |
|
| 334 | + * @return Presenter |
|
| 335 | 335 | */ |
| 336 | 336 | protected function setPresenter(Presenter $presenter) |
| 337 | 337 | { |
@@ -134,7 +134,7 @@ |
||
| 134 | 134 | public function style($style) |
| 135 | 135 | { |
| 136 | 136 | if (is_array($style)) { |
| 137 | - $style = implode('', array_map(function ($key, $val) { |
|
| 137 | + $style = implode('', array_map(function($key, $val) { |
|
| 138 | 138 | return "$key:$val"; |
| 139 | 139 | }, array_keys($style), array_values($style))); |
| 140 | 140 | } |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | return $this->style([$styles]); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - $styles = array_map(function ($style) { |
|
| 67 | + $styles = array_map(function($style) { |
|
| 68 | 68 | return 'box-'.$style; |
| 69 | 69 | }, $styles); |
| 70 | 70 | |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | * |
| 13 | 13 | * @param $permission |
| 14 | 14 | * |
| 15 | - * @return true |
|
| 15 | + * @return boolean|null |
|
| 16 | 16 | */ |
| 17 | 17 | public static function check($permission) |
| 18 | 18 | { |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * |
| 31 | 31 | * @param $roles |
| 32 | 32 | * |
| 33 | - * @return true |
|
| 33 | + * @return boolean|null |
|
| 34 | 34 | */ |
| 35 | 35 | public static function allow($roles) |
| 36 | 36 | { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * |
| 49 | 49 | * @param $roles |
| 50 | 50 | * |
| 51 | - * @return true |
|
| 51 | + * @return boolean|null |
|
| 52 | 52 | */ |
| 53 | 53 | public static function deny($roles) |
| 54 | 54 | { |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | if (is_array($permission)) { |
| 25 | - collect($permission)->each(function ($permission) { |
|
| 25 | + collect($permission)->each(function($permission) { |
|
| 26 | 26 | call_user_func([Permission::class, 'check'], $permission); |
| 27 | 27 | }); |
| 28 | 28 | |
@@ -117,7 +117,7 @@ |
||
| 117 | 117 | /** |
| 118 | 118 | * Add form attributes. |
| 119 | 119 | * |
| 120 | - * @param string|array $attr |
|
| 120 | + * @param string $attr |
|
| 121 | 121 | * @param string $value |
| 122 | 122 | * |
| 123 | 123 | * @return $this |
@@ -162,7 +162,7 @@ |
||
| 162 | 162 | */ |
| 163 | 163 | public function setWidth($fieldWidth = 8, $labelWidth = 2) |
| 164 | 164 | { |
| 165 | - collect($this->fields)->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
| 165 | + collect($this->fields)->each(function($field) use ($fieldWidth, $labelWidth) { |
|
| 166 | 166 | /* @var Field $field */ |
| 167 | 167 | $field->setWidth($fieldWidth, $labelWidth); |
| 168 | 168 | }); |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | /** |
| 241 | 241 | * Resolve perPage for pagination. |
| 242 | 242 | * |
| 243 | - * @param array|null $paginate |
|
| 243 | + * @param Model $paginate |
|
| 244 | 244 | * |
| 245 | 245 | * @return array |
| 246 | 246 | */ |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | /** |
| 263 | 263 | * Find query by method name. |
| 264 | 264 | * |
| 265 | - * @param $method |
|
| 265 | + * @param string $method |
|
| 266 | 266 | * |
| 267 | 267 | * @return static |
| 268 | 268 | */ |
@@ -311,9 +311,9 @@ discard block |
||
| 311 | 311 | |
| 312 | 312 | $this->setSort(); |
| 313 | 313 | |
| 314 | - $this->queries->reject(function ($query) { |
|
| 314 | + $this->queries->reject(function($query) { |
|
| 315 | 315 | return $query['method'] == 'paginate'; |
| 316 | - })->each(function ($query) { |
|
| 316 | + })->each(function($query) { |
|
| 317 | 317 | $this->model = $this->model->{$query['method']}(...$query['arguments']); |
| 318 | 318 | }); |
| 319 | 319 | |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | $this->setSort(); |
| 365 | 365 | $this->setPaginate(); |
| 366 | 366 | |
| 367 | - $this->queries->unique()->each(function ($query) { |
|
| 367 | + $this->queries->unique()->each(function($query) { |
|
| 368 | 368 | $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']); |
| 369 | 369 | }); |
| 370 | 370 | |
@@ -394,9 +394,9 @@ discard block |
||
| 394 | 394 | |
| 395 | 395 | $queryBuilder = $this->originalModel; |
| 396 | 396 | |
| 397 | - $this->queries->reject(function ($query) { |
|
| 397 | + $this->queries->reject(function($query) { |
|
| 398 | 398 | return in_array($query['method'], ['get', 'paginate']); |
| 399 | - })->each(function ($query) use (&$queryBuilder) { |
|
| 399 | + })->each(function($query) use (&$queryBuilder) { |
|
| 400 | 400 | $queryBuilder = $queryBuilder->{$query['method']}(...$query['arguments']); |
| 401 | 401 | }); |
| 402 | 402 | |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | { |
| 431 | 431 | $paginate = $this->findQueryByMethod('paginate'); |
| 432 | 432 | |
| 433 | - $this->queries = $this->queries->reject(function ($query) { |
|
| 433 | + $this->queries = $this->queries->reject(function($query) { |
|
| 434 | 434 | return $query['method'] == 'paginate'; |
| 435 | 435 | }); |
| 436 | 436 | |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | */ |
| 489 | 489 | protected function findQueryByMethod($method) |
| 490 | 490 | { |
| 491 | - return $this->queries->first(function ($query) use ($method) { |
|
| 491 | + return $this->queries->first(function($query) use ($method) { |
|
| 492 | 492 | return $query['method'] == $method; |
| 493 | 493 | }); |
| 494 | 494 | } |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | { |
| 533 | 533 | list($relationName, $relationColumn) = explode('.', $column); |
| 534 | 534 | |
| 535 | - if ($this->queries->contains(function ($query) use ($relationName) { |
|
| 535 | + if ($this->queries->contains(function($query) use ($relationName) { |
|
| 536 | 536 | return $query['method'] == 'with' && in_array($relationName, $query['arguments']); |
| 537 | 537 | })) { |
| 538 | 538 | $relation = $this->model->$relationName(); |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | */ |
| 562 | 562 | public function resetOrderBy() |
| 563 | 563 | { |
| 564 | - $this->queries = $this->queries->reject(function ($query) { |
|
| 564 | + $this->queries = $this->queries->reject(function($query) { |
|
| 565 | 565 | return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc'; |
| 566 | 566 | }); |
| 567 | 567 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | /** |
| 26 | 26 | * Execute the console command. |
| 27 | 27 | * |
| 28 | - * @return void |
|
| 28 | + * @return false|null |
|
| 29 | 29 | */ |
| 30 | 30 | public function handle() |
| 31 | 31 | { |