@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | $routeName = 'admin.form.element.'.static::$route; |
29 | 29 | |
30 | - if (! $router->has($routeName)) { |
|
30 | + if (!$router->has($routeName)) { |
|
31 | 31 | $router->post('{adminModel}/'.static::$route.'/{field}/{id?}', [ |
32 | 32 | 'as' => $routeName, |
33 | 33 | 'uses' => 'SleepingOwl\Admin\Http\Controllers\UploadController@fromField', |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function getUploadPath(UploadedFile $file) |
129 | 129 | { |
130 | - if (! is_callable($this->uploadPath)) { |
|
130 | + if (!is_callable($this->uploadPath)) { |
|
131 | 131 | return $this->defaultUploadPath($file); |
132 | 132 | } |
133 | 133 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | public function getUploadFileName(UploadedFile $file) |
155 | 155 | { |
156 | - if (! is_callable($this->uploadFileName)) { |
|
156 | + if (!is_callable($this->uploadFileName)) { |
|
157 | 157 | return $this->defaultUploadFilename($file); |
158 | 158 | } |
159 | 159 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function setClass($class) |
58 | 58 | { |
59 | - if (! class_exists($class)) { |
|
59 | + if (!class_exists($class)) { |
|
60 | 60 | throw new RepositoryException("Class {$class} not found."); |
61 | 61 | } |
62 | 62 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function with($with) |
105 | 105 | { |
106 | - if (! is_array($with)) { |
|
106 | + if (!is_array($with)) { |
|
107 | 107 | $with = func_get_args(); |
108 | 108 | } |
109 | 109 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function __construct($treeType = null) |
42 | 42 | { |
43 | - if (! is_null($treeType)) { |
|
43 | + if (!is_null($treeType)) { |
|
44 | 44 | $this->setTreeType($treeType); |
45 | 45 | } |
46 | 46 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $this->treeType = new $treeType($this); |
56 | 56 | |
57 | - if (! ($this->treeType instanceof TreeTypeInterface)) { |
|
57 | + if (!($this->treeType instanceof TreeTypeInterface)) { |
|
58 | 58 | throw new DisplayTreeException('Tree type class must be instanced of [SleepingOwl\Admin\Contracts\Display\Tree\TreeTypeInterface]'); |
59 | 59 | } |
60 | 60 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public function can($action, Model $model) |
206 | 206 | { |
207 | - if (! $this->checkAccess) { |
|
207 | + if (!$this->checkAccess) { |
|
208 | 208 | return true; |
209 | 209 | } |
210 | 210 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | */ |
217 | 217 | public function isCreatable() |
218 | 218 | { |
219 | - if (! is_callable($this->getCreate())) { |
|
219 | + if (!is_callable($this->getCreate())) { |
|
220 | 220 | return false; |
221 | 221 | } |
222 | 222 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public function isEditable(Model $model) |
242 | 242 | { |
243 | - if (! is_callable($this->getEdit())) { |
|
243 | + if (!is_callable($this->getEdit())) { |
|
244 | 244 | return false; |
245 | 245 | } |
246 | 246 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function fireDisplay(array $payload = []) |
365 | 365 | { |
366 | - if (! is_callable($this->getDisplay())) { |
|
366 | + if (!is_callable($this->getDisplay())) { |
|
367 | 367 | return; |
368 | 368 | } |
369 | 369 | |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | */ |
410 | 410 | public function fireCreate() |
411 | 411 | { |
412 | - if (! is_callable($this->getCreate())) { |
|
412 | + if (!is_callable($this->getCreate())) { |
|
413 | 413 | return; |
414 | 414 | } |
415 | 415 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | */ |
457 | 457 | public function fireEdit($id) |
458 | 458 | { |
459 | - if (! is_callable($this->getEdit())) { |
|
459 | + if (!is_callable($this->getEdit())) { |
|
460 | 460 | return; |
461 | 461 | } |
462 | 462 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function fireDisplay(array $payload = []) |
35 | 35 | { |
36 | - if (! method_exists($this, 'onDisplay')) { |
|
36 | + if (!method_exists($this, 'onDisplay')) { |
|
37 | 37 | return; |
38 | 38 | } |
39 | 39 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function fireCreate() |
58 | 58 | { |
59 | - if (! method_exists($this, 'onCreate')) { |
|
59 | + if (!method_exists($this, 'onCreate')) { |
|
60 | 60 | return; |
61 | 61 | } |
62 | 62 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function fireEdit($id) |
85 | 85 | { |
86 | - if (! method_exists($this, 'onEdit')) { |
|
86 | + if (!method_exists($this, 'onEdit')) { |
|
87 | 87 | return; |
88 | 88 | } |
89 | 89 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | */ |
37 | 37 | public function canShow() |
38 | 38 | { |
39 | - if (is_null($this->getModel()->getKey()) || ! $this->show) { |
|
39 | + if (is_null($this->getModel()->getKey()) || !$this->show) { |
|
40 | 40 | return false; |
41 | 41 | } |
42 | 42 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public static function registerRoutes(Router $router) |
24 | 24 | { |
25 | 25 | $routeName = 'admin.display.tree.reorder'; |
26 | - if (! $router->has($routeName)) { |
|
26 | + if (!$router->has($routeName)) { |
|
27 | 27 | $router->post('{adminModel}/reorder', |
28 | 28 | ['as' => $routeName, 'uses' => 'SleepingOwl\Admin\Http\Controllers\DisplayController@treeReorder']); |
29 | 29 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | if ($this->getParentField()) { |
119 | 119 | $repository = $repository->setParentField($this->getParentField()); |
120 | 120 | } |
121 | - if (! is_null($this->treeType)) { |
|
121 | + if (!is_null($this->treeType)) { |
|
122 | 122 | $repository->setTreeType($this->treeType); |
123 | 123 | } |
124 | 124 | |
@@ -340,11 +340,11 @@ discard block |
||
340 | 340 | */ |
341 | 341 | public function getCollection() |
342 | 342 | { |
343 | - if (! $this->isInitialized()) { |
|
343 | + if (!$this->isInitialized()) { |
|
344 | 344 | throw new \Exception('Display is not initialized'); |
345 | 345 | } |
346 | 346 | |
347 | - if (! is_null($this->collection)) { |
|
347 | + if (!is_null($this->collection)) { |
|
348 | 348 | return $this->collection; |
349 | 349 | } |
350 | 350 | |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | { |
376 | 376 | $repository = parent::makeRepository(); |
377 | 377 | |
378 | - if (! ($repository instanceof TreeRepositoryInterface)) { |
|
378 | + if (!($repository instanceof TreeRepositoryInterface)) { |
|
379 | 379 | throw new \Exception('Repository class must be instanced of [TreeRepositoryInterface]'); |
380 | 380 | } |
381 | 381 |
@@ -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) { |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | protected function registerModelBindings(Collection $aliases) |
61 | 61 | { |
62 | - $this->router->bind('adminModel', function ($model, Route $route) use ($aliases) { |
|
62 | + $this->router->bind('adminModel', function($model, Route $route) use ($aliases) { |
|
63 | 63 | if (is_null($model = $aliases->get($model))) { |
64 | 64 | throw new ModelNotFoundException(); |
65 | 65 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | protected function runCustomController(Route $route, $controller, $action) |
87 | 87 | { |
88 | - $route->uses(function () use ($route, $controller, $action) { |
|
88 | + $route->uses(function() use ($route, $controller, $action) { |
|
89 | 89 | return (new ControllerDispatcher($this->app))->dispatch( |
90 | 90 | $route, $this->app->make($controller), $action |
91 | 91 | ); |