@@ -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 \SleepingOwl\Admin\Templates\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 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $this->app[WidgetsRegistryInterface::class]->registerWidget($messageType); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - $this->app->singleton('sleeping_owl.message', function () use ($messageTypes) { |
|
| 124 | + $this->app->singleton('sleeping_owl.message', function() use ($messageTypes) { |
|
| 125 | 125 | return new \SleepingOwl\Admin\Widgets\Messages\MessageStack($messageTypes); |
| 126 | 126 | }); |
| 127 | 127 | } |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | $this->app->bind(\KodiComponents\Navigation\Contracts\PageInterface::class, \SleepingOwl\Admin\Navigation\Page::class); |
| 136 | 136 | $this->app->bind(\KodiComponents\Navigation\Contracts\BadgeInterface::class, \SleepingOwl\Admin\Navigation\Badge::class); |
| 137 | 137 | |
| 138 | - $this->app->singleton('sleeping_owl.navigation', function () { |
|
| 138 | + $this->app->singleton('sleeping_owl.navigation', function() { |
|
| 139 | 139 | return new \SleepingOwl\Admin\Navigation(); |
| 140 | 140 | }); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | protected function registerWysiwyg() |
| 144 | 144 | { |
| 145 | - $this->app->singleton('sleeping_owl.wysiwyg', function () { |
|
| 145 | + $this->app->singleton('sleeping_owl.wysiwyg', function() { |
|
| 146 | 146 | return new \SleepingOwl\Admin\Wysiwyg\Manager($this->app); |
| 147 | 147 | }); |
| 148 | 148 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | { |
| 155 | 155 | $directory = $this->getBootstrapPath(); |
| 156 | 156 | |
| 157 | - if (! is_dir($directory)) { |
|
| 157 | + if (!is_dir($directory)) { |
|
| 158 | 158 | return; |
| 159 | 159 | } |
| 160 | 160 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | ->notName('routes.php') |
| 165 | 165 | ->notName('navigation.php') |
| 166 | 166 | ->in($directory) |
| 167 | - ->sort(function ($a) { |
|
| 167 | + ->sort(function($a) { |
|
| 168 | 168 | return $a->getFilename() != 'bootstrap.php'; |
| 169 | 169 | }); |
| 170 | 170 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | protected function registerCustomRoutes() |
| 182 | 182 | { |
| 183 | 183 | if (file_exists($file = $this->getBootstrapPath('routes.php'))) { |
| 184 | - $this->registerRoutes(function (Router $route) use ($file) { |
|
| 184 | + $this->registerRoutes(function(Router $route) use ($file) { |
|
| 185 | 185 | require $file; |
| 186 | 186 | }); |
| 187 | 187 | } |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | protected function registerDefaultRoutes() |
| 191 | 191 | { |
| 192 | - $this->registerRoutes(function (Router $router) { |
|
| 192 | + $this->registerRoutes(function(Router $router) { |
|
| 193 | 193 | (new ModelRouter($this->app, $router))->register($this->app['sleeping_owl']->getModels()); |
| 194 | 194 | |
| 195 | 195 | if (file_exists($routesFile = __DIR__.'/../Http/routes.php')) { |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | $this->app['router']->group([ |
| 209 | 209 | 'prefix' => $this->getConfig('url_prefix'), |
| 210 | 210 | 'middleware' => $this->getConfig('middleware'), |
| 211 | - ], function ($route) use ($callback) { |
|
| 211 | + ], function($route) use ($callback) { |
|
| 212 | 212 | call_user_func($callback, $route); |
| 213 | 213 | }); |
| 214 | 214 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! function_exists('resources_url')) { |
|
| 3 | +if (!function_exists('resources_url')) { |
|
| 4 | 4 | /** |
| 5 | 5 | * @param string $path |
| 6 | 6 | * |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | - * @param mixed $value |
|
| 63 | + * @param string $value |
|
| 64 | 64 | * |
| 65 | 65 | * @return mixed |
| 66 | 66 | */ |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
| 168 | - * @param OrderByClauseInterface|bool $orderable |
|
| 168 | + * @param Closure $orderable |
|
| 169 | 169 | * @deprecated |
| 170 | 170 | * @return $this |
| 171 | 171 | */ |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | /** |
| 196 | 196 | * Get column value from instance. |
| 197 | 197 | * |
| 198 | - * @param Collection|Model|Closure $instance |
|
| 198 | + * @param Model $instance |
|
| 199 | 199 | * @param string $name |
| 200 | 200 | * |
| 201 | 201 | * @return mixed |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | /** |
| 77 | 77 | * Load Relations by this->name. |
| 78 | 78 | * @param Builder $query |
| 79 | - * @param $direction |
|
| 79 | + * @param string $direction |
|
| 80 | 80 | */ |
| 81 | 81 | protected function loadRelationOrder(Builder $query, $direction) |
| 82 | 82 | { |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | - * @return mixed |
|
| 110 | + * @return Badge|null |
|
| 111 | 111 | */ |
| 112 | 112 | public function getBadge() |
| 113 | 113 | { |
@@ -74,15 +74,15 @@ |
||
| 74 | 74 | { |
| 75 | 75 | $this->content = $content; |
| 76 | 76 | |
| 77 | - if (! is_null($label)) { |
|
| 77 | + if (!is_null($label)) { |
|
| 78 | 78 | $this->setLabel($label); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - if (! is_null($icon)) { |
|
| 81 | + if (!is_null($icon)) { |
|
| 82 | 82 | $this->setIcon($icon); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - if (! is_null($badge)) { |
|
| 85 | + if (!is_null($badge)) { |
|
| 86 | 86 | $this->setBadge($badge); |
| 87 | 87 | } |
| 88 | 88 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
| 133 | - * @return string |
|
| 133 | + * @return integer |
|
| 134 | 134 | */ |
| 135 | 135 | public function getMaxDepth() |
| 136 | 136 | { |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | /** |
| 363 | - * @param \Illuminate\Database\Eloquent\Builder|Builder $query |
|
| 363 | + * @param \Illuminate\Database\Eloquent\Builder $query |
|
| 364 | 364 | */ |
| 365 | 365 | protected function modifyQuery(\Illuminate\Database\Eloquent\Builder $query) |
| 366 | 366 | { |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | /** |
| 371 | - * @return \Illuminate\Foundation\Application|mixed |
|
| 371 | + * @return TreeRepositoryInterface |
|
| 372 | 372 | * @throws \Exception |
| 373 | 373 | */ |
| 374 | 374 | protected function makeRepository() |
@@ -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 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * |
| 35 | 35 | * @param \Illuminate\Database\Eloquent\Collection $collection |
| 36 | 36 | * |
| 37 | - * @return mixed |
|
| 37 | + * @return Collection |
|
| 38 | 38 | */ |
| 39 | 39 | public function getTree(\Illuminate\Database\Eloquent\Collection $collection) |
| 40 | 40 | { |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | * Get children for simple tree type structure. |
| 88 | 88 | * |
| 89 | 89 | * @param $collection |
| 90 | - * @param $id |
|
| 90 | + * @param string $id |
|
| 91 | 91 | * |
| 92 | 92 | * @return Collection |
| 93 | 93 | */ |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Get Field name for search url. |
| 44 | - * @return mixed |
|
| 44 | + * @return string |
|
| 45 | 45 | */ |
| 46 | 46 | public function getFieldName() |
| 47 | 47 | { |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | parent::__construct($path, $label, $options); |
| 32 | 32 | |
| 33 | - $this->setLoadOptionsQueryPreparer(function ($item, $query) { |
|
| 33 | + $this->setLoadOptionsQueryPreparer(function($item, $query) { |
|
| 34 | 34 | $repository = app(RepositoryInterface::class); |
| 35 | 35 | $repository->setModel($this->getModelForOptions()); |
| 36 | 36 | $key = $repository->getModel()->getKeyName(); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | { |
| 81 | 81 | $routeName = 'admin.form.element.'.static::$route; |
| 82 | 82 | |
| 83 | - if (! $router->has($routeName)) { |
|
| 83 | + if (!$router->has($routeName)) { |
|
| 84 | 84 | $router->post('{adminModel}/'.static::$route.'/{field}/{id?}', [ |
| 85 | 85 | 'as' => $routeName, |
| 86 | 86 | 'uses' => 'SleepingOwl\Admin\Http\Controllers\FormElementController@multiselectSearch', |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | $options = $repository->getQuery(); |
| 140 | 140 | $relation = $this->getModelAttributeKey(); |
| 141 | 141 | |
| 142 | - if ($this->isEmptyRelation() and ! is_null($foreignKey = $this->getForeignKey())) { |
|
| 142 | + if ($this->isEmptyRelation() and !is_null($foreignKey = $this->getForeignKey())) { |
|
| 143 | 143 | $model = $this->getModel(); |
| 144 | 144 | |
| 145 | 145 | if ($model->{$relation}() instanceof HasOneOrMany) { |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | // call the pre load options query preparer if has be set |
| 157 | - if (! is_null($preparer = $this->getLoadOptionsQueryPreparer())) { |
|
| 157 | + if (!is_null($preparer = $this->getLoadOptionsQueryPreparer())) { |
|
| 158 | 158 | $options = $preparer($this, $options); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | // iterate for all options and redefine it as |
| 174 | 174 | // list of KEY and TEXT pair |
| 175 | - $options = array_map(function ($opt) use ($key, $makeDisplay) { |
|
| 175 | + $options = array_map(function($opt) use ($key, $makeDisplay) { |
|
| 176 | 176 | // get the KEY and make the display text |
| 177 | 177 | return [data_get($opt, $key), $makeDisplay($opt)]; |
| 178 | 178 | }, $options); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | { |
| 200 | 200 | $attribute = $this->getModelAttributeKey(); |
| 201 | 201 | |
| 202 | - if (! method_exists($this->getModel(), $attribute)) { |
|
| 202 | + if (!method_exists($this->getModel(), $attribute)) { |
|
| 203 | 203 | return; |
| 204 | 204 | } |
| 205 | 205 | |