@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function initialize(Grid $grid) |
| 60 | 60 | { |
| 61 | 61 | parent::initialize($grid); |
| 62 | - Event::listen(Grid::EVENT_PREPARE, function (Grid $grid) { |
|
| 62 | + Event::listen(Grid::EVENT_PREPARE, function(Grid $grid) { |
|
| 63 | 63 | if ($this->grid !== $grid) { |
| 64 | 64 | return; |
| 65 | 65 | } |
@@ -184,10 +184,10 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | protected function renderExcel() |
| 186 | 186 | { |
| 187 | - $onSheetCreate = function (LaravelExcelWorksheet $sheet) { |
|
| 187 | + $onSheetCreate = function(LaravelExcelWorksheet $sheet) { |
|
| 188 | 188 | $sheet->fromArray($this->getData(), null, 'A1', false, false); |
| 189 | 189 | }; |
| 190 | - $onFileCreate = function (LaravelExcelWriter $excel) use ($onSheetCreate) { |
|
| 190 | + $onFileCreate = function(LaravelExcelWriter $excel) use ($onSheetCreate) { |
|
| 191 | 191 | $excel->sheet($this->getSheetName(), $onSheetCreate); |
| 192 | 192 | }; |
| 193 | 193 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | */ |
| 48 | 48 | public function getName() |
| 49 | 49 | { |
| 50 | - return $this->name ? : 'column_' . $this->column->getName(); |
|
| 50 | + return $this->name ?: 'column_' . $this->column->getName(); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -149,7 +149,7 @@ |
||
| 149 | 149 | */ |
| 150 | 150 | public function getLabel() |
| 151 | 151 | { |
| 152 | - return $this->label ? : ucwords(str_replace(array('-', '_', '.'), ' ', $this->name)); |
|
| 152 | + return $this->label ?: ucwords(str_replace(array('-', '_', '.'), ' ', $this->name)); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | */ |
| 126 | 126 | protected function sortColumns() |
| 127 | 127 | { |
| 128 | - $this->config->getColumns()->sort(function (FieldConfig $a, FieldConfig $b) { |
|
| 128 | + $this->config->getColumns()->sort(function(FieldConfig $a, FieldConfig $b) { |
|
| 129 | 129 | return $a->getOrder() > $b->getOrder(); |
| 130 | 130 | }); |
| 131 | 131 | } |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | */ |
| 68 | 68 | public function getSorting() |
| 69 | 69 | { |
| 70 | - return $_ =& $this->input['sort']; |
|
| 70 | + return $_ = & $this->input['sort']; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | public function getSortingHiddenInputsHtml() |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** @var Nayjest\Grids\Components\Filter $component */ |
| 3 | 3 | ?> |
| 4 | -<?php if($component->getLabel()): ?> |
|
| 4 | +<?php if ($component->getLabel()): ?> |
|
| 5 | 5 | <span><?= $component->getLabel() ?></span> |
| 6 | 6 | <?php endif ?> |
| 7 | 7 | <input |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | /** @var Nayjest\Grids\Components\Filters\DateRangePicker $component */ |
| 3 | 3 | $id = uniqid(); |
| 4 | 4 | ?> |
| 5 | -<?php if($component->getLabel()): ?> |
|
| 5 | +<?php if ($component->getLabel()): ?> |
|
| 6 | 6 | <span> |
| 7 | 7 | <span class="glyphicon glyphicon-calendar"></span> |
| 8 | 8 | <?= $component->getLabel() ?> |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | start.val(picker.startDate.format(options.format)); |
| 37 | 37 | var end = $('[name="<?= $component->getEndInputName() ?>"]') |
| 38 | 38 | end.val(picker.endDate.format(options.format)); |
| 39 | - <?php if($component->isSubmittedOnChange()): ?> |
|
| 39 | + <?php if ($component->isSubmittedOnChange()): ?> |
|
| 40 | 40 | end.get(0).form.submit(); |
| 41 | 41 | <?php endif ?> |
| 42 | 42 | }; |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | class="form-control input-sm" |
| 12 | 12 | name="<?= $filter->getInputName() ?><?= $cfg->isMultipleMode() ? '[]' : '' ?>" |
| 13 | 13 | <?= $onchange ?> |
| 14 | - <?= ($size = $cfg->getSize()) ? 'size="'.$size.'"' : '' ?> |
|
| 14 | + <?= ($size = $cfg->getSize()) ? 'size="' . $size . '"' : '' ?> |
|
| 15 | 15 | <?= ($cfg->isMultipleMode()) ? 'multiple="multiple"' : '' ?> |
| 16 | 16 | > |
| 17 | 17 | <?= (!$cfg->isMultipleMode()) ? '<option value="">--//--</option>' : '' ?> |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | $b = new Blueprint(self::GRID_CLASS, [ |
| 84 | 84 | new BuildDataProvider(), |
| 85 | - new CustomInstruction(function (Scaffold $s) { |
|
| 85 | + new CustomInstruction(function(Scaffold $s) { |
|
| 86 | 86 | /** @var EloquentDataProvider $provider */ |
| 87 | 87 | $provider = $s->getInput('data_provider'); |
| 88 | 88 | $is_eloquent = $provider instanceof EloquentDataProvider; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | { |
| 120 | 120 | $blueprint = new Blueprint(self::COMPONENT_CLASS, [ |
| 121 | 121 | |
| 122 | - new CustomInstruction(function (Scaffold $s) { |
|
| 122 | + new CustomInstruction(function(Scaffold $s) { |
|
| 123 | 123 | if ($s->input instanceof Closure) { |
| 124 | 124 | $s->class = 'Nayjest\Grids\Components\RenderFunc'; |
| 125 | 125 | $s->constructor_arguments = [$s->input]; |
@@ -127,13 +127,13 @@ discard block |
||
| 127 | 127 | } elseif (is_string($s->input)) { |
| 128 | 128 | $s->class = 'Nayjest\Grids\Components\RenderFunc'; |
| 129 | 129 | $out = $s->input; |
| 130 | - $s->constructor_arguments = [function () use ($out) { |
|
| 130 | + $s->constructor_arguments = [function() use ($out) { |
|
| 131 | 131 | return $out; |
| 132 | 132 | }]; |
| 133 | 133 | $s->input = []; |
| 134 | 134 | } |
| 135 | 135 | }, Instruction::PHASE_PRE_INST), |
| 136 | - new CustomMapping('type', function ($type, Scaffold $s) { |
|
| 136 | + new CustomMapping('type', function($type, Scaffold $s) { |
|
| 137 | 137 | if (strpos($type, '\\') !== false) { |
| 138 | 138 | $s->class = $type; |
| 139 | 139 | } else { |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | { |
| 164 | 164 | return new Blueprint(self::FILTER_CLASS, [ |
| 165 | 165 | new SimpleValueAsField('name'), |
| 166 | - new CustomMapping('type', function ($type, Scaffold $s) { |
|
| 166 | + new CustomMapping('type', function($type, Scaffold $s) { |
|
| 167 | 167 | switch ($type) { |
| 168 | 168 | case 'select': |
| 169 | 169 | $s->class = 'Nayjest\Grids\SelectFilterConfig'; |