@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | { |
43 | 43 | $this->initializeElements(); |
44 | 44 | |
45 | - $activeTabs = $this->getTabs()->filter(function (TabInterface $tab) { |
|
45 | + $activeTabs = $this->getTabs()->filter(function(TabInterface $tab) { |
|
46 | 46 | return $tab->isActive(); |
47 | 47 | })->count(); |
48 | 48 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function setModelClass($class) |
72 | 72 | { |
73 | - $this->getTabs()->each(function (TabInterface $tab) use ($class) { |
|
73 | + $this->getTabs()->each(function(TabInterface $tab) use ($class) { |
|
74 | 74 | if ($tab instanceof DisplayInterface) { |
75 | 75 | $tab->setModelClass($class); |
76 | 76 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function setAction($action) |
156 | 156 | { |
157 | - $this->getTabs()->each(function (TabInterface $tab) use ($action) { |
|
157 | + $this->getTabs()->each(function(TabInterface $tab) use ($action) { |
|
158 | 158 | if ($tab instanceof FormInterface) { |
159 | 159 | $tab->setAction($action); |
160 | 160 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | */ |
171 | 171 | public function setId($id) |
172 | 172 | { |
173 | - $this->getTabs()->each(function (TabInterface $tab) use ($id) { |
|
173 | + $this->getTabs()->each(function(TabInterface $tab) use ($id) { |
|
174 | 174 | if ($tab instanceof FormInterface) { |
175 | 175 | $tab->setId($id); |
176 | 176 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | */ |
188 | 188 | public function validateForm(\Illuminate\Http\Request $request, ModelConfigurationInterface $model = null) |
189 | 189 | { |
190 | - $this->getTabs()->each(function ($tab) use ($request, $model) { |
|
190 | + $this->getTabs()->each(function($tab) use ($request, $model) { |
|
191 | 191 | if ($tab instanceof FormInterface) { |
192 | 192 | $tab->validateForm($request, $model); |
193 | 193 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | */ |
203 | 203 | public function saveForm(\Illuminate\Http\Request $request, ModelConfigurationInterface $model = null) |
204 | 204 | { |
205 | - $this->getTabs()->each(function (TabInterface $tab) use ($request, $model) { |
|
205 | + $this->getTabs()->each(function(TabInterface $tab) use ($request, $model) { |
|
206 | 206 | if ($tab instanceof FormInterface) { |
207 | 207 | $tab->saveForm($request, $model); |
208 | 208 | } |
@@ -121,7 +121,7 @@ |
||
121 | 121 | $class = get_class($class); |
122 | 122 | } |
123 | 123 | |
124 | - if (! $this->hasModel($class)) { |
|
124 | + if (!$this->hasModel($class)) { |
|
125 | 125 | $this->registerModel($class); |
126 | 126 | } |
127 | 127 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function initializeElements() |
25 | 25 | { |
26 | - $this->getElements()->each(function ($element) { |
|
26 | + $this->getElements()->each(function($element) { |
|
27 | 27 | if ($element instanceof Initializable) { |
28 | 28 | $element->initialize(); |
29 | 29 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | foreach ($this->getElements() as $element) { |
43 | 43 | if ($element instanceof ElementsInterface) { |
44 | - if (! is_null($found = $element->getElement($path))) { |
|
44 | + if (!is_null($found = $element->getElement($path))) { |
|
45 | 45 | return $found; |
46 | 46 | } |
47 | 47 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | protected function setModelForElements(Model $model) |
147 | 147 | { |
148 | - $this->getElements()->each(function ($element) use ($model) { |
|
148 | + $this->getElements()->each(function($element) use ($model) { |
|
149 | 149 | $element = $this->getElementContainer($element); |
150 | 150 | |
151 | 151 | if ($element instanceof WithModel) { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | protected function getValidationRulesFromElements(array $rules = []) |
165 | 165 | { |
166 | - $this->getElements()->onlyActive()->each(function ($element) use (&$rules) { |
|
166 | + $this->getElements()->onlyActive()->each(function($element) use (&$rules) { |
|
167 | 167 | $element = $this->getElementContainer($element); |
168 | 168 | |
169 | 169 | if ($element instanceof Validable) { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | */ |
182 | 182 | protected function getValidationMessagesForElements(array $messages = []) |
183 | 183 | { |
184 | - $this->getElements()->onlyActive()->each(function ($element) use (&$messages) { |
|
184 | + $this->getElements()->onlyActive()->each(function($element) use (&$messages) { |
|
185 | 185 | $element = $this->getElementContainer($element); |
186 | 186 | |
187 | 187 | if ($element instanceof Validable) { |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | */ |
200 | 200 | protected function getValidationLabelsForElements(array $labels = []) |
201 | 201 | { |
202 | - $this->getElements()->onlyActive()->each(function ($element) use (&$labels) { |
|
202 | + $this->getElements()->onlyActive()->each(function($element) use (&$labels) { |
|
203 | 203 | $element = $this->getElementContainer($element); |
204 | 204 | |
205 | 205 | if ($element instanceof Validable) { |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | */ |
218 | 218 | protected function saveElements(\Illuminate\Http\Request $request) |
219 | 219 | { |
220 | - $this->getElements()->onlyActive()->each(function ($element) use ($request) { |
|
220 | + $this->getElements()->onlyActive()->each(function($element) use ($request) { |
|
221 | 221 | $element = $this->getElementContainer($element); |
222 | 222 | |
223 | 223 | if ($element instanceof FormElementInterface) { |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | protected function afterSaveElements(\Illuminate\Http\Request $request) |
235 | 235 | { |
236 | - $this->getElements()->onlyActive()->each(function ($element) use ($request) { |
|
236 | + $this->getElements()->onlyActive()->each(function($element) use ($request) { |
|
237 | 237 | $element = $this->getElementContainer($element); |
238 | 238 | |
239 | 239 | if ($element instanceof FormElementInterface) { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | list($name, $params) = $this->currentRoute->get(); |
35 | 35 | } |
36 | 36 | |
37 | - if (! $this->exists($name)) { |
|
37 | + if (!$this->exists($name)) { |
|
38 | 38 | return ''; |
39 | 39 | } |
40 | 40 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function renderIfExistsArray($name, $params = []) |
62 | 62 | { |
63 | - if (! $this->exists($name)) { |
|
63 | + if (!$this->exists($name)) { |
|
64 | 64 | return ''; |
65 | 65 | } |
66 | 66 |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | $this->repository = $app->make(RepositoryInterface::class); |
116 | 116 | $this->repository->setClass($class); |
117 | - if (! $this->alias) { |
|
117 | + if (!$this->alias) { |
|
118 | 118 | $this->setDefaultAlias(); |
119 | 119 | } |
120 | 120 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | */ |
304 | 304 | public function can($action, Model $model) |
305 | 305 | { |
306 | - if (! $this->checkAccess) { |
|
306 | + if (!$this->checkAccess) { |
|
307 | 307 | return true; |
308 | 308 | } |
309 | 309 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | */ |
336 | 336 | public function hasCustomControllerClass() |
337 | 337 | { |
338 | - return ! is_null($controller = $this->getControllerClass()) and class_exists($controller); |
|
338 | + return !is_null($controller = $this->getControllerClass()) and class_exists($controller); |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | /** |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | $page->setPriority($priority); |
473 | 473 | |
474 | 474 | if ($badge) { |
475 | - if (! ($badge instanceof BadgeInterface)) { |
|
475 | + if (!($badge instanceof BadgeInterface)) { |
|
476 | 476 | $badge = new Badge($badge); |
477 | 477 | } |
478 | 478 | |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | */ |
516 | 516 | public function fireEvent($event, $halt = true, Model $model = null, ...$payload) |
517 | 517 | { |
518 | - if (! isset(self::$dispatcher)) { |
|
518 | + if (!isset(self::$dispatcher)) { |
|
519 | 519 | return true; |
520 | 520 | } |
521 | 521 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | { |
22 | 22 | parent::__construct($name, $title); |
23 | 23 | |
24 | - if (! is_null($callback)) { |
|
24 | + if (!is_null($callback)) { |
|
25 | 25 | $this->setCallback($callback); |
26 | 26 | } |
27 | 27 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | public static function registerRoutes(Router $router) |
25 | 25 | { |
26 | 26 | $routeName = 'admin.display.async'; |
27 | - if (! $router->has($routeName)) { |
|
27 | + if (!$router->has($routeName)) { |
|
28 | 28 | $router->get('{adminModel}/async/{adminDisplayName?}', [ |
29 | 29 | 'as' => $routeName, |
30 | 30 | 'uses' => 'SleepingOwl\Admin\Http\Controllers\DisplayController@async', |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | $routeName = 'admin.display.async.inlineEdit'; |
35 | - if (! $router->has($routeName)) { |
|
35 | + if (!$router->has($routeName)) { |
|
36 | 36 | $router->post('{adminModel}/async/{adminDisplayName?}', [ |
37 | 37 | 'as' => $routeName, |
38 | 38 | 'uses' => 'SleepingOwl\Admin\Http\Controllers\AdminController@inlineEdit', |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $totalCount = $query->count(); |
143 | 143 | $filteredCount = 0; |
144 | 144 | |
145 | - if (! is_null($this->distinct)) { |
|
145 | + if (!is_null($this->distinct)) { |
|
146 | 146 | $filteredCount = $query->distinct()->count($this->getDistinct()); |
147 | 147 | } |
148 | 148 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | return; |
191 | 191 | } |
192 | 192 | |
193 | - $query->where(function ($query) use ($search) { |
|
193 | + $query->where(function($query) use ($search) { |
|
194 | 194 | $columns = $this->getColumns()->all(); |
195 | 195 | foreach ($columns as $column) { |
196 | 196 | if (in_array(get_class($column), $this->searchableColumns)) { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function __construct($label = null, Closure $callback = null) |
33 | 33 | { |
34 | 34 | parent::__construct($label); |
35 | - if (! is_null($callback)) { |
|
35 | + if (!is_null($callback)) { |
|
36 | 36 | $this->setCallback($callback); |
37 | 37 | } |
38 | 38 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function getModelValue() |
68 | 68 | { |
69 | - if (! is_callable($callback = $this->getCallback())) { |
|
69 | + if (!is_callable($callback = $this->getCallback())) { |
|
70 | 70 | throw new \Exception('Invalid custom column callback'); |
71 | 71 | } |
72 | 72 |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function setOrderable($orderable = true) |
75 | 75 | { |
76 | - if ($orderable !== false && ! $orderable instanceof OrderByClauseInterface) { |
|
77 | - if (! is_string($orderable) && ! $orderable instanceof Closure) { |
|
76 | + if ($orderable !== false && !$orderable instanceof OrderByClauseInterface) { |
|
77 | + if (!is_string($orderable) && !$orderable instanceof Closure) { |
|
78 | 78 | $orderable = $this->getName(); |
79 | 79 | } |
80 | 80 | } |
@@ -113,11 +113,11 @@ discard block |
||
113 | 113 | |
114 | 114 | if ($instance instanceof Collection) { |
115 | 115 | $instance = $instance->pluck($part); |
116 | - } elseif (! is_null($instance)) { |
|
116 | + } elseif (!is_null($instance)) { |
|
117 | 117 | $instance = $instance->getAttribute($part); |
118 | 118 | } |
119 | 119 | |
120 | - if (! empty($parts) && ! is_null($instance)) { |
|
120 | + if (!empty($parts) && !is_null($instance)) { |
|
121 | 121 | return $this->getValueFromObject($instance, implode('.', $parts)); |
122 | 122 | } |
123 | 123 |