@@ -31,17 +31,17 @@ discard block |
||
31 | 31 | $this->initializeNavigation(); |
32 | 32 | $this->registerAliases(); |
33 | 33 | |
34 | - $this->app->singleton('sleeping_owl.widgets', function () { |
|
34 | + $this->app->singleton('sleeping_owl.widgets', function() { |
|
35 | 35 | return new WidgetsRegistry($this->app); |
36 | 36 | }); |
37 | 37 | |
38 | - $this->app->booted(function () { |
|
38 | + $this->app->booted(function() { |
|
39 | 39 | $this->app['sleeping_owl.widgets']->placeWidgets( |
40 | 40 | $this->app[ViewFactory::class] |
41 | 41 | ); |
42 | 42 | }); |
43 | 43 | |
44 | - $this->app->booted(function () { |
|
44 | + $this->app->booted(function() { |
|
45 | 45 | $this->registerCustomRoutes(); |
46 | 46 | $this->registerDefaultRoutes(); |
47 | 47 | $this->registerNavigationFile(); |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | |
55 | 55 | protected function registerTemplate() |
56 | 56 | { |
57 | - $this->app->singleton('assets.packages', function ($app) { |
|
57 | + $this->app->singleton('assets.packages', function($app) { |
|
58 | 58 | return new \KodiCMS\Assets\PackageManager(); |
59 | 59 | }); |
60 | 60 | |
61 | - $this->app->singleton('sleeping_owl.meta', function ($app) { |
|
61 | + $this->app->singleton('sleeping_owl.meta', function($app) { |
|
62 | 62 | return new \SleepingOwl\Admin\Templates\Meta( |
63 | 63 | new \KodiCMS\Assets\Assets( |
64 | 64 | $app['assets.packages'] |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | ); |
67 | 67 | }); |
68 | 68 | |
69 | - $this->app->singleton('sleeping_owl.template', function ($app) { |
|
70 | - if (! class_exists($class = $this->getConfig('template'))) { |
|
69 | + $this->app->singleton('sleeping_owl.template', function($app) { |
|
70 | + if (!class_exists($class = $this->getConfig('template'))) { |
|
71 | 71 | throw new TemplateException("Template class [{$class}] not found"); |
72 | 72 | } |
73 | 73 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | protected function getBootstrapPath($path = null) |
98 | 98 | { |
99 | - if (! is_null($path)) { |
|
99 | + if (!is_null($path)) { |
|
100 | 100 | $path = DIRECTORY_SEPARATOR.$path; |
101 | 101 | } |
102 | 102 | |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | $this->registerMessages(); |
109 | 109 | $this->registerBootstrap(); |
110 | 110 | |
111 | - $this->registerRoutes(function (Router $route) { |
|
112 | - $route->group(['as' => 'admin.', 'namespace' => 'SleepingOwl\Admin\Http\Controllers'], function ($route) { |
|
111 | + $this->registerRoutes(function(Router $route) { |
|
112 | + $route->group(['as' => 'admin.', 'namespace' => 'SleepingOwl\Admin\Http\Controllers'], function($route) { |
|
113 | 113 | $route->get('assets/admin.scripts', [ |
114 | 114 | 'as' => 'scripts', |
115 | 115 | 'uses' => 'AdminController@getScripts', |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $this->app[WidgetsRegistryInterface::class]->registerWidget($messageType); |
131 | 131 | } |
132 | 132 | |
133 | - $this->app->singleton('sleeping_owl.message', function () use ($messageTypes) { |
|
133 | + $this->app->singleton('sleeping_owl.message', function() use ($messageTypes) { |
|
134 | 134 | return new \SleepingOwl\Admin\Widgets\Messages\MessageStack($messageTypes); |
135 | 135 | }); |
136 | 136 | } |
@@ -144,14 +144,14 @@ discard block |
||
144 | 144 | $this->app->bind(\KodiComponents\Navigation\Contracts\PageInterface::class, \SleepingOwl\Admin\Navigation\Page::class); |
145 | 145 | $this->app->bind(\KodiComponents\Navigation\Contracts\BadgeInterface::class, \SleepingOwl\Admin\Navigation\Badge::class); |
146 | 146 | |
147 | - $this->app->singleton('sleeping_owl.navigation', function () { |
|
147 | + $this->app->singleton('sleeping_owl.navigation', function() { |
|
148 | 148 | return new \SleepingOwl\Admin\Navigation(); |
149 | 149 | }); |
150 | 150 | } |
151 | 151 | |
152 | 152 | protected function registerWysiwyg() |
153 | 153 | { |
154 | - $this->app->singleton('sleeping_owl.wysiwyg', function () { |
|
154 | + $this->app->singleton('sleeping_owl.wysiwyg', function() { |
|
155 | 155 | return new \SleepingOwl\Admin\Wysiwyg\Manager($this->app); |
156 | 156 | }); |
157 | 157 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | { |
164 | 164 | $directory = $this->getBootstrapPath(); |
165 | 165 | |
166 | - if (! is_dir($directory)) { |
|
166 | + if (!is_dir($directory)) { |
|
167 | 167 | return; |
168 | 168 | } |
169 | 169 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | ->notName('routes.php') |
174 | 174 | ->notName('navigation.php') |
175 | 175 | ->in($directory) |
176 | - ->sort(function ($a) { |
|
176 | + ->sort(function($a) { |
|
177 | 177 | return $a->getFilename() != 'bootstrap.php'; |
178 | 178 | }); |
179 | 179 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | protected function registerCustomRoutes() |
191 | 191 | { |
192 | 192 | if (file_exists($file = $this->getBootstrapPath('routes.php'))) { |
193 | - $this->registerRoutes(function (Router $route) use ($file) { |
|
193 | + $this->registerRoutes(function(Router $route) use ($file) { |
|
194 | 194 | require $file; |
195 | 195 | }); |
196 | 196 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | protected function registerDefaultRoutes() |
200 | 200 | { |
201 | - $this->registerRoutes(function (Router $router) { |
|
201 | + $this->registerRoutes(function(Router $router) { |
|
202 | 202 | $router->pattern('adminModelId', '[a-zA-Z0-9_-]+'); |
203 | 203 | |
204 | 204 | $aliases = $this->app['sleeping_owl']->getModels()->keyByAlias(); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | if ($aliases->count() > 0) { |
207 | 207 | $router->pattern('adminModel', $aliases->keys()->implode('|')); |
208 | 208 | |
209 | - $this->app['router']->bind('adminModel', function ($model, \Illuminate\Routing\Route $route) use ($aliases) { |
|
209 | + $this->app['router']->bind('adminModel', function($model, \Illuminate\Routing\Route $route) use ($aliases) { |
|
210 | 210 | if (is_null($model = $aliases->get($model))) { |
211 | 211 | throw new ModelNotFoundException; |
212 | 212 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $this->app['router']->group([ |
240 | 240 | 'prefix' => $this->getConfig('url_prefix'), |
241 | 241 | 'middleware' => $this->getConfig('middleware'), |
242 | - ], function ($route) use ($callback) { |
|
242 | + ], function($route) use ($callback) { |
|
243 | 243 | call_user_func($callback, $route); |
244 | 244 | }); |
245 | 245 | } |
@@ -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) { |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $modelForOptions = app($modelForOptions); |
60 | 60 | } |
61 | 61 | |
62 | - if (! ($modelForOptions instanceof Model)) { |
|
62 | + if (!($modelForOptions instanceof Model)) { |
|
63 | 63 | throw new SelectException('Class must be instanced of Illuminate\Database\Eloquent\Model'); |
64 | 64 | } |
65 | 65 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function setFetchColumns($columns) |
107 | 107 | { |
108 | - if (! is_array($columns)) { |
|
108 | + if (!is_array($columns)) { |
|
109 | 109 | $columns = func_get_args(); |
110 | 110 | } |
111 | 111 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | |
201 | 201 | $options = $repository->getQuery(); |
202 | 202 | |
203 | - if ($this->isEmptyRelation() and ! is_null($foreignKey = $this->getForeignKey())) { |
|
203 | + if ($this->isEmptyRelation() and !is_null($foreignKey = $this->getForeignKey())) { |
|
204 | 204 | $options->where($foreignKey, 0)->orWhereNull($foreignKey); |
205 | 205 | } |
206 | 206 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | } |
212 | 212 | |
213 | 213 | // call the pre load options query preparer if has be set |
214 | - if (! is_null($preparer = $this->getLoadOptionsQueryPreparer())) { |
|
214 | + if (!is_null($preparer = $this->getLoadOptionsQueryPreparer())) { |
|
215 | 215 | $options = $preparer($this, $options); |
216 | 216 | } |
217 | 217 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | |
226 | 226 | // iterate for all options and redefine it as |
227 | 227 | // list of KEY and TEXT pair |
228 | - $options = array_map(function ($opt) use ($key, $makeDisplay) { |
|
228 | + $options = array_map(function($opt) use ($key, $makeDisplay) { |
|
229 | 229 | // get the KEY and make the display text |
230 | 230 | return [data_get($opt, $key), $makeDisplay($opt)]; |
231 | 231 | }, $options); |