@@ -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 | { |
@@ -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 | } |
@@ -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 | { |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | $grid = $this->grid; |
411 | 411 | $column = $this; |
412 | 412 | |
413 | - $this->display(function ($value) use ($grid, $column, $class) { |
|
413 | + $this->display(function($value) use ($grid, $column, $class) { |
|
414 | 414 | $definition = new $class($value, $grid, $column, $this); |
415 | 415 | |
416 | 416 | return $definition->display(); |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | protected function htmlEntityEncode($item) |
428 | 428 | { |
429 | 429 | if (is_array($item)) { |
430 | - array_walk_recursive($item, function (&$value) { |
|
430 | + array_walk_recursive($item, function(&$value) { |
|
431 | 431 | $value = htmlentities($value); |
432 | 432 | }); |
433 | 433 | } else { |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | */ |
508 | 508 | protected function callSupportDisplayer($abstract, $arguments) |
509 | 509 | { |
510 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
510 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
511 | 511 | if (is_array($value) || $value instanceof Arrayable) { |
512 | 512 | return call_user_func_array([collect($value), $abstract], $arguments); |
513 | 513 | } |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | protected function callBuiltinDisplayer($abstract, $arguments) |
532 | 532 | { |
533 | 533 | if ($abstract instanceof Closure) { |
534 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
534 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
535 | 535 | return $abstract->call($this, ...array_merge([$value], $arguments)); |
536 | 536 | }); |
537 | 537 | } |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | $grid = $this->grid; |
541 | 541 | $column = $this; |
542 | 542 | |
543 | - return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { |
|
543 | + return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { |
|
544 | 544 | $displayer = new $abstract($value, $grid, $column, $this); |
545 | 545 | |
546 | 546 | return call_user_func_array([$displayer, 'display'], $arguments); |
@@ -551,14 +551,14 @@ discard block |
||
551 | 551 | } |
552 | 552 | public function setLabel($label) |
553 | 553 | { |
554 | - $trans_key = 'validation.attributes.' . $label; |
|
554 | + $trans_key = 'validation.attributes.'.$label; |
|
555 | 555 | $trans_key_low = strtolower($trans_key); |
556 | 556 | if (Lang::has($trans_key)) { |
557 | 557 | $label = Lang::get($trans_key); |
558 | 558 | } |
559 | 559 | if (Lang::has($trans_key_low)) { |
560 | 560 | $label = Lang::get($trans_key_low); |
561 | - }else { |
|
561 | + } else { |
|
562 | 562 | $label = ucfirst($label); |
563 | 563 | } |
564 | 564 | return $label; |
@@ -558,7 +558,7 @@ |
||
558 | 558 | } |
559 | 559 | if (Lang::has($trans_key_low)) { |
560 | 560 | $label = Lang::get($trans_key_low); |
561 | - }else { |
|
561 | + } else { |
|
562 | 562 | $label = ucfirst($label); |
563 | 563 | } |
564 | 564 | return $label; |
@@ -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 | { |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | |
224 | 224 | protected function editAction() |
225 | 225 | { |
226 | - $_edit = trans('admin.edit'); |
|
226 | + $_edit = trans('admin.edit'); |
|
227 | 227 | return <<<EOT |
228 | 228 | <a class="btn btn-xs btn-default" href="{$this->getResource()}/{$this->getKey()}/edit"> |
229 | 229 | <i class="fa fa-edit"></i> $_edit |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | protected function deleteAction() |
236 | 236 | { |
237 | 237 | $this->___deleteAction(); |
238 | - $_delete = trans('admin.delete'); |
|
238 | + $_delete = trans('admin.delete'); |
|
239 | 239 | return <<<EOT |
240 | 240 | <a href="javascript:void(0);" data-id="{$this->getKey()}" class="grid-row-delete btn btn-xs btn-danger"> |
241 | 241 | <i class="fa fa-trash"></i> $_delete |
@@ -229,7 +229,7 @@ |
||
229 | 229 | /** |
230 | 230 | * Get options for Select field in form. |
231 | 231 | * |
232 | - * @return \Illuminate\Support\Collection |
|
232 | + * @return callable |
|
233 | 233 | */ |
234 | 234 | public static function selectOptions() |
235 | 235 | { |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | { |
197 | 197 | static::$branchOrder = array_flip(array_flatten($order)); |
198 | 198 | |
199 | - static::$branchOrder = array_map(function ($item) { |
|
199 | + static::$branchOrder = array_map(function($item) { |
|
200 | 200 | return ++$item; |
201 | 201 | }, static::$branchOrder); |
202 | 202 | } |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | { |
291 | 291 | parent::boot(); |
292 | 292 | |
293 | - static::saving(function (Model $branch) { |
|
293 | + static::saving(function(Model $branch) { |
|
294 | 294 | $parentColumn = $branch->getParentColumn(); |
295 | 295 | |
296 | 296 | if (Request::has($parentColumn) && Request::input($parentColumn) == $branch->getKey()) { |
@@ -282,7 +282,6 @@ |
||
282 | 282 | /** |
283 | 283 | * Return all items of the tree. |
284 | 284 | * |
285 | - * @param array $items |
|
286 | 285 | */ |
287 | 286 | public function getItems() |
288 | 287 | { |
@@ -103,7 +103,7 @@ |
||
103 | 103 | protected function initBranchCallback() |
104 | 104 | { |
105 | 105 | if (is_null($this->branchCallback)) { |
106 | - $this->branchCallback = function ($branch) { |
|
106 | + $this->branchCallback = function($branch) { |
|
107 | 107 | $key = $branch[$this->model->getKeyName()]; |
108 | 108 | $title = $branch[$this->model->getTitleColumn()]; |
109 | 109 |
@@ -26,7 +26,6 @@ |
||
26 | 26 | /** |
27 | 27 | * Create a new Tools instance. |
28 | 28 | * |
29 | - * @param Builder $builder |
|
30 | 29 | */ |
31 | 30 | public function __construct(Tree $tree) |
32 | 31 | { |
@@ -55,7 +55,7 @@ |
||
55 | 55 | */ |
56 | 56 | public function render() |
57 | 57 | { |
58 | - return $this->tools->map(function ($tool) { |
|
58 | + return $this->tools->map(function($tool) { |
|
59 | 59 | if ($tool instanceof Renderable) { |
60 | 60 | return $tool->render(); |
61 | 61 | } |
@@ -115,7 +115,7 @@ |
||
115 | 115 | { |
116 | 116 | $inputs = array_dot(Input::all()); |
117 | 117 | |
118 | - $inputs = array_filter($inputs, function ($input) { |
|
118 | + $inputs = array_filter($inputs, function($input) { |
|
119 | 119 | return $input !== '' && !is_null($input); |
120 | 120 | }); |
121 | 121 |
@@ -67,7 +67,7 @@ |
||
67 | 67 | { |
68 | 68 | Admin::script($this->script()); |
69 | 69 | |
70 | - $options = $this->getOptions()->map(function ($option) { |
|
70 | + $options = $this->getOptions()->map(function($option) { |
|
71 | 71 | $selected = ($option == $this->perPage) ? 'selected' : ''; |
72 | 72 | $url = app('request')->fullUrlWithQuery([$this->perPageName => $option]); |
73 | 73 |