@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | $this->controlActive = false; |
92 | 92 | |
93 | 93 | if ($this->isInitialize()) { |
94 | - $this->columns = $this->columns->filter(function ($column) { |
|
94 | + $this->columns = $this->columns->filter(function($column) { |
|
95 | 95 | $class = get_class($this->getControlColumn()); |
96 | 96 | |
97 | - return ! ($column instanceof $class); |
|
97 | + return !($column instanceof $class); |
|
98 | 98 | }); |
99 | 99 | } |
100 | 100 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function set($columns) |
118 | 118 | { |
119 | - if (! is_array($columns)) { |
|
119 | + if (!is_array($columns)) { |
|
120 | 120 | $columns = func_get_args(); |
121 | 121 | } |
122 | 122 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | public function initialize() |
164 | 164 | { |
165 | - $this->all()->each(function (ColumnInterface $column) { |
|
165 | + $this->all()->each(function(ColumnInterface $column) { |
|
166 | 166 | $column->initialize(); |
167 | 167 | }); |
168 | 168 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | |
205 | 205 | $columns = $this->all(); |
206 | 206 | |
207 | - if (! is_int(key($orders))) { |
|
207 | + if (!is_int(key($orders))) { |
|
208 | 208 | $orders = [$orders]; |
209 | 209 | } |
210 | 210 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $columnIndex = array_get($order, 'column'); |
213 | 213 | $direction = array_get($order, 'dir', 'asc'); |
214 | 214 | |
215 | - if (! $columnIndex && $columnIndex !== '0') { |
|
215 | + if (!$columnIndex && $columnIndex !== '0') { |
|
216 | 216 | continue; |
217 | 217 | } |
218 | 218 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function set($columnFilters) |
37 | 37 | { |
38 | - if (! is_array($columnFilters)) { |
|
38 | + if (!is_array($columnFilters)) { |
|
39 | 39 | $columnFilters = func_get_args(); |
40 | 40 | } |
41 | 41 | |
@@ -173,13 +173,13 @@ discard block |
||
173 | 173 | |
174 | 174 | $display = $this->getDisplay(); |
175 | 175 | |
176 | - if (! $display->getExtensions()->has('columns')) { |
|
176 | + if (!$display->getExtensions()->has('columns')) { |
|
177 | 177 | return; |
178 | 178 | } |
179 | 179 | |
180 | 180 | $columns = $display->getColumns()->all(); |
181 | 181 | |
182 | - if (! is_int(key($search))) { |
|
182 | + if (!is_int(key($search))) { |
|
183 | 183 | $search = [$search]; |
184 | 184 | } |
185 | 185 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | protected function prepareView() |
218 | 218 | { |
219 | - if (! in_array($this->getPlacement(), ['table.footer', 'table.header']) && $this->view == 'display.extensions.columns_filters_table') { |
|
219 | + if (!in_array($this->getPlacement(), ['table.footer', 'table.header']) && $this->view == 'display.extensions.columns_filters_table') { |
|
220 | 220 | $this->view = 'display.extensions.columns_filters'; |
221 | 221 | $this->setHtmlAttribute('class', 'table table-default'); |
222 | 222 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | parent::initialize(); |
71 | 71 | |
72 | 72 | if ($this->getModelConfiguration()->isRestorableModel()) { |
73 | - $this->setApply(function ($q) { |
|
73 | + $this->setApply(function($q) { |
|
74 | 74 | return $q->withTrashed(); |
75 | 75 | }); |
76 | 76 | } |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function getCollection() |
194 | 194 | { |
195 | - if (! $this->isInitialized()) { |
|
195 | + if (!$this->isInitialized()) { |
|
196 | 196 | throw new \Exception('Display is not initialized'); |
197 | 197 | } |
198 | 198 | |
199 | - if (! is_null($this->collection)) { |
|
199 | + if (!is_null($this->collection)) { |
|
200 | 200 | return $this->collection; |
201 | 201 | } |
202 | 202 |
@@ -12,7 +12,6 @@ |
||
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Class DisplayTable. |
15 | - |
|
16 | 15 | * @method Columns getColumns() |
17 | 16 | * @method $this setColumns(ColumnInterface|ColumnInterface[] $column) |
18 | 17 | * |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public function placable() |
17 | 17 | { |
18 | - return $this->filter(function (DisplayExtensionInterface $extension) { |
|
18 | + return $this->filter(function(DisplayExtensionInterface $extension) { |
|
19 | 19 | return $extension instanceof Placable; |
20 | 20 | }); |
21 | 21 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function renderable() |
44 | 44 | { |
45 | - return $this->filter(function (DisplayExtensionInterface $extension) { |
|
45 | + return $this->filter(function(DisplayExtensionInterface $extension) { |
|
46 | 46 | return $extension instanceof Renderable; |
47 | 47 | }); |
48 | 48 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function sortByOrder() |
54 | 54 | { |
55 | - return $this->sortBy(function (DisplayExtensionInterface $extension) { |
|
55 | + return $this->sortBy(function(DisplayExtensionInterface $extension) { |
|
56 | 56 | return $extension->getOrder(); |
57 | 57 | }); |
58 | 58 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function initialize() |
64 | 64 | { |
65 | - $this->each(function (DisplayExtensionInterface $extension) { |
|
65 | + $this->each(function(DisplayExtensionInterface $extension) { |
|
66 | 66 | if ($extension instanceof Initializable) { |
67 | 67 | $extension->initialize(); |
68 | 68 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function modifyQuery(\Illuminate\Database\Eloquent\Builder $query) |
78 | 78 | { |
79 | - $this->each(function (DisplayExtensionInterface $extension) use ($query) { |
|
79 | + $this->each(function(DisplayExtensionInterface $extension) use ($query) { |
|
80 | 80 | $extension->modifyQuery($query); |
81 | 81 | }); |
82 | 82 |
@@ -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) { |
@@ -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 |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
121 | - * @param mixed $distinct |
|
121 | + * @param string|null $distinct |
|
122 | 122 | * |
123 | 123 | * @return $this |
124 | 124 | */ |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * Apply offset and limit to the query. |
164 | 164 | * |
165 | - * @param $query |
|
165 | + * @param Builder $query |
|
166 | 166 | * @param \Illuminate\Http\Request $request |
167 | 167 | */ |
168 | 168 | protected function applyOffset($query, \Illuminate\Http\Request $request) |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * Convert collection to the datatables structure. |
205 | 205 | * |
206 | 206 | * @param \Illuminate\Http\Request $request |
207 | - * @param array|Collection $collection |
|
207 | + * @param Collection $collection |
|
208 | 208 | * @param int $totalCount |
209 | 209 | * @param int $filteredCount |
210 | 210 | * |
@@ -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)) { |
@@ -54,7 +54,7 @@ |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | - * @return Manager |
|
57 | + * @return Breadcrumbs |
|
58 | 58 | */ |
59 | 59 | public function breadcrumbs() |
60 | 60 | { |