@@ -55,11 +55,11 @@ discard block |
||
55 | 55 | { |
56 | 56 | $this->content = $content; |
57 | 57 | |
58 | - if (! is_null($label)) { |
|
58 | + if (!is_null($label)) { |
|
59 | 59 | $this->setLabel($label); |
60 | 60 | } |
61 | 61 | |
62 | - if (! is_null($icon)) { |
|
62 | + if (!is_null($icon)) { |
|
63 | 63 | $this->setIcon($icon); |
64 | 64 | } |
65 | 65 | } |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | return $this->getContent()->getValidationRules(); |
308 | 308 | } |
309 | 309 | |
310 | - return []; |
|
310 | + return [ ]; |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | return $this->getContent()->getValidationMessages(); |
320 | 320 | } |
321 | 321 | |
322 | - return []; |
|
322 | + return [ ]; |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | return $this->getContent()->getValidationLabels(); |
332 | 332 | } |
333 | 333 | |
334 | - return []; |
|
334 | + return [ ]; |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | /** |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * @var array |
52 | 52 | */ |
53 | - protected $with = []; |
|
53 | + protected $with = [ ]; |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @var string |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $this->repository = $this->makeRepository(); |
168 | 168 | $this->repository->with($this->with); |
169 | 169 | |
170 | - $this->extensions->each(function (DisplayExtensionInterface $extension) { |
|
170 | + $this->extensions->each(function(DisplayExtensionInterface $extension) { |
|
171 | 171 | if ($extension instanceof Initializable) { |
172 | 172 | $extension->initialize(); |
173 | 173 | } |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | $this->title, |
202 | 202 | ]; |
203 | 203 | |
204 | - $this->getExtensions()->each(function (DisplayExtensionInterface $extension) use (&$titles) { |
|
204 | + $this->getExtensions()->each(function(DisplayExtensionInterface $extension) use (&$titles) { |
|
205 | 205 | if (method_exists($extension, $method = 'getTitle')) { |
206 | - $titles[] = call_user_func([$extension, $method]); |
|
206 | + $titles[ ] = call_user_func([ $extension, $method ]); |
|
207 | 207 | } |
208 | 208 | }); |
209 | 209 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | })->each(function($extension) use($view) { |
271 | 271 | $html = app('sleeping_owl.template')->view($extension->getView(), $extension->toArray())->render(); |
272 | 272 | |
273 | - if (! empty($html)) { |
|
273 | + if (!empty($html)) { |
|
274 | 274 | $factory = $view->getFactory(); |
275 | 275 | |
276 | 276 | $factory->startSection($extension->getPlacement()); |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $extension = $this->extensions->get($method); |
307 | 307 | |
308 | 308 | if (method_exists($extension, 'set')) { |
309 | - return call_user_func_array([$extension, 'set'], $arguments); |
|
309 | + return call_user_func_array([ $extension, 'set' ], $arguments); |
|
310 | 310 | } |
311 | 311 | } |
312 | 312 | |
@@ -327,9 +327,9 @@ discard block |
||
327 | 327 | */ |
328 | 328 | protected function makeRepository() |
329 | 329 | { |
330 | - $repository = app($this->repositoryClass, [$this->modelClass]); |
|
330 | + $repository = app($this->repositoryClass, [ $this->modelClass ]); |
|
331 | 331 | |
332 | - if (! ($repository instanceof RepositoryInterface)) { |
|
332 | + if (!($repository instanceof RepositoryInterface)) { |
|
333 | 333 | throw new \Exception('Repository class must be instanced of [RepositoryInterface]'); |
334 | 334 | } |
335 | 335 |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public static function registerRoutes(Router $router) |
27 | 27 | { |
28 | - $router->get('{adminModel}/async/{adminDisplayName?}', ['as' => 'admin.model.async', |
|
29 | - function (ModelConfigurationInterface $model, $name = null) { |
|
28 | + $router->get('{adminModel}/async/{adminDisplayName?}', [ 'as' => 'admin.model.async', |
|
29 | + function(ModelConfigurationInterface $model, $name = null) { |
|
30 | 30 | $display = $model->fireDisplay(); |
31 | 31 | if ($display instanceof DisplayTabbed) { |
32 | 32 | $display = static::findDatatablesAsyncByName($display, $name); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $totalCount = $query->count(); |
160 | 160 | $filteredCount = 0; |
161 | 161 | |
162 | - if (! is_null($this->distinct)) { |
|
162 | + if (!is_null($this->distinct)) { |
|
163 | 163 | $filteredCount = $query->distinct()->count($this->getDistinct()); |
164 | 164 | } |
165 | 165 | |
@@ -202,11 +202,11 @@ discard block |
||
202 | 202 | */ |
203 | 203 | protected function applyOrders($query) |
204 | 204 | { |
205 | - $orders = Request::input('order', []); |
|
205 | + $orders = Request::input('order', [ ]); |
|
206 | 206 | |
207 | 207 | foreach ($orders as $order) { |
208 | - $columnIndex = $order['column']; |
|
209 | - $orderDirection = $order['dir']; |
|
208 | + $columnIndex = $order[ 'column' ]; |
|
209 | + $orderDirection = $order[ 'dir' ]; |
|
210 | 210 | $column = $this->getColumns()->all()->get($columnIndex); |
211 | 211 | |
212 | 212 | if ($column instanceof NamedColumn && $column->isOrderable()) { |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | return; |
232 | 232 | } |
233 | 233 | |
234 | - $query->where(function ($query) use ($search) { |
|
234 | + $query->where(function($query) use ($search) { |
|
235 | 235 | $columns = $this->getColumns()->all(); |
236 | 236 | foreach ($columns as $column) { |
237 | 237 | if (in_array(get_class($column), $this->searchableColumns)) { |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | */ |
250 | 250 | protected function applyColumnSearch(Builder $query) |
251 | 251 | { |
252 | - $queryColumns = Request::input('columns', []); |
|
252 | + $queryColumns = Request::input('columns', [ ]); |
|
253 | 253 | |
254 | 254 | foreach ($queryColumns as $index => $queryColumn) { |
255 | 255 | $search = array_get($queryColumn, 'search.value'); |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $column = $this->getColumns()->all()->get($index); |
258 | 258 | $columnFilter = array_get($this->getColumnFilters()->all(), $index); |
259 | 259 | |
260 | - if (! is_null($columnFilter) && ! is_null($column)) { |
|
260 | + if (!is_null($columnFilter) && !is_null($column)) { |
|
261 | 261 | $columnFilter->apply($this->repository, $column, $query, $search, $fullSearch); |
262 | 262 | } |
263 | 263 | } |
@@ -276,26 +276,26 @@ discard block |
||
276 | 276 | { |
277 | 277 | $columns = $this->getColumns(); |
278 | 278 | |
279 | - $result = []; |
|
280 | - $result['draw'] = Request::input('draw', 0); |
|
281 | - $result['recordsTotal'] = $totalCount; |
|
282 | - $result['recordsFiltered'] = $filteredCount; |
|
283 | - $result['data'] = []; |
|
279 | + $result = [ ]; |
|
280 | + $result[ 'draw' ] = Request::input('draw', 0); |
|
281 | + $result[ 'recordsTotal' ] = $totalCount; |
|
282 | + $result[ 'recordsFiltered' ] = $filteredCount; |
|
283 | + $result[ 'data' ] = [ ]; |
|
284 | 284 | |
285 | 285 | foreach ($collection as $instance) { |
286 | - $_row = []; |
|
286 | + $_row = [ ]; |
|
287 | 287 | |
288 | 288 | foreach ($columns->all() as $column) { |
289 | 289 | $column->setModel($instance); |
290 | 290 | |
291 | - if($column instanceof Control) { |
|
291 | + if ($column instanceof Control) { |
|
292 | 292 | $column->initialize(); |
293 | 293 | } |
294 | 294 | |
295 | - $_row[] = (string) $column; |
|
295 | + $_row[ ] = (string) $column; |
|
296 | 296 | } |
297 | 297 | |
298 | - $result['data'][] = $_row; |
|
298 | + $result[ 'data' ][ ] = $_row; |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | return $result; |