@@ -83,7 +83,9 @@ |
||
| 83 | 83 | public function prepare() |
| 84 | 84 | { |
| 85 | 85 | $value = $this->getValue(); |
| 86 | - if (!$value || !is_numeric($value)) return; |
|
| 86 | + if (!$value || !is_numeric($value)) { |
|
| 87 | + return; |
|
| 88 | + } |
|
| 87 | 89 | $this->grid->getConfig()->getDataProvider()->setPageSize($value); |
| 88 | 90 | } |
| 89 | 91 | } |
@@ -21,7 +21,9 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function __construct($func = null) |
| 23 | 23 | { |
| 24 | - if ($func) $this->setFunc($func); |
|
| 24 | + if ($func) { |
|
| 25 | + $this->setFunc($func); |
|
| 26 | + } |
|
| 25 | 27 | } |
| 26 | 28 | |
| 27 | 29 | /** |
@@ -77,7 +77,9 @@ |
||
| 77 | 77 | Event::listen( |
| 78 | 78 | DataProvider::EVENT_FETCH_ROW, |
| 79 | 79 | function (DataRow $row, DataProvider $currentProvider) use ($provider) { |
| 80 | - if ($currentProvider !== $provider) return; |
|
| 80 | + if ($currentProvider !== $provider) { |
|
| 81 | + return; |
|
| 82 | + } |
|
| 81 | 83 | $this->rows_processed++; |
| 82 | 84 | foreach ($this->fields as $field) { |
| 83 | 85 | $name = $field->getName(); |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | public function filter($fieldName, $operator, $value) |
| 160 | 160 | { |
| 161 | - switch ($operator) { |
|
| 161 | + switch ($operator) { |
|
| 162 | 162 | case "eq": |
| 163 | 163 | $operator = '='; |
| 164 | 164 | break; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | break; |
| 168 | 168 | case "gt": |
| 169 | 169 | $operator = '>'; |
| 170 | - break; |
|
| 170 | + break; |
|
| 171 | 171 | case "lt": |
| 172 | 172 | $operator = '<'; |
| 173 | 173 | break; |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | break; |
| 130 | 130 | case "gt": |
| 131 | 131 | $operator = '>'; |
| 132 | - break; |
|
| 132 | + break; |
|
| 133 | 133 | case "lt": |
| 134 | 134 | $operator = '<'; |
| 135 | 135 | break; |
@@ -1,7 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** @var Nayjest\Grids\Components\SelectFilter $component */ |
| 3 | 3 | $value = $component->getValue(); |
| 4 | -if (!is_array($value)) $value = []; |
|
| 4 | +if (!is_array($value)) { |
|
| 5 | + $value = []; |
|
| 6 | +} |
|
| 5 | 7 | $id = uniqid() . mt_rand(); |
| 6 | 8 | ?> |
| 7 | 9 | <div class="btn-group"> |
@@ -38,11 +38,11 @@ |
||
| 38 | 38 | |
| 39 | 39 | protected function loadInput() |
| 40 | 40 | { |
| 41 | - if (version_compare(App::version(), '6.0', '>=')) { |
|
| 41 | + if (version_compare(App::version(), '6.0', '>=')) { |
|
| 42 | 42 | $this->input = \Illuminate\Support\Facades\Request::input($this->getKey(), []); |
| 43 | - } else { |
|
| 43 | + } else { |
|
| 44 | 44 | $this->input = \Illuminate\Support\Facades\Input::get($this->getKey(), []); |
| 45 | - } |
|
| 45 | + } |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -24,11 +24,11 @@ |
||
| 24 | 24 | protected function setupPaginationForReading() |
| 25 | 25 | { |
| 26 | 26 | Paginator::currentPageResolver(function () { |
| 27 | - if (version_compare(App::version(), '6.0', '>=')) { |
|
| 27 | + if (version_compare(App::version(), '6.0', '>=')) { |
|
| 28 | 28 | return \Illuminate\Support\Facades\Request::input("$this->input_key.page", 1); |
| 29 | - } else { |
|
| 29 | + } else { |
|
| 30 | 30 | return \Illuminate\Support\Facades\Input::get("$this->input_key.page", 1); |
| 31 | - } |
|
| 31 | + } |
|
| 32 | 32 | }); |
| 33 | 33 | } |
| 34 | 34 | |