@@ -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 | }); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('resources_url')) { |
|
3 | +if (!function_exists('resources_url')) { |
|
4 | 4 | function resources_url($path) |
5 | 5 | { |
6 | 6 | return '/packages/sleepingowl/default/'.$path; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function modelAliases() |
35 | 35 | { |
36 | - return array_map(function (ModelConfigurationInterface $model) { |
|
36 | + return array_map(function(ModelConfigurationInterface $model) { |
|
37 | 37 | return $model->getAlias(); |
38 | 38 | }, $this->getModels()); |
39 | 39 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $class = get_class($class); |
82 | 82 | } |
83 | 83 | |
84 | - if (! $this->hasModel($class)) { |
|
84 | + if (!$this->hasModel($class)) { |
|
85 | 85 | $this->registerModel($class); |
86 | 86 | } |
87 | 87 |
@@ -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,17 +37,17 @@ 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 () { |
|
44 | + $this->app->booted(function() { |
|
45 | 45 | $this->app[WidgetsRegistryInterface::class]->placeWidgets( |
46 | 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(); |
@@ -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 () { |
|
87 | + $this->app->singleton('sleeping_owl.template', function() { |
|
88 | 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', |
@@ -112,7 +112,7 @@ discard block |
||
112 | 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 | |
@@ -172,7 +172,7 @@ discard block |
||
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,7 +180,7 @@ 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 | 186 | $aliases = $this->app['sleeping_owl']->modelAliases(); |
@@ -188,7 +188,7 @@ discard block |
||
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) { |
@@ -228,7 +228,7 @@ discard block |
||
228 | 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 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function setOperator($operator) |
56 | 56 | { |
57 | - if (! array_key_exists($operator, $this->sqlOperators)) { |
|
57 | + if (!array_key_exists($operator, $this->sqlOperators)) { |
|
58 | 58 | throw new FilterOperatorException("Operator [$operator] not found"); |
59 | 59 | } |
60 | 60 | |
@@ -117,13 +117,13 @@ discard block |
||
117 | 117 | break; |
118 | 118 | case 'whereBetween': |
119 | 119 | case 'whereNotBetween': |
120 | - if (! is_array($value)) { |
|
120 | + if (!is_array($value)) { |
|
121 | 121 | $value = explode(',', $value, 2); |
122 | 122 | } |
123 | 123 | break; |
124 | 124 | case 'whereIn': |
125 | 125 | case 'whereNotIn': |
126 | - if (! is_array($value)) { |
|
126 | + if (!is_array($value)) { |
|
127 | 127 | $value = explode(',', $value); |
128 | 128 | } |
129 | 129 | break; |
@@ -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 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | protected function setModelForElements(Model $model) |
137 | 137 | { |
138 | - $this->getElements()->each(function ($element) use ($model) { |
|
138 | + $this->getElements()->each(function($element) use ($model) { |
|
139 | 139 | $element = $this->getElementContainer($element); |
140 | 140 | |
141 | 141 | if ($element instanceof WithModel) { |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | protected function getValidationRulesFromElements(array $rules = []) |
155 | 155 | { |
156 | - $this->getElements()->onlyActive()->each(function ($element) use (&$rules) { |
|
156 | + $this->getElements()->onlyActive()->each(function($element) use (&$rules) { |
|
157 | 157 | $element = $this->getElementContainer($element); |
158 | 158 | |
159 | 159 | if ($element instanceof Validable) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | protected function getValidationMessagesForElements(array $messages = []) |
173 | 173 | { |
174 | - $this->getElements()->onlyActive()->each(function ($element) use (&$messages) { |
|
174 | + $this->getElements()->onlyActive()->each(function($element) use (&$messages) { |
|
175 | 175 | $element = $this->getElementContainer($element); |
176 | 176 | |
177 | 177 | if ($element instanceof Validable) { |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | */ |
190 | 190 | protected function getValidationLabelsForElements(array $labels = []) |
191 | 191 | { |
192 | - $this->getElements()->onlyActive()->each(function ($element) use (&$labels) { |
|
192 | + $this->getElements()->onlyActive()->each(function($element) use (&$labels) { |
|
193 | 193 | $element = $this->getElementContainer($element); |
194 | 194 | |
195 | 195 | if ($element instanceof Validable) { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | protected function saveElements() |
204 | 204 | { |
205 | - $this->getElements()->onlyActive()->each(function ($element) { |
|
205 | + $this->getElements()->onlyActive()->each(function($element) { |
|
206 | 206 | $element = $this->getElementContainer($element); |
207 | 207 | |
208 | 208 | if ($element instanceof FormElementInterface) { |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | |
214 | 214 | protected function afterSaveElements() |
215 | 215 | { |
216 | - $this->getElements()->onlyActive()->each(function ($element) { |
|
216 | + $this->getElements()->onlyActive()->each(function($element) { |
|
217 | 217 | $element = $this->getElementContainer($element); |
218 | 218 | |
219 | 219 | if ($element instanceof FormElementInterface) { |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function getEditor($editorId) |
69 | 69 | { |
70 | - return $this->getFilters()->filter(function (WysiwygEditorInterface $editor) use ($editorId) { |
|
70 | + return $this->getFilters()->filter(function(WysiwygEditorInterface $editor) use ($editorId) { |
|
71 | 71 | return $editor->getId() == $editorId; |
72 | 72 | })->first(); |
73 | 73 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function loadEditor($editorId) |
86 | 86 | { |
87 | - if (! is_null($editor = $this->getEditor($editorId))) { |
|
87 | + if (!is_null($editor = $this->getEditor($editorId))) { |
|
88 | 88 | if ($editor->isUsed()) { |
89 | 89 | return true; |
90 | 90 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function applyFilter($editorId, $text) |
106 | 106 | { |
107 | - if (! is_null($editor = $this->getEditor($editorId))) { |
|
107 | + if (!is_null($editor = $this->getEditor($editorId))) { |
|
108 | 108 | return $editor->applyFilter($text); |
109 | 109 | } |
110 | 110 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function fireDisplay() |
34 | 34 | { |
35 | - if (! method_exists($this, 'onDisplay')) { |
|
35 | + if (!method_exists($this, 'onDisplay')) { |
|
36 | 36 | return; |
37 | 37 | } |
38 | 38 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function fireCreate() |
53 | 53 | { |
54 | - if (! method_exists($this, 'onCreate')) { |
|
54 | + if (!method_exists($this, 'onCreate')) { |
|
55 | 55 | return; |
56 | 56 | } |
57 | 57 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function fireEdit($id) |
80 | 80 | { |
81 | - if (! method_exists($this, 'onEdit')) { |
|
81 | + if (!method_exists($this, 'onEdit')) { |
|
82 | 82 | return; |
83 | 83 | } |
84 | 84 |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | $this->repository = app(RepositoryInterface::class, [$class]); |
112 | 112 | |
113 | - if (! $this->alias) { |
|
113 | + if (!$this->alias) { |
|
114 | 114 | $this->setDefaultAlias(); |
115 | 115 | } |
116 | 116 | } |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | */ |
300 | 300 | public function can($action, Model $model) |
301 | 301 | { |
302 | - if (! $this->checkAccess) { |
|
302 | + if (!$this->checkAccess) { |
|
303 | 303 | return true; |
304 | 304 | } |
305 | 305 | |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | */ |
332 | 332 | public function hasCustomControllerClass() |
333 | 333 | { |
334 | - return ! is_null($controller = $this->getControllerClass()) and class_exists($controller); |
|
334 | + return !is_null($controller = $this->getControllerClass()) and class_exists($controller); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | /** |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | $page->setPriority($priority); |
469 | 469 | |
470 | 470 | if ($badge) { |
471 | - if (! ($badge instanceof BadgeInterface)) { |
|
471 | + if (!($badge instanceof BadgeInterface)) { |
|
472 | 472 | $badge = new Badge($badge); |
473 | 473 | } |
474 | 474 | |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | */ |
512 | 512 | public function fireEvent($event, $halt = true, Model $model = null, ...$payload) |
513 | 513 | { |
514 | - if (! isset(self::$dispatcher)) { |
|
514 | + if (!isset(self::$dispatcher)) { |
|
515 | 515 | return true; |
516 | 516 | } |
517 | 517 |