@@ -77,7 +77,7 @@ |
||
77 | 77 | public function getTagged($tagNames) |
78 | 78 | { |
79 | 79 | return $this->getComponents()->filter( |
80 | - function (ComponentInterface $component) use ($tagNames) { |
|
80 | + function(ComponentInterface $component) use ($tagNames) { |
|
81 | 81 | return is_array($tagNames) ? $component->hasTags($tagNames) : $component->hasTag($tagNames); |
82 | 82 | } |
83 | 83 | ); |
@@ -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 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | protected function setupPaginationForReading() |
25 | 25 | { |
26 | - Paginator::currentPageResolver(function () { |
|
26 | + Paginator::currentPageResolver(function() { |
|
27 | 27 | return Input::get("$this->input_key.page", 1); |
28 | 28 | }); |
29 | 29 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | if (isset($input['page'])) { |
51 | 51 | unset($input['page']); |
52 | 52 | } |
53 | - return str_replace('/?', '?',$paginator->appends($this->input_key, $input)->render()); |
|
53 | + return str_replace('/?', '?', $paginator->appends($this->input_key, $input)->render()); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | public function initialize(Grid $grid) |
@@ -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 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function getVariants() |
34 | 34 | { |
35 | - return array_combine(array_values($this->variants),array_values($this->variants)); |
|
35 | + return array_combine(array_values($this->variants), array_values($this->variants)); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | if ($from_input === null) { |
74 | 74 | return $this->grid->getConfig()->getPageSize(); |
75 | 75 | } else { |
76 | - return (int) $from_input; |
|
76 | + return (int)$from_input; |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 |
@@ -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 | /** |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | $field_names = $this->field_names; |
61 | 61 | $this->fields = $this->grid->getConfig()->getColumns()->filter( |
62 | - function (FieldConfig $field) use ($field_names) { |
|
62 | + function(FieldConfig $field) use ($field_names) { |
|
63 | 63 | return in_array($field->getName(), $field_names); |
64 | 64 | } |
65 | 65 | ); |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | { |
77 | 77 | Event::listen( |
78 | 78 | DataProvider::EVENT_FETCH_ROW, |
79 | - function (DataRow $row, DataProvider $currentProvider) use ($provider) { |
|
79 | + function(DataRow $row, DataProvider $currentProvider) use ($provider) { |
|
80 | 80 | if ($currentProvider !== $provider) return; |
81 | 81 | $this->rows_processed++; |
82 | 82 | foreach ($this->fields as $field) { |
83 | 83 | $name = $field->getName(); |
84 | 84 | $operation = $this->getFieldOperation($name); |
85 | - switch($operation) { |
|
85 | + switch ($operation) { |
|
86 | 86 | |
87 | 87 | case self::OPERATION_SUM: |
88 | 88 | $this->src[$name] += $row->getCellValue($field); |
@@ -217,6 +217,6 @@ discard block |
||
217 | 217 | */ |
218 | 218 | public function getFieldOperation($fieldName) |
219 | 219 | { |
220 | - return isset($this->field_operations[$fieldName])?$this->field_operations[$fieldName]:self::OPERATION_SUM; |
|
220 | + return isset($this->field_operations[$fieldName]) ? $this->field_operations[$fieldName] : self::OPERATION_SUM; |
|
221 | 221 | } |
222 | 222 | } |
@@ -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(); |
@@ -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)); |
@@ -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; |