@@ -24,12 +24,12 @@ |
||
24 | 24 | collect([ |
25 | 25 | Installation\PublishAssets::class, |
26 | 26 | ]) |
27 | - ->map(function ($installer) { |
|
27 | + ->map(function($installer) { |
|
28 | 28 | return new $installer($this, $this->config); |
29 | 29 | }) |
30 | - ->filter(function ($installer) { |
|
31 | - return $this->option('force') ? true : ! $installer->installed(); |
|
32 | - })->each(function ($installer) { |
|
30 | + ->filter(function($installer) { |
|
31 | + return $this->option('force') ? true : !$installer->installed(); |
|
32 | + })->each(function($installer) { |
|
33 | 33 | $installer->install(); |
34 | 34 | $installer->showInfo(); |
35 | 35 | }); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | $userClass = $this->getUserClass(); |
55 | 55 | |
56 | - $headers = ['id', 'name', 'email']; |
|
56 | + $headers = [ 'id', 'name', 'email' ]; |
|
57 | 57 | $users = $userClass::get($headers); |
58 | 58 | |
59 | 59 | $this->table($headers, $users); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | return; |
70 | 70 | } |
71 | 71 | |
72 | - if (! is_null($userClass::where('email', $email)->first())) { |
|
72 | + if (!is_null($userClass::where('email', $email)->first())) { |
|
73 | 73 | $this->error("User with same email [{$email}] exists."); |
74 | 74 | |
75 | 75 | return; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | } |
121 | 121 | |
122 | 122 | $confirm = $this->confirm("Are you sure want to delete user with id [{$id}]?", false); |
123 | - if (! $confirm) { |
|
123 | + if (!$confirm) { |
|
124 | 124 | return; |
125 | 125 | } |
126 | 126 | |
@@ -173,9 +173,9 @@ discard block |
||
173 | 173 | protected function getOptions() |
174 | 174 | { |
175 | 175 | return [ |
176 | - ['create', 'c', InputOption::VALUE_NONE, 'Create new user.'], |
|
177 | - ['delete', 'd', InputOption::VALUE_NONE, 'Delete user.'], |
|
178 | - ['password', 'p', InputOption::VALUE_NONE, 'Change user password.'], |
|
176 | + [ 'create', 'c', InputOption::VALUE_NONE, 'Create new user.' ], |
|
177 | + [ 'delete', 'd', InputOption::VALUE_NONE, 'Delete user.' ], |
|
178 | + [ 'password', 'p', InputOption::VALUE_NONE, 'Change user password.' ], |
|
179 | 179 | ]; |
180 | 180 | } |
181 | 181 | } |
@@ -31,14 +31,14 @@ |
||
31 | 31 | 'App\Providers\AdminSectionsServiceProvider' |
32 | 32 | ); |
33 | 33 | |
34 | - if (! $provider) { |
|
34 | + if (!$provider) { |
|
35 | 35 | $this->error('[App\Providers\AdminSectionsServiceProvider] not found'); |
36 | 36 | |
37 | 37 | return; |
38 | 38 | } |
39 | 39 | |
40 | 40 | foreach ($provider->sections() as $model => $section) { |
41 | - $this->callSilent('sleepingowl:section:make', ['name' => $section, 'model' => $model]); |
|
41 | + $this->callSilent('sleepingowl:section:make', [ 'name' => $section, 'model' => $model ]); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $this->info('Sections generated successfully!'); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | public function register() |
29 | 29 | { |
30 | - $this->app->singleton('sleeping_owl', function () { |
|
30 | + $this->app->singleton('sleeping_owl', function() { |
|
31 | 31 | return new Admin(); |
32 | 32 | }); |
33 | 33 | |
@@ -37,23 +37,23 @@ discard block |
||
37 | 37 | $this->registerWysiwyg(); |
38 | 38 | $this->registerAliases(); |
39 | 39 | |
40 | - $this->app->singleton(WidgetsRegistryInterface::class, function () { |
|
40 | + $this->app->singleton(WidgetsRegistryInterface::class, function() { |
|
41 | 41 | return new WidgetsRegistry($this->app); |
42 | 42 | }); |
43 | 43 | |
44 | - $this->app->booted(function () { |
|
45 | - $this->app[WidgetsRegistryInterface::class]->placeWidgets( |
|
46 | - $this->app[ViewFactory::class] |
|
44 | + $this->app->booted(function() { |
|
45 | + $this->app[ WidgetsRegistryInterface::class ]->placeWidgets( |
|
46 | + $this->app[ ViewFactory::class ] |
|
47 | 47 | ); |
48 | 48 | }); |
49 | 49 | |
50 | - $this->app->booted(function () { |
|
50 | + $this->app->booted(function() { |
|
51 | 51 | $this->registerCustomRoutes(); |
52 | 52 | $this->registerDefaultRoutes(); |
53 | 53 | $this->registerNavigationFile(); |
54 | 54 | }); |
55 | 55 | |
56 | - ModelConfigurationManager::setEventDispatcher($this->app['events']); |
|
56 | + ModelConfigurationManager::setEventDispatcher($this->app[ 'events' ]); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | protected function getConfig($key) |
65 | 65 | { |
66 | - return $this->app['config']->get('sleeping_owl.'.$key); |
|
66 | + return $this->app[ 'config' ]->get('sleeping_owl.'.$key); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | protected function getBootstrapPath($path = null) |
75 | 75 | { |
76 | - if (! is_null($path)) { |
|
76 | + if (!is_null($path)) { |
|
77 | 77 | $path = DIRECTORY_SEPARATOR.$path; |
78 | 78 | } |
79 | 79 | |
@@ -84,14 +84,14 @@ discard block |
||
84 | 84 | { |
85 | 85 | $this->registerMessages(); |
86 | 86 | |
87 | - $this->app->singleton('sleeping_owl.template', function () { |
|
88 | - return $this->app['sleeping_owl']->template(); |
|
87 | + $this->app->singleton('sleeping_owl.template', function() { |
|
88 | + return $this->app[ 'sleeping_owl' ]->template(); |
|
89 | 89 | }); |
90 | 90 | |
91 | 91 | $this->registerBootstrap(); |
92 | 92 | |
93 | - $this->registerRoutes(function (Router $route) { |
|
94 | - $route->group(['as' => 'admin.', 'namespace' => 'SleepingOwl\Admin\Http\Controllers'], function ($route) { |
|
93 | + $this->registerRoutes(function(Router $route) { |
|
94 | + $route->group([ 'as' => 'admin.', 'namespace' => 'SleepingOwl\Admin\Http\Controllers' ], function($route) { |
|
95 | 95 | $route->get('assets/admin.scripts', [ |
96 | 96 | 'as' => 'scripts', |
97 | 97 | 'uses' => 'AdminController@getScripts', |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | 'warning' => \SleepingOwl\Admin\Widgets\Messages\WarningMessages::class, |
110 | 110 | ]; |
111 | 111 | foreach ($messageTypes as $messageType) { |
112 | - $this->app[WidgetsRegistryInterface::class]->registerWidget($messageType); |
|
112 | + $this->app[ WidgetsRegistryInterface::class ]->registerWidget($messageType); |
|
113 | 113 | } |
114 | 114 | |
115 | - $this->app->singleton('sleeping_owl.message', function () use ($messageTypes) { |
|
115 | + $this->app->singleton('sleeping_owl.message', function() use ($messageTypes) { |
|
116 | 116 | return new \SleepingOwl\Admin\Widgets\Messages\MessageStack($messageTypes); |
117 | 117 | }); |
118 | 118 | } |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | $this->app->bind(\KodiComponents\Navigation\Contracts\PageInterface::class, \SleepingOwl\Admin\Navigation\Page::class); |
127 | 127 | $this->app->bind(\KodiComponents\Navigation\Contracts\BadgeInterface::class, \SleepingOwl\Admin\Navigation\Badge::class); |
128 | 128 | |
129 | - $this->app->singleton('sleeping_owl.navigation', function () { |
|
129 | + $this->app->singleton('sleeping_owl.navigation', function() { |
|
130 | 130 | return new \SleepingOwl\Admin\Navigation(); |
131 | 131 | }); |
132 | 132 | } |
133 | 133 | |
134 | 134 | protected function registerWysiwyg() |
135 | 135 | { |
136 | - $this->app->singleton('sleeping_owl.wysiwyg', function () { |
|
136 | + $this->app->singleton('sleeping_owl.wysiwyg', function() { |
|
137 | 137 | return new \SleepingOwl\Admin\Wysiwyg\Manager(); |
138 | 138 | }); |
139 | 139 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | { |
146 | 146 | $directory = $this->getBootstrapPath(); |
147 | 147 | |
148 | - if (! is_dir($directory)) { |
|
148 | + if (!is_dir($directory)) { |
|
149 | 149 | return; |
150 | 150 | } |
151 | 151 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | ->notName('routes.php') |
156 | 156 | ->notName('navigation.php') |
157 | 157 | ->in($directory) |
158 | - ->sort(function ($a) { |
|
158 | + ->sort(function($a) { |
|
159 | 159 | return $a->getFilename() != 'bootstrap.php'; |
160 | 160 | }); |
161 | 161 | |
@@ -166,13 +166,13 @@ discard block |
||
166 | 166 | |
167 | 167 | protected function registerAliases() |
168 | 168 | { |
169 | - AliasLoader::getInstance(config('sleeping_owl.aliases', [])); |
|
169 | + AliasLoader::getInstance(config('sleeping_owl.aliases', [ ])); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | protected function registerCustomRoutes() |
173 | 173 | { |
174 | 174 | if (file_exists($file = $this->getBootstrapPath('routes.php'))) { |
175 | - $this->registerRoutes(function (Router $route) use ($file) { |
|
175 | + $this->registerRoutes(function(Router $route) use ($file) { |
|
176 | 176 | require $file; |
177 | 177 | }); |
178 | 178 | } |
@@ -180,15 +180,15 @@ discard block |
||
180 | 180 | |
181 | 181 | protected function registerDefaultRoutes() |
182 | 182 | { |
183 | - $this->registerRoutes(function (Router $router) { |
|
183 | + $this->registerRoutes(function(Router $router) { |
|
184 | 184 | $router->pattern('adminModelId', '[a-zA-Z0-9_-]+'); |
185 | 185 | |
186 | - $aliases = $this->app['sleeping_owl']->modelAliases(); |
|
186 | + $aliases = $this->app[ 'sleeping_owl' ]->modelAliases(); |
|
187 | 187 | |
188 | 188 | if (count($aliases) > 0) { |
189 | 189 | $router->pattern('adminModel', implode('|', $aliases)); |
190 | 190 | |
191 | - $this->app['router']->bind('adminModel', function ($model, \Illuminate\Routing\Route $route) use ($aliases) { |
|
191 | + $this->app[ 'router' ]->bind('adminModel', function($model, \Illuminate\Routing\Route $route) use ($aliases) { |
|
192 | 192 | $class = array_search($model, $aliases); |
193 | 193 | |
194 | 194 | if ($class === false) { |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | /** @var ModelConfiguration $model */ |
199 | - $model = $this->app['sleeping_owl']->getModel($class); |
|
199 | + $model = $this->app[ 'sleeping_owl' ]->getModel($class); |
|
200 | 200 | |
201 | 201 | if ($model->hasCustomControllerClass() && $route->getActionName() !== 'Closure') { |
202 | 202 | list($controller, $action) = explode('@', $route->getActionName(), 2); |
@@ -225,10 +225,10 @@ discard block |
||
225 | 225 | */ |
226 | 226 | protected function registerRoutes(\Closure $callback) |
227 | 227 | { |
228 | - $this->app['router']->group([ |
|
228 | + $this->app[ 'router' ]->group([ |
|
229 | 229 | 'prefix' => $this->getConfig('url_prefix'), |
230 | 230 | 'middleware' => $this->getConfig('middleware'), |
231 | - ], function ($route) use ($callback) { |
|
231 | + ], function($route) use ($callback) { |
|
232 | 232 | call_user_func($callback, $route); |
233 | 233 | }); |
234 | 234 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $items = include $navigation; |
240 | 240 | |
241 | 241 | if (is_array($items)) { |
242 | - $this->app['sleeping_owl.navigation']->setFromArray($items); |
|
242 | + $this->app[ 'sleeping_owl.navigation' ]->setFromArray($items); |
|
243 | 243 | } |
244 | 244 | } |
245 | 245 | } |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$router->group(['as' => 'admin.', 'namespace' => 'SleepingOwl\Admin\Http\Controllers'], function ($router) { |
|
4 | - if (! $router->has('admin.dashboard')) { |
|
5 | - $router->get('', ['as' => 'dashboard', 'uses' => 'AdminController@getDashboard']); |
|
3 | +$router->group([ 'as' => 'admin.', 'namespace' => 'SleepingOwl\Admin\Http\Controllers' ], function($router) { |
|
4 | + if (!$router->has('admin.dashboard')) { |
|
5 | + $router->get('', [ 'as' => 'dashboard', 'uses' => 'AdminController@getDashboard' ]); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | $router->get('{adminModel}', [ |
@@ -39,35 +39,35 @@ discard block |
||
39 | 39 | public function __construct(Request $request, \Illuminate\Contracts\Foundation\Application $application) |
40 | 40 | { |
41 | 41 | $this->application = $application; |
42 | - $this->navigation = $application['sleeping_owl.navigation']; |
|
42 | + $this->navigation = $application[ 'sleeping_owl.navigation' ]; |
|
43 | 43 | $this->navigation->setCurrentUrl($request->url()); |
44 | 44 | |
45 | - if (! Breadcrumbs::exists('home')) { |
|
46 | - Breadcrumbs::register('home', function ($breadcrumbs) { |
|
45 | + if (!Breadcrumbs::exists('home')) { |
|
46 | + Breadcrumbs::register('home', function($breadcrumbs) { |
|
47 | 47 | $breadcrumbs->push(trans('sleeping_owl::lang.dashboard'), route('admin.dashboard')); |
48 | 48 | }); |
49 | 49 | } |
50 | 50 | |
51 | - $breadcrumbs = []; |
|
51 | + $breadcrumbs = [ ]; |
|
52 | 52 | |
53 | 53 | if ($currentPage = $this->navigation->getCurrentPage()) { |
54 | 54 | foreach ($currentPage->getPathArray() as $page) { |
55 | - $breadcrumbs[] = [ |
|
56 | - 'id' => $page['id'], |
|
57 | - 'title' => $page['title'], |
|
58 | - 'url' => $page['url'], |
|
55 | + $breadcrumbs[ ] = [ |
|
56 | + 'id' => $page[ 'id' ], |
|
57 | + 'title' => $page[ 'title' ], |
|
58 | + 'url' => $page[ 'url' ], |
|
59 | 59 | 'parent' => $this->parentBreadcrumb, |
60 | 60 | ]; |
61 | 61 | |
62 | - $this->parentBreadcrumb = $page['id']; |
|
62 | + $this->parentBreadcrumb = $page[ 'id' ]; |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
66 | 66 | foreach ($breadcrumbs as $breadcrumb) { |
67 | - if (! Breadcrumbs::exists($breadcrumb['id'])) { |
|
68 | - Breadcrumbs::register($breadcrumb['id'], function ($breadcrumbs) use ($breadcrumb) { |
|
69 | - $breadcrumbs->parent($breadcrumb['parent']); |
|
70 | - $breadcrumbs->push($breadcrumb['title'], $breadcrumb['url']); |
|
67 | + if (!Breadcrumbs::exists($breadcrumb[ 'id' ])) { |
|
68 | + Breadcrumbs::register($breadcrumb[ 'id' ], function($breadcrumbs) use ($breadcrumb) { |
|
69 | + $breadcrumbs->parent($breadcrumb[ 'parent' ]); |
|
70 | + $breadcrumbs->push($breadcrumb[ 'title' ], $breadcrumb[ 'url' ]); |
|
71 | 71 | }); |
72 | 72 | } |
73 | 73 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function getDisplay(ModelConfigurationInterface $model) |
109 | 109 | { |
110 | - if (! $model->isDisplayable()) { |
|
110 | + if (!$model->isDisplayable()) { |
|
111 | 111 | abort(404); |
112 | 112 | } |
113 | 113 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function getCreate(ModelConfigurationInterface $model) |
123 | 123 | { |
124 | - if (! $model->isCreatable()) { |
|
124 | + if (!$model->isCreatable()) { |
|
125 | 125 | abort(404); |
126 | 126 | } |
127 | 127 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function postStore(ModelConfigurationInterface $model, Request $request) |
141 | 141 | { |
142 | - if (! $model->isCreatable()) { |
|
142 | + if (!$model->isCreatable()) { |
|
143 | 143 | abort(404); |
144 | 144 | } |
145 | 145 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $redirectPolicy = $model->getRedirect(); |
174 | 174 | |
175 | 175 | /* Make redirect when use in model config && Fix editable redirect */ |
176 | - if ($redirectPolicy->get('create') == 'display' || ! $model->isEditable($newModel)) { |
|
176 | + if ($redirectPolicy->get('create') == 'display' || !$model->isEditable($newModel)) { |
|
177 | 177 | $redirectUrl = $model->getDisplayUrl(); |
178 | 178 | } |
179 | 179 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | { |
209 | 209 | $item = $model->getRepository()->find($id); |
210 | 210 | |
211 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
211 | + if (is_null($item) || !$model->isEditable($item)) { |
|
212 | 212 | abort(404); |
213 | 213 | } |
214 | 214 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $editForm = $model->fireEdit($id); |
231 | 231 | $item = $editForm->getModel(); |
232 | 232 | |
233 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
233 | + if (is_null($item) || !$model->isEditable($item)) { |
|
234 | 234 | abort(404); |
235 | 235 | } |
236 | 236 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | $display = $model->fireDisplay(); |
300 | 300 | |
301 | 301 | /** @var ColumnEditableInterface|null $column */ |
302 | - $column = $display->getColumns()->all()->filter(function ($column) use ($field) { |
|
302 | + $column = $display->getColumns()->all()->filter(function($column) use ($field) { |
|
303 | 303 | return ($column instanceof ColumnEditableInterface) and $field == $column->getName(); |
304 | 304 | })->first(); |
305 | 305 | |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | $repository = $model->getRepository(); |
311 | 311 | $item = $repository->find($id); |
312 | 312 | |
313 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
313 | + if (is_null($item) || !$model->isEditable($item)) { |
|
314 | 314 | abort(404); |
315 | 315 | } |
316 | 316 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | { |
336 | 336 | $item = $model->getRepository()->find($id); |
337 | 337 | |
338 | - if (is_null($item) || ! $model->isDeletable($item)) { |
|
338 | + if (is_null($item) || !$model->isDeletable($item)) { |
|
339 | 339 | abort(404); |
340 | 340 | } |
341 | 341 | |
@@ -362,13 +362,13 @@ discard block |
||
362 | 362 | */ |
363 | 363 | public function deleteDestroy(ModelConfigurationInterface $model, Request $request, $id) |
364 | 364 | { |
365 | - if (! $model->isRestorableModel()) { |
|
365 | + if (!$model->isRestorableModel()) { |
|
366 | 366 | abort(404); |
367 | 367 | } |
368 | 368 | |
369 | 369 | $item = $model->getRepository()->findOnlyTrashed($id); |
370 | 370 | |
371 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
371 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
372 | 372 | abort(404); |
373 | 373 | } |
374 | 374 | |
@@ -395,13 +395,13 @@ discard block |
||
395 | 395 | */ |
396 | 396 | public function postRestore(ModelConfigurationInterface $model, Request $request, $id) |
397 | 397 | { |
398 | - if (! $model->isRestorableModel()) { |
|
398 | + if (!$model->isRestorableModel()) { |
|
399 | 399 | abort(404); |
400 | 400 | } |
401 | 401 | |
402 | 402 | $item = $model->getRepository()->findOnlyTrashed($id); |
403 | 403 | |
404 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
404 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
405 | 405 | abort(404); |
406 | 406 | } |
407 | 407 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | { |
468 | 468 | $lang = trans('sleeping_owl::lang'); |
469 | 469 | if ($lang == 'sleeping_owl::lang') { |
470 | - $lang = trans('sleeping_owl::lang', [], 'messages', 'en'); |
|
470 | + $lang = trans('sleeping_owl::lang', [ ], 'messages', 'en'); |
|
471 | 471 | } |
472 | 472 | |
473 | 473 | $data = [ |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | { |
511 | 511 | if (($backUrl = $request->input('_redirectBack')) == \URL::previous()) { |
512 | 512 | $backUrl = null; |
513 | - $request->merge(['_redirectBack' => $backUrl]); |
|
513 | + $request->merge([ '_redirectBack' => $backUrl ]); |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | return $backUrl; |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | */ |
528 | 528 | protected function registerBreadcrumb($title, $parent) |
529 | 529 | { |
530 | - Breadcrumbs::register('render', function ($breadcrumbs) use ($title, $parent) { |
|
530 | + Breadcrumbs::register('render', function($breadcrumbs) use ($title, $parent) { |
|
531 | 531 | $breadcrumbs->parent($parent); |
532 | 532 | $breadcrumbs->push($title); |
533 | 533 | }); |
@@ -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 | ?> |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * @var array |
32 | 32 | */ |
33 | - protected $validationRules = []; |
|
33 | + protected $validationRules = [ ]; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @var array |
37 | 37 | */ |
38 | - protected $validationMessages = []; |
|
38 | + protected $validationMessages = [ ]; |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * @var bool |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $rule = substr($rule, 0, $pos); |
73 | 73 | } |
74 | 74 | |
75 | - $this->validationMessages[$rule] = $message; |
|
75 | + $this->validationMessages[ $rule ] = $message; |
|
76 | 76 | |
77 | 77 | return $this; |
78 | 78 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function getValidationLabels() |
96 | 96 | { |
97 | - return []; |
|
97 | + return [ ]; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function addValidationRule($rule, $message = null) |
115 | 115 | { |
116 | - $this->validationRules[] = $rule; |
|
116 | + $this->validationRules[ ] = $rule; |
|
117 | 117 | |
118 | 118 | if (is_null($message)) { |
119 | 119 | return $this; |
@@ -129,11 +129,11 @@ discard block |
||
129 | 129 | */ |
130 | 130 | public function setValidationRules($validationRules) |
131 | 131 | { |
132 | - if (! is_array($validationRules)) { |
|
132 | + if (!is_array($validationRules)) { |
|
133 | 133 | $validationRules = func_get_args(); |
134 | 134 | } |
135 | 135 | |
136 | - $this->validationRules = []; |
|
136 | + $this->validationRules = [ ]; |
|
137 | 137 | foreach ($validationRules as $rule) { |
138 | 138 | $rules = explode('|', $rule); |
139 | 139 |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | { |
18 | 18 | $routeName = 'admin.form.element.dependent-select'; |
19 | 19 | |
20 | - if (! $router->has($routeName)) { |
|
21 | - $router->post('{adminModel}/dependent-select/{field}/{id?}', ['as' => $routeName, function ( |
|
20 | + if (!$router->has($routeName)) { |
|
21 | + $router->post('{adminModel}/dependent-select/{field}/{id?}', [ 'as' => $routeName, function( |
|
22 | 22 | Request $request, |
23 | 23 | ModelConfigurationInterface $model, |
24 | 24 | $field, |
25 | 25 | $id = null |
26 | 26 | ) { |
27 | - if (! is_null($id)) { |
|
27 | + if (!is_null($id)) { |
|
28 | 28 | $item = $model->getRepository()->find($id); |
29 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
29 | + if (is_null($item) || !$model->isEditable($item)) { |
|
30 | 30 | return new JsonResponse([ |
31 | 31 | 'message' => trans('lang.message.access_denied'), |
32 | 32 | ], 403); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | $form = $model->fireEdit($id); |
36 | 36 | } else { |
37 | - if (! $model->isCreatable()) { |
|
37 | + if (!$model->isCreatable()) { |
|
38 | 38 | return new JsonResponse([ |
39 | 39 | 'message' => trans('lang.message.access_denied'), |
40 | 40 | ], 403); |
@@ -50,24 +50,24 @@ discard block |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | $element->setAjaxParameters( |
53 | - $request->input('depdrop_all_params', []) |
|
53 | + $request->input('depdrop_all_params', [ ]) |
|
54 | 54 | ); |
55 | 55 | |
56 | 56 | $options = $element->getOptions(); |
57 | 57 | |
58 | 58 | if ($element->isNullable()) { |
59 | - $options = [null => trans('sleeping_owl::lang.select.nothing')] + $options; |
|
59 | + $options = [ null => trans('sleeping_owl::lang.select.nothing') ] + $options; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $options = array_except($options, $element->exclude); |
63 | 63 | |
64 | 64 | return new JsonResponse([ |
65 | - 'output' => collect($options)->map(function ($value, $key) { |
|
66 | - return ['id' => $key, 'name' => $value]; |
|
65 | + 'output' => collect($options)->map(function($value, $key) { |
|
66 | + return [ 'id' => $key, 'name' => $value ]; |
|
67 | 67 | }), |
68 | 68 | 'selected' => $element->getValue(), |
69 | 69 | ]); |
70 | - }]); |
|
70 | + } ]); |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | /** |
80 | 80 | * @var array |
81 | 81 | */ |
82 | - protected $dataDepends = []; |
|
82 | + protected $dataDepends = [ ]; |
|
83 | 83 | |
84 | 84 | /** |
85 | 85 | * @var array |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | * @param null $label |
94 | 94 | * @param array $depends |
95 | 95 | */ |
96 | - public function __construct($path, $label = null, array $depends = []) |
|
96 | + public function __construct($path, $label = null, array $depends = [ ]) |
|
97 | 97 | { |
98 | - parent::__construct($path, $label, []); |
|
98 | + parent::__construct($path, $label, [ ]); |
|
99 | 99 | |
100 | 100 | $this->setDataDepends($depends); |
101 | 101 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | ]; |
180 | 180 | |
181 | 181 | if ($this->isReadonly()) { |
182 | - $attributes['disabled'] = 'disabled'; |
|
182 | + $attributes[ 'disabled' ] = 'disabled'; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | return [ |