@@ -27,7 +27,7 @@ |
||
| 27 | 27 | } else { |
| 28 | 28 | try { |
| 29 | 29 | return $this->src->{$fieldName}; |
| 30 | - } catch(Exception $e) { |
|
| 30 | + } catch (Exception $e) { |
|
| 31 | 31 | throw new RuntimeException( |
| 32 | 32 | "Can't read '$fieldName' property from DataRow" |
| 33 | 33 | ); |
@@ -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 |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | { |
| 47 | 47 | $row = $this->getDataRow(); |
| 48 | 48 | $out = ''; |
| 49 | - foreach($this->grid->getConfig()->getColumns() as $column) { |
|
| 49 | + foreach ($this->grid->getConfig()->getColumns() as $column) { |
|
| 50 | 50 | $component = new TableCell($column); |
| 51 | 51 | $component->initialize($this->grid); |
| 52 | 52 | $component->setContent($column->getValue($row)); |
@@ -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>' : '' ?> |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * Constructor. |
| 20 | 20 | * |
| 21 | - * @param Builder $src |
|
| 21 | + * @param Collection $src |
|
| 22 | 22 | */ |
| 23 | 23 | public function __construct(Collection $src) |
| 24 | 24 | { |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Illuminate\Database\Eloquent\Builder; |
| 5 | 5 | use Event; |
| 6 | -use Illuminate\Foundation\Application; |
|
| 7 | 6 | use Illuminate\Support\Collection; |
| 8 | 7 | |
| 9 | 8 | class CollectionDataProvider extends DataProvider |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | if(!$this->iterator) |
| 80 | 80 | { |
| 81 | - $this->getIterator(); |
|
| 81 | + $this->getIterator(); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | if ($this->index < $this->count()) { |
@@ -107,10 +107,10 @@ discard block |
||
| 107 | 107 | public function orderBy($fieldName, $direction) |
| 108 | 108 | { |
| 109 | 109 | if($direction === Grid::SORT_ASC){ |
| 110 | - $this->src->sortBy($fieldName); |
|
| 110 | + $this->src->sortBy($fieldName); |
|
| 111 | 111 | } |
| 112 | 112 | else{ |
| 113 | - $this->src->sortByDesc($fieldName); |
|
| 113 | + $this->src->sortByDesc($fieldName); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | return $this; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function getPaginationFactory() |
| 57 | 57 | { |
| 58 | - return $this->getPaginator();//$this->src->getQuery()->getConnection()->getPaginator(); |
|
| 58 | + return $this->getPaginator(); //$this->src->getQuery()->getConnection()->getPaginator(); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | protected function getIterator() |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | public function getRow() |
| 78 | 78 | { |
| 79 | - if(!$this->iterator) |
|
| 79 | + if (!$this->iterator) |
|
| 80 | 80 | { |
| 81 | 81 | $this->getIterator(); |
| 82 | 82 | } |
@@ -106,10 +106,10 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function orderBy($fieldName, $direction) |
| 108 | 108 | { |
| 109 | - if($direction === Grid::SORT_ASC){ |
|
| 109 | + if ($direction === Grid::SORT_ASC) { |
|
| 110 | 110 | $this->src->sortBy($fieldName); |
| 111 | 111 | } |
| 112 | - else{ |
|
| 112 | + else { |
|
| 113 | 113 | $this->src->sortByDesc($fieldName); |
| 114 | 114 | } |
| 115 | 115 | |
@@ -108,8 +108,7 @@ |
||
| 108 | 108 | { |
| 109 | 109 | if($direction === Grid::SORT_ASC){ |
| 110 | 110 | $this->src->sortBy($fieldName); |
| 111 | - } |
|
| 112 | - else{ |
|
| 111 | + } else{ |
|
| 113 | 112 | $this->src->sortByDesc($fieldName); |
| 114 | 113 | } |
| 115 | 114 | |