@@ -290,7 +290,7 @@ |
||
290 | 290 | } |
291 | 291 | |
292 | 292 | /** |
293 | - * @return null|string |
|
293 | + * @return boolean |
|
294 | 294 | */ |
295 | 295 | public function hasCustomControllerClass() |
296 | 296 | { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | $this->repository = $app->make(RepositoryInterface::class); |
117 | 117 | $this->repository->setClass($class); |
118 | - if (! $this->alias) { |
|
118 | + if (!$this->alias) { |
|
119 | 119 | $this->setDefaultAlias(); |
120 | 120 | } |
121 | 121 | } |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | */ |
305 | 305 | public function can($action, Model $model) |
306 | 306 | { |
307 | - if (! $this->checkAccess) { |
|
307 | + if (!$this->checkAccess) { |
|
308 | 308 | return true; |
309 | 309 | } |
310 | 310 | |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | { |
339 | 339 | $controller = $this->getControllerClass(); |
340 | 340 | |
341 | - return ! is_null($controller) && class_exists($controller); |
|
341 | + return !is_null($controller) && class_exists($controller); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | /** |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | $page->setPriority($priority); |
518 | 518 | |
519 | 519 | if ($badge) { |
520 | - if (! ($badge instanceof BadgeInterface)) { |
|
520 | + if (!($badge instanceof BadgeInterface)) { |
|
521 | 521 | $badge = new Badge($badge); |
522 | 522 | } |
523 | 523 | |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | */ |
559 | 559 | public function fireEvent($event, $halt = true, Model $model = null, ...$payload) |
560 | 560 | { |
561 | - if (! isset(self::$dispatcher)) { |
|
561 | + if (!isset(self::$dispatcher)) { |
|
562 | 562 | return true; |
563 | 563 | } |
564 | 564 |
@@ -38,8 +38,8 @@ |
||
38 | 38 | $relationName = implode('.', $parts); |
39 | 39 | } |
40 | 40 | |
41 | - if (! is_null($relationName)) { |
|
42 | - $query->whereHas($relationName, function ($q) use ($name, $value) { |
|
41 | + if (!is_null($relationName)) { |
|
42 | + $query->whereHas($relationName, function($q) use ($name, $value) { |
|
43 | 43 | $this->buildQuery($q, $name, $value); |
44 | 44 | }); |
45 | 45 | } else { |
@@ -313,11 +313,11 @@ discard block |
||
313 | 313 | */ |
314 | 314 | public function isShowDeleteButton() |
315 | 315 | { |
316 | - if (is_null($this->getModel()->getKey()) || ! $this->showDeleteButton) { |
|
316 | + if (is_null($this->getModel()->getKey()) || !$this->showDeleteButton) { |
|
317 | 317 | return false; |
318 | 318 | } |
319 | 319 | |
320 | - $this->showDeleteButton = ! $this->isTrashed() && $this->getModelConfiguration()->isDeletable($this->getModel()); |
|
320 | + $this->showDeleteButton = !$this->isTrashed() && $this->getModelConfiguration()->isDeletable($this->getModel()); |
|
321 | 321 | |
322 | 322 | return $this->showDeleteButton; |
323 | 323 | } |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | */ |
338 | 338 | public function isShowDestroyButton() |
339 | 339 | { |
340 | - if (is_null($this->getModel()->getKey()) || ! $this->showDestroyButton) { |
|
340 | + if (is_null($this->getModel()->getKey()) || !$this->showDestroyButton) { |
|
341 | 341 | return false; |
342 | 342 | } |
343 | 343 | |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | */ |
363 | 363 | public function isShowRestoreButton() |
364 | 364 | { |
365 | - if (is_null($this->getModel()->getKey()) || ! $this->showRestoreButton) { |
|
365 | + if (is_null($this->getModel()->getKey()) || !$this->showRestoreButton) { |
|
366 | 366 | return false; |
367 | 367 | } |
368 | 368 |
@@ -87,7 +87,7 @@ |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
90 | - * @return int |
|
90 | + * @return string |
|
91 | 91 | */ |
92 | 92 | public function getWidth() |
93 | 93 | { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | $this->header = app(TableHeaderColumnInterface::class); |
66 | 66 | |
67 | - if (! is_null($label)) { |
|
67 | + if (!is_null($label)) { |
|
68 | 68 | $this->setLabel($label); |
69 | 69 | } |
70 | 70 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $orderable = new OrderByClause($orderable); |
207 | 207 | } |
208 | 208 | |
209 | - if ($orderable !== false && ! $orderable instanceof OrderByClauseInterface) { |
|
209 | + if ($orderable !== false && !$orderable instanceof OrderByClauseInterface) { |
|
210 | 210 | throw new \InvalidArgumentException('Argument must be instance of SleepingOwl\Admin\Contracts\Display\OrderByClauseInterface interface'); |
211 | 211 | } |
212 | 212 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public function orderBy(Builder $query, $direction) |
235 | 235 | { |
236 | - if (! $this->isOrderable()) { |
|
236 | + if (!$this->isOrderable()) { |
|
237 | 237 | throw new \InvalidArgumentException('Argument must be instance of SleepingOwl\Admin\Contracts\Display\OrderByClauseInterface interface'); |
238 | 238 | } |
239 | 239 |
@@ -95,7 +95,7 @@ |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
98 | - * @param $widget |
|
98 | + * @param string $widget |
|
99 | 99 | * |
100 | 100 | * @return \Closure |
101 | 101 | */ |
@@ -54,22 +54,22 @@ |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | $groupedBlocks = $this->widgets |
57 | - ->map(function ($class) { |
|
57 | + ->map(function($class) { |
|
58 | 58 | return $this->makeWidget($class); |
59 | 59 | }) |
60 | - ->filter(function (WidgetInterface $block) { |
|
60 | + ->filter(function(WidgetInterface $block) { |
|
61 | 61 | return $block->active(); |
62 | 62 | }) |
63 | - ->groupBy(function (WidgetInterface $block) { |
|
63 | + ->groupBy(function(WidgetInterface $block) { |
|
64 | 64 | return $block->template(); |
65 | 65 | }); |
66 | 66 | |
67 | 67 | foreach ($groupedBlocks as $template => $widgets) { |
68 | - $factory->composer($template, function (View $view) use ($widgets) { |
|
68 | + $factory->composer($template, function(View $view) use ($widgets) { |
|
69 | 69 | $factory = $view->getFactory(); |
70 | 70 | |
71 | 71 | /** @var Collection|WidgetInterface[] $widgets */ |
72 | - $widgets = $widgets->sortBy(function (WidgetInterface $block) { |
|
72 | + $widgets = $widgets->sortBy(function(WidgetInterface $block) { |
|
73 | 73 | return $block->position(); |
74 | 74 | }); |
75 | 75 |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | { |
65 | 65 | parent::initialize(); |
66 | 66 | |
67 | - $this->buttons->put('edit', $button = new ControlLink(function (Model $model) { |
|
67 | + $this->buttons->put('edit', $button = new ControlLink(function(Model $model) { |
|
68 | 68 | return $this->getModelConfiguration()->getEditUrl($model->getKey()); |
69 | 69 | }, trans('sleeping_owl::lang.table.edit'), 100)); |
70 | 70 | $button->hideText(); |
71 | - $button->setCondition(function () { |
|
71 | + $button->setCondition(function() { |
|
72 | 72 | return $this->isEditable(); |
73 | 73 | }); |
74 | 74 | $button->setIcon('fa fa-pencil'); |
75 | 75 | $button->setHtmlAttribute('class', 'btn-primary'); |
76 | 76 | |
77 | - $this->buttons->put('delete', $button = new ControlButton(function (Model $model) { |
|
77 | + $this->buttons->put('delete', $button = new ControlButton(function(Model $model) { |
|
78 | 78 | return $this->getModelConfiguration()->getDeleteUrl($model->getKey()); |
79 | 79 | }, trans('sleeping_owl::lang.table.delete'), 200)); |
80 | - $button->setCondition(function () { |
|
80 | + $button->setCondition(function() { |
|
81 | 81 | return $this->isDeletable(); |
82 | 82 | }); |
83 | 83 | |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | $button->setIcon('fa fa-trash'); |
87 | 87 | $button->setHtmlAttribute('class', 'btn-danger btn-delete'); |
88 | 88 | |
89 | - $this->buttons->put('destroy', $button = new ControlButton(function (Model $model) { |
|
89 | + $this->buttons->put('destroy', $button = new ControlButton(function(Model $model) { |
|
90 | 90 | return $this->getModelConfiguration()->getDestroyUrl($model->getKey()); |
91 | 91 | }, trans('sleeping_owl::lang.table.destroy'), 300)); |
92 | - $button->setCondition(function () { |
|
92 | + $button->setCondition(function() { |
|
93 | 93 | return $this->isDestroyable(); |
94 | 94 | }); |
95 | 95 | |
@@ -98,10 +98,10 @@ discard block |
||
98 | 98 | $button->setIcon('fa fa-trash'); |
99 | 99 | $button->setHtmlAttribute('class', 'btn-danger btn-destroy'); |
100 | 100 | |
101 | - $this->buttons->put('restore', $button = new ControlButton(function (Model $model) { |
|
101 | + $this->buttons->put('restore', $button = new ControlButton(function(Model $model) { |
|
102 | 102 | return $this->getModelConfiguration()->getRestoreUrl($model->getKey()); |
103 | 103 | }, trans('sleeping_owl::lang.table.restore'), 400)); |
104 | - $button->setCondition(function () { |
|
104 | + $button->setCondition(function() { |
|
105 | 105 | return $this->isRestorable(); |
106 | 106 | }); |
107 | 107 | $button->hideText(); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | return |
190 | 190 | $this->editable |
191 | 191 | && |
192 | - ! $this->isTrashed() |
|
192 | + !$this->isTrashed() |
|
193 | 193 | && |
194 | 194 | $this->getModelConfiguration()->isEditable( |
195 | 195 | $this->getModel() |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | return |
207 | 207 | $this->deletable |
208 | 208 | && |
209 | - ! $this->isTrashed() |
|
209 | + !$this->isTrashed() |
|
210 | 210 | && |
211 | 211 | $this->getModelConfiguration()->isDeletable( |
212 | 212 | $this->getModel() |
@@ -266,13 +266,13 @@ discard block |
||
266 | 266 | { |
267 | 267 | return parent::toArray() + [ |
268 | 268 | 'buttons' => $this->buttons |
269 | - ->each(function (ControlButtonInterface $button) { |
|
269 | + ->each(function(ControlButtonInterface $button) { |
|
270 | 270 | $button->setModel($this->getModel()); |
271 | 271 | }) |
272 | - ->filter(function (ControlButtonInterface $button) { |
|
272 | + ->filter(function(ControlButtonInterface $button) { |
|
273 | 273 | return $button->isActive(); |
274 | 274 | }) |
275 | - ->sortBy(function (ControlButtonInterface $button) { |
|
275 | + ->sortBy(function(ControlButtonInterface $button) { |
|
276 | 276 | return $button->getPosition(); |
277 | 277 | }), |
278 | 278 | ]; |
@@ -11,7 +11,7 @@ |
||
11 | 11 | { |
12 | 12 | $value = $this->getValue(); |
13 | 13 | |
14 | - if (! $this->hasClassProperty('label-', 'bg-')) { |
|
14 | + if (!$this->hasClassProperty('label-', 'bg-')) { |
|
15 | 15 | $this->setHtmlAttribute('class', 'label-primary'); |
16 | 16 | } |
17 | 17 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | @foreach ($columns as $column) |
23 | 23 | <?php |
24 | 24 | $column->setModel($model); |
25 | - if($column instanceof \SleepingOwl\Admin\Display\Column\Control) { |
|
25 | + if ($column instanceof \SleepingOwl\Admin\Display\Column\Control) { |
|
26 | 26 | $column->initialize(); |
27 | 27 | } |
28 | 28 | ?> |
@@ -65,7 +65,7 @@ |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
68 | - * @return TabInterface[]|DisplayTabsCollection |
|
68 | + * @return \SleepingOwl\Admin\Form\FormElementsCollection |
|
69 | 69 | */ |
70 | 70 | public function getTabs() |
71 | 71 | { |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | - $activeTabs = $this->getTabs()->filter(function (TabInterface $tab) { |
|
70 | + $activeTabs = $this->getTabs()->filter(function(TabInterface $tab) { |
|
71 | 71 | return $tab->isActive(); |
72 | 72 | })->count(); |
73 | 73 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function setModelClass($class) |
97 | 97 | { |
98 | - $this->getTabs()->each(function (TabInterface $tab) use ($class) { |
|
98 | + $this->getTabs()->each(function(TabInterface $tab) use ($class) { |
|
99 | 99 | if ($tab instanceof DisplayInterface) { |
100 | 100 | $tab->setModelClass($class); |
101 | 101 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public function setAction($action) |
181 | 181 | { |
182 | - $this->getTabs()->each(function (TabInterface $tab) use ($action) { |
|
182 | + $this->getTabs()->each(function(TabInterface $tab) use ($action) { |
|
183 | 183 | if ($tab instanceof FormInterface) { |
184 | 184 | $tab->setAction($action); |
185 | 185 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function setId($id) |
197 | 197 | { |
198 | - $this->getTabs()->each(function (TabInterface $tab) use ($id) { |
|
198 | + $this->getTabs()->each(function(TabInterface $tab) use ($id) { |
|
199 | 199 | if ($tab instanceof FormInterface) { |
200 | 200 | $tab->setId($id); |
201 | 201 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function validateForm(\Illuminate\Http\Request $request, ModelConfigurationInterface $model = null) |
214 | 214 | { |
215 | - $this->getTabs()->each(function ($tab) use ($request, $model) { |
|
215 | + $this->getTabs()->each(function($tab) use ($request, $model) { |
|
216 | 216 | $tabId = $request->get('sleeping_owl_tab_id'); |
217 | 217 | |
218 | 218 | if ($tab instanceof FormInterface && $tab->getName() == $tabId) { |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | */ |
230 | 230 | public function saveForm(\Illuminate\Http\Request $request, ModelConfigurationInterface $model = null) |
231 | 231 | { |
232 | - $this->getTabs()->each(function (TabInterface $tab) use ($request, $model) { |
|
232 | + $this->getTabs()->each(function(TabInterface $tab) use ($request, $model) { |
|
233 | 233 | $tabId = $request->get('sleeping_owl_tab_id'); |
234 | 234 | |
235 | 235 | if ($tab instanceof FormInterface && $tab->getName() == $tabId) { |