@@ -4,19 +4,19 @@ |
||
| 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 ?> |
| 19 | - <?= $component->renderComponents('filters_row_column_' . $column->getName()) ?> |
|
| 19 | + <?= $component->renderComponents('filters_row_column_'.$column->getName()) ?> |
|
| 20 | 20 | </td> |
| 21 | 21 | <?php endforeach ?> |
| 22 | 22 | <?= $grid->getInputProcessor()->getSortingHiddenInputsHtml() ?> |
@@ -121,6 +121,6 @@ |
||
| 121 | 121 | |
| 122 | 122 | public function getId() |
| 123 | 123 | { |
| 124 | - return $this->getName() . '-' . $this->getOperator(); |
|
| 124 | + return $this->getName().'-'.$this->getOperator(); |
|
| 125 | 125 | } |
| 126 | 126 | } |
@@ -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,17 +127,17 @@ 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 { |
| 140 | - $s->class = 'Nayjest\Grids\Components\\' . str_replace( |
|
| 140 | + $s->class = 'Nayjest\Grids\Components\\'.str_replace( |
|
| 141 | 141 | ' ', |
| 142 | 142 | '', |
| 143 | 143 | ucwords(str_replace(array('-', '_'), ' ', $type)) |
@@ -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 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | $opening = "<tr><td colspan=\"$colspan\">"; |
| 17 | 17 | $closing = '</td></tr>'; |
| 18 | 18 | return $this->wrapWithOutsideComponents( |
| 19 | - $opening . $this->renderInnerComponents() . $closing |
|
| 19 | + $opening.$this->renderInnerComponents().$closing |
|
| 20 | 20 | ); |
| 21 | 21 | } |
| 22 | 22 | } |
@@ -17,10 +17,10 @@ |
||
| 17 | 17 | { |
| 18 | 18 | $before = ''; |
| 19 | 19 | $after = ''; |
| 20 | - foreach($this->html_tags as $tag) { |
|
| 21 | - $before.="<$tag>"; |
|
| 20 | + foreach ($this->html_tags as $tag) { |
|
| 21 | + $before .= "<$tag>"; |
|
| 22 | 22 | $after = "</$tag>".$after; |
| 23 | 23 | } |
| 24 | - return $before . $this->renderComponents() . $after; |
|
| 24 | + return $before.$this->renderComponents().$after; |
|
| 25 | 25 | } |
| 26 | 26 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | public function getAttributes() |
| 32 | 32 | { |
| 33 | 33 | if (empty($this->attributes['class'])) { |
| 34 | - $this->attributes['class'] = 'column-' . $this->getColumn()->getName(); |
|
| 34 | + $this->attributes['class'] = 'column-'.$this->getColumn()->getName(); |
|
| 35 | 35 | } |
| 36 | 36 | if ($this->column->isHidden()) { |
| 37 | 37 | $this->attributes['style'] = 'display:none;'; |
@@ -47,7 +47,7 @@ discard block |
||
| 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 | /** |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $from_input = $this |
| 85 | 85 | ->grid |
| 86 | 86 | ->getInputProcessor() |
| 87 | - ->getFilterValue($this->name . '_start'); |
|
| 87 | + ->getFilterValue($this->name.'_start'); |
|
| 88 | 88 | if ($from_input === null) { |
| 89 | 89 | return $this->getDefaultStartValue(); |
| 90 | 90 | } else { |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $from_input = $this |
| 99 | 99 | ->grid |
| 100 | 100 | ->getInputProcessor() |
| 101 | - ->getFilterValue($this->name . '_end'); |
|
| 101 | + ->getFilterValue($this->name.'_end'); |
|
| 102 | 102 | if ($from_input === null) { |
| 103 | 103 | return $this->getDefaultEndValue(); |
| 104 | 104 | } else { |
@@ -139,14 +139,14 @@ discard block |
||
| 139 | 139 | 'format' => 'YYYY-MM-DD', |
| 140 | 140 | 'ranges' => [ |
| 141 | 141 | 'previous_month' => [ |
| 142 | - 'Previous month (' . $prev_month->format('F') . ')', |
|
| 142 | + 'Previous month ('.$prev_month->format('F').')', |
|
| 143 | 143 | [ |
| 144 | 144 | $prev_month->startOfMonth()->format('Y-m-d'), |
| 145 | 145 | $prev_month->endOfMonth()->format('Y-m-d'), |
| 146 | 146 | ] |
| 147 | 147 | ], |
| 148 | 148 | 'current_month' => [ |
| 149 | - 'Cur. month (' . date('F'). ')', |
|
| 149 | + 'Cur. month ('.date('F').')', |
|
| 150 | 150 | [ |
| 151 | 151 | $carbon->startOfMonth()->format('Y-m-d'), |
| 152 | 152 | $carbon->endOfMonth()->format('Y-m-d') |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | if (empty($trace['class']) || !$this instanceof $trace['class']) { |
| 99 | 99 | # may be closure |
| 100 | 100 | if (isset($trace['file'], $trace['line'])) { |
| 101 | - $str .= $trace['file'] . $trace['line']; |
|
| 101 | + $str .= $trace['file'].$trace['line']; |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 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 @@ discard block |
||
| 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() |
@@ -95,11 +95,11 @@ discard block |
||
| 95 | 95 | $cookies_str = ''; |
| 96 | 96 | foreach ($_COOKIE as $key => $val) { |
| 97 | 97 | if (strpos($key, $this->getKey()) !== false) { |
| 98 | - $cookies_str .= $key . json_encode($val); |
|
| 98 | + $cookies_str .= $key.json_encode($val); |
|
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - return md5($cookies_str . $this->getKey() . json_encode($this->getInput())); |
|
| 102 | + return md5($cookies_str.$this->getKey().json_encode($this->getInput())); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | public function getUrl(array $new_params = []) |
| 190 | 190 | { |
| 191 | 191 | if (null !== $query_string = $this->getQueryString($new_params)) { |
| 192 | - $query_string = '?' . $query_string; |
|
| 192 | + $query_string = '?'.$query_string; |
|
| 193 | 193 | } |
| 194 | 194 | $request = Request::instance(); |
| 195 | 195 | return $request->getSchemeAndHttpHost() |