@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $model = new $model; |
69 | 69 | } |
70 | 70 | |
71 | - if (! ($model instanceof Model)) { |
|
71 | + if (!($model instanceof Model)) { |
|
72 | 72 | throw new \Exception('Model must be an instance of Illuminate\Database\Eloquent\Model'); |
73 | 73 | } |
74 | 74 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function getOptions() |
124 | 124 | { |
125 | - if (! is_null($this->getModel()) and ! is_null($this->getDisplay())) { |
|
125 | + if (!is_null($this->getModel()) and !is_null($this->getDisplay())) { |
|
126 | 126 | $this->loadOptions(); |
127 | 127 | } |
128 | 128 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $parts = explode('.', $name); |
209 | 209 | $fieldName = array_pop($parts); |
210 | 210 | $relationName = implode('.', $parts); |
211 | - $query->whereHas($relationName, function ($q) use ($search, $fieldName) { |
|
211 | + $query->whereHas($relationName, function($q) use ($search, $fieldName) { |
|
212 | 212 | $this->buildQuery($q, $fieldName, $search); |
213 | 213 | }); |
214 | 214 | } |
@@ -118,13 +118,13 @@ discard block |
||
118 | 118 | |
119 | 119 | $name = $column->getName(); |
120 | 120 | |
121 | - if (! empty($from) && ! empty($to)) { |
|
121 | + if (!empty($from) && !empty($to)) { |
|
122 | 122 | $this->setOperator('between'); |
123 | 123 | $search = [$from, $to]; |
124 | - } elseif (! empty($from)) { |
|
124 | + } elseif (!empty($from)) { |
|
125 | 125 | $this->setOperator('greater_or_equal'); |
126 | 126 | $search = $from; |
127 | - } elseif (! empty($to)) { |
|
127 | + } elseif (!empty($to)) { |
|
128 | 128 | $this->setOperator('less_or_equal'); |
129 | 129 | $search = $to; |
130 | 130 | } else { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $parts = explode('.', $name); |
138 | 138 | $fieldName = array_pop($parts); |
139 | 139 | $relationName = implode('.', $parts); |
140 | - $query->whereHas($relationName, function ($q) use ($search, $fieldName) { |
|
140 | + $query->whereHas($relationName, function($q) use ($search, $fieldName) { |
|
141 | 141 | $this->buildQuery($q, $fieldName, $search); |
142 | 142 | }); |
143 | 143 | } |
@@ -60,11 +60,11 @@ |
||
60 | 60 | { |
61 | 61 | $this->content = $content; |
62 | 62 | |
63 | - if (! is_null($label)) { |
|
63 | + if (!is_null($label)) { |
|
64 | 64 | $this->setLabel($label); |
65 | 65 | } |
66 | 66 | |
67 | - if (! is_null($icon)) { |
|
67 | + if (!is_null($icon)) { |
|
68 | 68 | $this->setIcon($icon); |
69 | 69 | } |
70 | 70 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | $router->get('{adminModel}/async/{adminDisplayName?}', [ |
30 | 30 | 'as' => 'admin.model.async', |
31 | - function (ModelConfigurationInterface $model, $name = null) { |
|
31 | + function(ModelConfigurationInterface $model, $name = null) { |
|
32 | 32 | $display = $model->fireDisplay(); |
33 | 33 | if ($display instanceof DisplayTabbed) { |
34 | 34 | $display = static::findDatatablesAsyncByName($display, $name); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | ]); |
44 | 44 | $router->post('{adminModel}/async/{adminDisplayName?}', [ |
45 | 45 | 'as' => 'admin.model.async.inline', |
46 | - function (ModelConfigurationInterface $model, InlineRequest $request) { |
|
46 | + function(ModelConfigurationInterface $model, InlineRequest $request) { |
|
47 | 47 | $field = $request->input('name'); |
48 | 48 | $value = $request->input('value'); |
49 | 49 | $id = $request->input('pk'); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $display = $model->fireDisplay(); |
52 | 52 | |
53 | 53 | /** @var ColumnEditableInterface|null $column */ |
54 | - $column = $display->getColumns()->all()->filter(function ($column) use ($field) { |
|
54 | + $column = $display->getColumns()->all()->filter(function($column) use ($field) { |
|
55 | 55 | return ($column instanceof ColumnEditableInterface) and $field == $column->getName(); |
56 | 56 | })->first(); |
57 | 57 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $totalCount = $query->count(); |
187 | 187 | $filteredCount = 0; |
188 | 188 | |
189 | - if (! is_null($this->distinct)) { |
|
189 | + if (!is_null($this->distinct)) { |
|
190 | 190 | $filteredCount = $query->distinct()->count($this->getDistinct()); |
191 | 191 | } |
192 | 192 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | return; |
235 | 235 | } |
236 | 236 | |
237 | - $query->where(function ($query) use ($search) { |
|
237 | + $query->where(function($query) use ($search) { |
|
238 | 238 | $columns = $this->getColumns()->all(); |
239 | 239 | foreach ($columns as $column) { |
240 | 240 | if (in_array(get_class($column), $this->searchableColumns)) { |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $column = $this->getColumns()->all()->get($index); |
261 | 261 | $columnFilter = array_get($this->getColumnFilters()->all(), $index); |
262 | 262 | |
263 | - if (! is_null($columnFilter) && ! is_null($column)) { |
|
263 | + if (!is_null($columnFilter) && !is_null($column)) { |
|
264 | 264 | $columnFilter->apply($this->repository, $column, $query, $search, $fullSearch); |
265 | 265 | } |
266 | 266 | } |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | public static function registerRoutes(Router $router) |
24 | 24 | { |
25 | 25 | $routeName = 'admin.display.tree.reorder'; |
26 | - if (! $router->has($routeName)) { |
|
27 | - $router->post('{adminModel}/reorder', ['as' => $routeName, function (ModelConfigurationInterface $model) { |
|
26 | + if (!$router->has($routeName)) { |
|
27 | + $router->post('{adminModel}/reorder', ['as' => $routeName, function(ModelConfigurationInterface $model) { |
|
28 | 28 | $display = $model->fireDisplay(); |
29 | 29 | |
30 | 30 | if ($display instanceof DisplayTabbed) { |
31 | - $display->getTabs()->each(function ($tab) { |
|
31 | + $display->getTabs()->each(function($tab) { |
|
32 | 32 | $content = $tab->getContent(); |
33 | 33 | if ($content instanceof self) { |
34 | 34 | $content->getRepository()->reorder( |
@@ -286,11 +286,11 @@ discard block |
||
286 | 286 | */ |
287 | 287 | public function getCollection() |
288 | 288 | { |
289 | - if (! $this->isInitialized()) { |
|
289 | + if (!$this->isInitialized()) { |
|
290 | 290 | throw new \Exception('Display is not initialized'); |
291 | 291 | } |
292 | 292 | |
293 | - if (! is_null($this->collection)) { |
|
293 | + if (!is_null($this->collection)) { |
|
294 | 294 | return $this->collection; |
295 | 295 | } |
296 | 296 | |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | */ |
311 | 311 | protected function modifyQuery(\Illuminate\Database\Eloquent\Builder $query) |
312 | 312 | { |
313 | - $this->extensions->each(function (DisplayExtensionInterface $extension) use ($query) { |
|
313 | + $this->extensions->each(function(DisplayExtensionInterface $extension) use ($query) { |
|
314 | 314 | $extension->modifyQuery($query); |
315 | 315 | }); |
316 | 316 | } |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | { |
324 | 324 | $repository = parent::makeRepository(); |
325 | 325 | |
326 | - if (! ($repository instanceof TreeRepositoryInterface)) { |
|
326 | + if (!($repository instanceof TreeRepositoryInterface)) { |
|
327 | 327 | throw new \Exception('Repository class must be instanced of [TreeRepositoryInterface]'); |
328 | 328 | } |
329 | 329 |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | parent::initialize(); |
73 | 73 | |
74 | 74 | if ($this->getModelConfiguration()->isRestorableModel()) { |
75 | - $this->setApply(function ($q) { |
|
75 | + $this->setApply(function($q) { |
|
76 | 76 | return $q->withTrashed(); |
77 | 77 | }); |
78 | 78 | } |
@@ -183,10 +183,10 @@ discard block |
||
183 | 183 | $params['collection'] = $this->getCollection(); |
184 | 184 | |
185 | 185 | $params['extensions'] = $this->getExtensions() |
186 | - ->filter(function (DisplayExtensionInterface $ext) { |
|
186 | + ->filter(function(DisplayExtensionInterface $ext) { |
|
187 | 187 | return $ext instanceof Renderable; |
188 | 188 | }) |
189 | - ->sortBy(function (DisplayExtensionInterface $extension) { |
|
189 | + ->sortBy(function(DisplayExtensionInterface $extension) { |
|
190 | 190 | return $extension->getOrder(); |
191 | 191 | }); |
192 | 192 | |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function getCollection() |
203 | 203 | { |
204 | - if (! $this->isInitialized()) { |
|
204 | + if (!$this->isInitialized()) { |
|
205 | 205 | throw new \Exception('Display is not initialized'); |
206 | 206 | } |
207 | 207 | |
208 | - if (! is_null($this->collection)) { |
|
208 | + if (!is_null($this->collection)) { |
|
209 | 209 | return $this->collection; |
210 | 210 | } |
211 | 211 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | $columns = $this->getColumns()->all(); |
232 | 232 | |
233 | - if (! is_int(key($orders))) { |
|
233 | + if (!is_int(key($orders))) { |
|
234 | 234 | $orders = [$orders]; |
235 | 235 | } |
236 | 236 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $columnIndex = array_get($order, 'column'); |
239 | 239 | $direction = array_get($order, 'dir', 'asc'); |
240 | 240 | |
241 | - if (! $columnIndex && $columnIndex !== '0') { |
|
241 | + if (!$columnIndex && $columnIndex !== '0') { |
|
242 | 242 | continue; |
243 | 243 | } |
244 | 244 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | */ |
256 | 256 | protected function modifyQuery(\Illuminate\Database\Eloquent\Builder $query) |
257 | 257 | { |
258 | - $this->extensions->each(function (DisplayExtensionInterface $extension) use ($query) { |
|
258 | + $this->extensions->each(function(DisplayExtensionInterface $extension) use ($query) { |
|
259 | 259 | $extension->modifyQuery($query); |
260 | 260 | }); |
261 | 261 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function set($columnFilters) |
36 | 36 | { |
37 | - if (! is_array($columnFilters)) { |
|
37 | + if (!is_array($columnFilters)) { |
|
38 | 38 | $columnFilters = func_get_args(); |
39 | 39 | } |
40 | 40 | |
@@ -156,12 +156,12 @@ discard block |
||
156 | 156 | } |
157 | 157 | } |
158 | 158 | |
159 | - if (! in_array($this->getPlacement(), ['table.footer', 'table.header']) && $this->view == 'display.extensions.columns_filters_table') { |
|
159 | + if (!in_array($this->getPlacement(), ['table.footer', 'table.header']) && $this->view == 'display.extensions.columns_filters_table') { |
|
160 | 160 | $this->view = 'display.extensions.columns_filters'; |
161 | 161 | $this->setHtmlAttribute('class', 'table table-default'); |
162 | 162 | } |
163 | 163 | |
164 | - if (! $this->hasHtmlAttribute('class')) { |
|
164 | + if (!$this->hasHtmlAttribute('class')) { |
|
165 | 165 | $this->setHtmlAttribute('class', 'panel-footer'); |
166 | 166 | } |
167 | 167 | } |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | $this->controlActive = false; |
89 | 89 | |
90 | 90 | if ($this->isInitialize()) { |
91 | - $this->columns = $this->columns->filter(function ($column) { |
|
91 | + $this->columns = $this->columns->filter(function($column) { |
|
92 | 92 | $class = get_class($this->getControlColumn()); |
93 | 93 | |
94 | - return ! ($column instanceof $class); |
|
94 | + return !($column instanceof $class); |
|
95 | 95 | }); |
96 | 96 | } |
97 | 97 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function set($columns) |
115 | 115 | { |
116 | - if (! is_array($columns)) { |
|
116 | + if (!is_array($columns)) { |
|
117 | 117 | $columns = func_get_args(); |
118 | 118 | } |
119 | 119 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | public function initialize() |
181 | 181 | { |
182 | - $this->all()->each(function (ColumnInterface $column) { |
|
182 | + $this->all()->each(function(ColumnInterface $column) { |
|
183 | 183 | $column->initialize(); |
184 | 184 | }); |
185 | 185 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public function set($applies) |
28 | 28 | { |
29 | - if (! is_array($applies)) { |
|
29 | + if (!is_array($applies)) { |
|
30 | 30 | $applies = func_get_args(); |
31 | 31 | } |
32 | 32 |