@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | * |
| 279 | 279 | * @param $id |
| 280 | 280 | * |
| 281 | - * @return mixed |
|
| 281 | + * @return boolean |
|
| 282 | 282 | */ |
| 283 | 283 | public function destroy($id) |
| 284 | 284 | { |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | /** |
| 318 | 318 | * Store a new record. |
| 319 | 319 | * |
| 320 | - * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\Http\JsonResponse |
|
| 320 | + * @return Response |
|
| 321 | 321 | */ |
| 322 | 322 | public function store() |
| 323 | 323 | { |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | * |
| 397 | 397 | * @param array $data |
| 398 | 398 | * |
| 399 | - * @return mixed |
|
| 399 | + * @return Response|null |
|
| 400 | 400 | */ |
| 401 | 401 | protected function prepare($data = []) |
| 402 | 402 | { |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | /** |
| 855 | 855 | * Set saved callback. |
| 856 | 856 | * |
| 857 | - * @param callable $callback |
|
| 857 | + * @param Closure $callback |
|
| 858 | 858 | * |
| 859 | 859 | * @return void |
| 860 | 860 | */ |
@@ -305,9 +305,9 @@ discard block |
||
| 305 | 305 | $data = $this->model->with($this->getRelations()) |
| 306 | 306 | ->findOrFail($id)->toArray(); |
| 307 | 307 | |
| 308 | - $this->builder->fields()->filter(function ($field) { |
|
| 308 | + $this->builder->fields()->filter(function($field) { |
|
| 309 | 309 | return $field instanceof Field\File; |
| 310 | - })->each(function (File $file) use ($data) { |
|
| 310 | + })->each(function(File $file) use ($data) { |
|
| 311 | 311 | $file->setOriginal($data); |
| 312 | 312 | |
| 313 | 313 | $file->destroy(); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | return $response; |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | - DB::transaction(function () { |
|
| 335 | + DB::transaction(function() { |
|
| 336 | 336 | $inserts = $this->prepareInsert($this->updates); |
| 337 | 337 | |
| 338 | 338 | foreach ($inserts as $column => $value) { |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | return $response; |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | - DB::transaction(function () { |
|
| 530 | + DB::transaction(function() { |
|
| 531 | 531 | $updates = $this->prepareUpdate($this->updates); |
| 532 | 532 | |
| 533 | 533 | foreach ($updates as $column => $value) { |
@@ -907,7 +907,7 @@ discard block |
||
| 907 | 907 | protected function getFieldByColumn($column) |
| 908 | 908 | { |
| 909 | 909 | return $this->builder->fields()->first( |
| 910 | - function (Field $field) use ($column) { |
|
| 910 | + function(Field $field) use ($column) { |
|
| 911 | 911 | if (is_array($field->column())) { |
| 912 | 912 | return in_array($column, $field->column()); |
| 913 | 913 | } |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | |
| 929 | 929 | $values = $this->model->toArray(); |
| 930 | 930 | |
| 931 | - $this->builder->fields()->each(function (Field $field) use ($values) { |
|
| 931 | + $this->builder->fields()->each(function(Field $field) use ($values) { |
|
| 932 | 932 | $field->setOriginal($values); |
| 933 | 933 | }); |
| 934 | 934 | } |
@@ -950,7 +950,7 @@ discard block |
||
| 950 | 950 | |
| 951 | 951 | $data = $this->model->toArray(); |
| 952 | 952 | |
| 953 | - $this->builder->fields()->each(function (Field $field) use ($data) { |
|
| 953 | + $this->builder->fields()->each(function(Field $field) use ($data) { |
|
| 954 | 954 | $field->fill($data); |
| 955 | 955 | }); |
| 956 | 956 | } |
@@ -1067,7 +1067,7 @@ discard block |
||
| 1067 | 1067 | */ |
| 1068 | 1068 | public function setWidth($fieldWidth = 8, $labelWidth = 2) |
| 1069 | 1069 | { |
| 1070 | - $this->builder()->fields()->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
| 1070 | + $this->builder()->fields()->each(function($field) use ($fieldWidth, $labelWidth) { |
|
| 1071 | 1071 | /* @var Field $field */ |
| 1072 | 1072 | $field->setWidth($fieldWidth, $labelWidth); |
| 1073 | 1073 | }); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | /** |
| 133 | 133 | * Returns builder is $mode. |
| 134 | 134 | * |
| 135 | - * @param $mode |
|
| 135 | + * @param string $mode |
|
| 136 | 136 | * |
| 137 | 137 | * @return bool |
| 138 | 138 | */ |
@@ -154,6 +154,7 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
| 157 | + * @param integer $slice |
|
| 157 | 158 | * @return string |
| 158 | 159 | */ |
| 159 | 160 | public function getResource($slice = null) |
@@ -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 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | * |
| 22 | 22 | * @param array|callable|string $options |
| 23 | 23 | * |
| 24 | - * @return $this|mixed |
|
| 24 | + * @return Checkbox |
|
| 25 | 25 | */ |
| 26 | 26 | public function options($options = []) |
| 27 | 27 | { |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | * |
| 29 | 29 | * @param string $target |
| 30 | 30 | * |
| 31 | - * @return mixed |
|
| 31 | + * @return string |
|
| 32 | 32 | */ |
| 33 | 33 | public function callInterventionMethods($target) |
| 34 | 34 | { |
@@ -8,6 +8,9 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | protected $append; |
| 10 | 10 | |
| 11 | + /** |
|
| 12 | + * @param string $string |
|
| 13 | + */ |
|
| 11 | 14 | public function prepend($string) |
| 12 | 15 | { |
| 13 | 16 | if (is_null($this->prepend)) { |
@@ -17,6 +20,9 @@ discard block |
||
| 17 | 20 | return $this; |
| 18 | 21 | } |
| 19 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $string |
|
| 25 | + */ |
|
| 20 | 26 | public function append($string) |
| 21 | 27 | { |
| 22 | 28 | if (is_null($this->append)) { |
@@ -33,6 +39,9 @@ discard block |
||
| 33 | 39 | } |
| 34 | 40 | } |
| 35 | 41 | |
| 42 | + /** |
|
| 43 | + * @param string $attribute |
|
| 44 | + */ |
|
| 36 | 45 | protected function defaultAttribute($attribute, $value) |
| 37 | 46 | { |
| 38 | 47 | if (!array_key_exists($attribute, $this->attributes)) { |
@@ -292,7 +292,7 @@ |
||
| 292 | 292 | /** |
| 293 | 293 | * Get the html and script of template. |
| 294 | 294 | * |
| 295 | - * @return array |
|
| 295 | + * @return string[] |
|
| 296 | 296 | */ |
| 297 | 297 | public function getTemplateHtmlAndScript() |
| 298 | 298 | { |
@@ -173,7 +173,7 @@ |
||
| 173 | 173 | if (array_key_exists($key, $this->original)) { |
| 174 | 174 | $values = $this->original[$key]; |
| 175 | 175 | } |
| 176 | - $this->fields->each(function (Field $field) use ($values) { |
|
| 176 | + $this->fields->each(function(Field $field) use ($values) { |
|
| 177 | 177 | $field->setOriginal($values); |
| 178 | 178 | }); |
| 179 | 179 | } |
@@ -66,6 +66,9 @@ |
||
| 66 | 66 | EOT; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | + /** |
|
| 70 | + * @return string |
|
| 71 | + */ |
|
| 69 | 72 | public function listButton() |
| 70 | 73 | { |
| 71 | 74 | $slice = Str::contains($this->form->getResource(0), '/edit') ? null : -1; |
@@ -133,7 +133,7 @@ |
||
| 133 | 133 | $this->add($this->backButton()); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - return $this->tools->map(function ($tool) { |
|
| 136 | + return $this->tools->map(function($tool) { |
|
| 137 | 137 | if ($tool instanceof Renderable) { |
| 138 | 138 | return $tool->render(); |
| 139 | 139 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | /** |
| 126 | 126 | * Extend column displayer. |
| 127 | 127 | * |
| 128 | - * @param $name |
|
| 128 | + * @param string $name |
|
| 129 | 129 | * @param $displayer |
| 130 | 130 | */ |
| 131 | 131 | public static function extend($name, $displayer) |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | /** |
| 160 | 160 | * Set model for column. |
| 161 | 161 | * |
| 162 | - * @param $model |
|
| 162 | + * @param Model $model |
|
| 163 | 163 | */ |
| 164 | 164 | public function setModel($model) |
| 165 | 165 | { |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | /** |
| 217 | 217 | * Get name of this column. |
| 218 | 218 | * |
| 219 | - * @return mixed |
|
| 219 | + * @return string |
|
| 220 | 220 | */ |
| 221 | 221 | public function getName() |
| 222 | 222 | { |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | /** |
| 227 | 227 | * Format label. |
| 228 | 228 | * |
| 229 | - * @param $label |
|
| 229 | + * @param string $label |
|
| 230 | 230 | * |
| 231 | 231 | * @return mixed |
| 232 | 232 | */ |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | /** |
| 241 | 241 | * Get label of the column. |
| 242 | 242 | * |
| 243 | - * @return mixed |
|
| 243 | + * @return string |
|
| 244 | 244 | */ |
| 245 | 245 | public function getLabel() |
| 246 | 246 | { |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | $grid = $this->grid; |
| 410 | 410 | $column = $this; |
| 411 | 411 | |
| 412 | - $this->display(function ($value) use ($grid, $column, $class) { |
|
| 412 | + $this->display(function($value) use ($grid, $column, $class) { |
|
| 413 | 413 | $definition = new $class($value, $grid, $column, $this); |
| 414 | 414 | |
| 415 | 415 | return $definition->display(); |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | protected function htmlEntityEncode($item) |
| 427 | 427 | { |
| 428 | 428 | if (is_array($item)) { |
| 429 | - array_walk_recursive($item, function (&$value) { |
|
| 429 | + array_walk_recursive($item, function(&$value) { |
|
| 430 | 430 | $value = htmlentities($value); |
| 431 | 431 | }); |
| 432 | 432 | } else { |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | */ |
| 507 | 507 | protected function callSupportDisplayer($abstract, $arguments) |
| 508 | 508 | { |
| 509 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
| 509 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
| 510 | 510 | if (is_array($value) || $value instanceof Arrayable) { |
| 511 | 511 | return call_user_func_array([collect($value), $abstract], $arguments); |
| 512 | 512 | } |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | protected function callBuiltinDisplayer($abstract, $arguments) |
| 531 | 531 | { |
| 532 | 532 | if ($abstract instanceof Closure) { |
| 533 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
| 533 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
| 534 | 534 | return $abstract->call($this, ...array_merge([$value], $arguments)); |
| 535 | 535 | }); |
| 536 | 536 | } |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | $grid = $this->grid; |
| 540 | 540 | $column = $this; |
| 541 | 541 | |
| 542 | - return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { |
|
| 542 | + return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { |
|
| 543 | 543 | $displayer = new $abstract($value, $grid, $column, $this); |
| 544 | 544 | |
| 545 | 545 | return call_user_func_array([$displayer, 'display'], $arguments); |
@@ -108,6 +108,7 @@ |
||
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | 110 | * {@inheritdoc} |
| 111 | + * @param \Closure $callback |
|
| 111 | 112 | */ |
| 112 | 113 | public function display($callback = null) |
| 113 | 114 | { |