| @@ -22,7 +22,7 @@ | ||
| 22 | 22 | <b>Show/Hide all</b> | 
| 23 | 23 | </label> | 
| 24 | 24 | </li> | 
| 25 | - <?php foreach($columns as $column): | |
| 25 | + <?php foreach ($columns as $column): | |
| 26 | 26 | /** @var Nayjest\Grids\FieldConfig $column */ | 
| 27 | 27 | ?> | 
| 28 | 28 | <li> | 
| @@ -25,11 +25,11 @@ discard block | ||
| 25 | 25 | </label> | 
| 26 | 26 | </div> | 
| 27 | 27 | </li> | 
| 28 | - <?php foreach($component->getVariants() as $val => $label): ?> | |
| 29 | - <?php if(is_array($label)):?> | |
| 28 | + <?php foreach ($component->getVariants() as $val => $label): ?> | |
| 29 | + <?php if (is_array($label)):?> | |
| 30 | 30 | <?php | 
| 31 | 31 | $class = ''; | 
| 32 | -                if(array_intersect(array_keys($label['values']), array_keys($value))) { | |
| 32 | +                if (array_intersect(array_keys($label['values']), array_keys($value))) { | |
| 33 | 33 | $class = ' in'; | 
| 34 | 34 | } | 
| 35 | 35 | ?> | 
| @@ -51,12 +51,12 @@ discard block | ||
| 51 | 51 | </label> | 
| 52 | 52 | </div> | 
| 53 | 53 | <?php endif ?> | 
| 54 | - <?php foreach($label['values'] as $option_val=>$option_label):?> | |
| 54 | + <?php foreach ($label['values'] as $option_val=>$option_label):?> | |
| 55 | 55 | <div> | 
| 56 | 56 | <label> | 
| 57 | 57 | <input | 
| 58 | 58 | type="checkbox" | 
| 59 | - <?php if(!empty($value[$option_val])) echo "checked='checked'" ?> | |
| 59 | + <?php if (!empty($value[$option_val])) echo "checked='checked'" ?> | |
| 60 | 60 | name="<?= $component->getInputName() ?>[<?= $option_val ?>]" | 
| 61 | 61 | > | 
| 62 | 62 | <span><?= $option_label ?></span> | 
| @@ -70,7 +70,7 @@ discard block | ||
| 70 | 70 | <label> | 
| 71 | 71 | <input | 
| 72 | 72 | type="checkbox" | 
| 73 | - <?php if(!empty($value[$val])) echo "checked='checked'" ?> | |
| 73 | + <?php if (!empty($value[$val])) echo "checked='checked'" ?> | |
| 74 | 74 | name="<?= $component->getInputName() ?>[<?= $val ?>]" | 
| 75 | 75 | > | 
| 76 | 76 | <span><?= $label ?></span> | 
| @@ -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 | 
| @@ -4,15 +4,15 @@ | ||
| 4 | 4 | * @var Nayjest\Grids\FieldConfig $column | 
| 5 | 5 | */ | 
| 6 | 6 | ?> | 
| 7 | -<?php if($grid->getFiltering()->available()): ?> | |
| 7 | +<?php if ($grid->getFiltering()->available()): ?> | |
| 8 | 8 | <tr> | 
| 9 | - <?php foreach($columns as $column): ?> | |
| 9 | + <?php foreach ($columns as $column): ?> | |
| 10 | 10 | <td | 
| 11 | 11 | class="column-<?= $column->getName() ?>" | 
| 12 | - <?= $column->isHidden()?'style="display:none"':'' ?> | |
| 12 | + <?= $column->isHidden() ? 'style="display:none"' : '' ?> | |
| 13 | 13 | > | 
| 14 | 14 | <?php if ($column->hasFilters()): ?> | 
| 15 | - <?php foreach($column->getFilters() as $filter): ?> | |
| 15 | + <?php foreach ($column->getFilters() as $filter): ?> | |
| 16 | 16 | <?= $grid->getFiltering()->render($filter) ?> | 
| 17 | 17 | <?php endforeach ?> | 
| 18 | 18 | <?php endif ?> | 
| @@ -1,7 +1,7 @@ discard block | ||
| 1 | 1 | <small style="white-space: nowrap"> | 
| 2 | 2 | <a | 
| 3 | 3 | title="Sort ascending" | 
| 4 | - <?php if($column->isSortedAsc()): ?> | |
| 4 | + <?php if ($column->isSortedAsc()): ?> | |
| 5 | 5 | |
| 6 | 6 | class="text-success" | 
| 7 | 7 | <?php else: ?> | 
| @@ -12,7 +12,7 @@ discard block | ||
| 12 | 12 | </a> | 
| 13 | 13 | <a | 
| 14 | 14 | title="Sort descending" | 
| 15 | - <?php if($column->isSortedDesc()): ?> | |
| 15 | + <?php if ($column->isSortedDesc()): ?> | |
| 16 | 16 | class="text-success" | 
| 17 | 17 | <?php else: ?> | 
| 18 | 18 | href="<?= $grid->getSorter()->link($column, 'DESC') ?>" | 
| @@ -3,15 +3,15 @@ | ||
| 3 | 3 | /** @var TotalsRow $component */ | 
| 4 | 4 | ?> | 
| 5 | 5 | <tr> | 
| 6 | - <?php foreach($columns as $column): ?> | |
| 6 | + <?php foreach ($columns as $column): ?> | |
| 7 | 7 | <td | 
| 8 | 8 | class="column-<?= $column->getName() ?>" | 
| 9 | - <?= $column->isHidden()?'style="display:none"':'' ?> | |
| 9 | + <?= $column->isHidden() ? 'style="display:none"' : '' ?> | |
| 10 | 10 | > | 
| 11 | 11 | <?php | 
| 12 | 12 | if ($component->uses($column)): | 
| 13 | 13 | $label = ''; | 
| 14 | -                switch($component->getFieldOperation($column->getName())) { | |
| 14 | +                switch ($component->getFieldOperation($column->getName())) { | |
| 15 | 15 | case \Nayjest\Grids\Components\TotalsRow::OPERATION_SUM: | 
| 16 | 16 | $label = '∑'; | 
| 17 | 17 | break; | 
| @@ -7,6 +7,6 @@ | ||
| 7 | 7 | name="<?= $filter->getInputName() ?>" | 
| 8 | 8 | value="<?= $filter->getValue() ?>" | 
| 9 | 9 | /> | 
| 10 | -<?php if($label): ?> | |
| 10 | +<?php if ($label): ?> | |
| 11 | 11 | <span><?= $label ?></span> | 
| 12 | 12 | <?php endif ?> | 
| @@ -7,7 +7,7 @@ | ||
| 7 | 7 | <?= $grid->header() ? $grid->header()->render() : '' ?> | 
| 8 | 8 | <?php # ========== TABLE BODY ========== ?> | 
| 9 | 9 | <tbody> | 
| 10 | -<?php while($row = $data->getRow()): ?> | |
| 10 | +<?php while ($row = $data->getRow()): ?> | |
| 11 | 11 | <?= $grid->getConfig()->getRowComponent()->setDataRow($row)->render() ?> | 
| 12 | 12 | <?php endwhile; ?> | 
| 13 | 13 | </tbody> | 
| @@ -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 { | 
| @@ -149,7 +149,7 @@ discard block | ||
| 149 | 149 | |
| 150 | 150 |          $blueprint->add(new Rename('component', 'add_component')); | 
| 151 | 151 |          $blueprint->add(new Build('add_component', $blueprint)); | 
| 152 | -        $blueprint->add(new CallMethodWith('add_component','addComponent')); | |
| 152 | +        $blueprint->add(new CallMethodWith('add_component', 'addComponent')); | |
| 153 | 153 | |
| 154 | 154 | return $blueprint; | 
| 155 | 155 | } | 
| @@ -163,8 +163,8 @@ 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) { | |
| 167 | -                switch($type) { | |
| 166 | +            new CustomMapping('type', function($type, Scaffold $s) { | |
| 167 | +                switch ($type) { | |
| 168 | 168 | case 'select': | 
| 169 | 169 | $s->class = 'Nayjest\Grids\SelectFilterConfig'; | 
| 170 | 170 | break; | 
| @@ -172,8 +172,8 @@ discard block | ||
| 172 | 172 | break; | 
| 173 | 173 | } | 
| 174 | 174 | }, null, Instruction::PHASE_PRE_INST), | 
| 175 | - new Rename(0,'name'), | |
| 176 | - new Rename(1,'operator'), | |
| 175 | + new Rename(0, 'name'), | |
| 176 | + new Rename(1, 'operator'), | |
| 177 | 177 | ]); | 
| 178 | 178 | } | 
| 179 | 179 | |
| @@ -192,12 +192,12 @@ discard block | ||
| 192 | 192 | } | 
| 193 | 193 | return new Blueprint(self::COLUMN_CLASS, [ | 
| 194 | 194 |              new SimpleValueAsField('name'), | 
| 195 | - new Rename(0,'name'), | |
| 195 | + new Rename(0, 'name'), | |
| 196 | 196 |              new BuildChildren('filters', $filter_blueprint), | 
| 197 | 197 | |
| 198 | 198 |              new Rename('filter', 'add_filter'), | 
| 199 | 199 |              new Build('add_filter', $filter_blueprint), | 
| 200 | -            new CallMethodWith('add_filter','addFilter'), | |
| 200 | +            new CallMethodWith('add_filter', 'addFilter'), | |
| 201 | 201 | ]); | 
| 202 | 202 | } | 
| 203 | 203 | } |