@@ -46,7 +46,7 @@ |
||
| 46 | 46 | public function toArray() |
| 47 | 47 | { |
| 48 | 48 | $value = $this->getModelValue(); |
| 49 | - if (! empty($value) && (strpos($value, '://') === false)) { |
|
| 49 | + if (!empty($value) && (strpos($value, '://') === false)) { |
|
| 50 | 50 | $value = asset($value); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | { |
| 69 | 69 | $value = $this->getModelValue($this->getModel(), $this->getField()); |
| 70 | 70 | |
| 71 | - return app('sleeping_owl')->getModel($this->getRelatedModel())->getDisplayUrl([$this->getName() => $value]); |
|
| 71 | + return app('sleeping_owl')->getModel($this->getRelatedModel())->getDisplayUrl([ $this->getName() => $value ]); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -87,11 +87,11 @@ |
||
| 87 | 87 | |
| 88 | 88 | if ($instance instanceof Collection) { |
| 89 | 89 | $instance = $instance->pluck($part); |
| 90 | - } elseif (! is_null($instance)) { |
|
| 90 | + } elseif (!is_null($instance)) { |
|
| 91 | 91 | $instance = $instance->getAttribute($part); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - if (! empty($parts) && ! is_null($instance)) { |
|
| 94 | + if (!empty($parts) && !is_null($instance)) { |
|
| 95 | 95 | return $this->getValueFromObject($instance, implode('.', $parts)); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | /** |
| 72 | 72 | * Get column value from instance. |
| 73 | 73 | * |
| 74 | - * @param Collection|Model|Closure $instance |
|
| 74 | + * @param Model $instance |
|
| 75 | 75 | * @param string $name |
| 76 | 76 | * |
| 77 | 77 | * @return mixed |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function set($filters) |
| 42 | 42 | { |
| 43 | - if (! is_array($filters)) { |
|
| 43 | + if (!is_array($filters)) { |
|
| 44 | 44 | $filters = func_get_args(); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function getActive() |
| 80 | 80 | { |
| 81 | - return $this->filters->filter(function (FilterInterface $filter) { |
|
| 81 | + return $this->filters->filter(function(FilterInterface $filter) { |
|
| 82 | 82 | return $filter->isActive(); |
| 83 | 83 | }); |
| 84 | 84 | } |
@@ -100,10 +100,10 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function getTitle() |
| 102 | 102 | { |
| 103 | - $titles = [$this->title]; |
|
| 103 | + $titles = [ $this->title ]; |
|
| 104 | 104 | |
| 105 | - $this->getActive()->each(function (FilterInterface $filter) use (&$titles) { |
|
| 106 | - $titles[] = $filter->getTitle(); |
|
| 105 | + $this->getActive()->each(function(FilterInterface $filter) use (&$titles) { |
|
| 106 | + $titles[ ] = $filter->getTitle(); |
|
| 107 | 107 | }); |
| 108 | 108 | |
| 109 | 109 | return implode(' | ', array_filter($titles)); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function modifyQuery(\Illuminate\Database\Eloquent\Builder $query) |
| 129 | 129 | { |
| 130 | - $this->getActive()->each(function (FilterInterface $filter) use ($query) { |
|
| 130 | + $this->getActive()->each(function(FilterInterface $filter) use ($query) { |
|
| 131 | 131 | $filter->apply($query); |
| 132 | 132 | }); |
| 133 | 133 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | public function initialize() |
| 139 | 139 | { |
| 140 | - $this->filters->each(function (FilterInterface $filter) { |
|
| 140 | + $this->filters->each(function(FilterInterface $filter) { |
|
| 141 | 141 | $filter->initialize(); |
| 142 | 142 | }); |
| 143 | 143 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function set($actions) |
| 51 | 51 | { |
| 52 | - if (! is_array($actions)) { |
|
| 52 | + if (!is_array($actions)) { |
|
| 53 | 53 | $actions = func_get_args(); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -145,13 +145,13 @@ discard block |
||
| 145 | 145 | return; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - $this->all()->each(function (ActionInterface $action) { |
|
| 148 | + $this->all()->each(function(ActionInterface $action) { |
|
| 149 | 149 | $action->initialize(); |
| 150 | 150 | }); |
| 151 | 151 | |
| 152 | 152 | $this->setHtmlAttribute('data-type', 'display-actions'); |
| 153 | 153 | |
| 154 | - if (! $this->hasHtmlAttribute('class')) { |
|
| 154 | + if (!$this->hasHtmlAttribute('class')) { |
|
| 155 | 155 | $this->setHtmlAttribute('class', 'panel-footer'); |
| 156 | 156 | } |
| 157 | 157 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | /** |
| 23 | 23 | * @param array|string $scopes |
| 24 | 24 | * |
| 25 | - * @return $this |
|
| 25 | + * @return \SleepingOwl\Admin\Contracts\DisplayInterface |
|
| 26 | 26 | */ |
| 27 | 27 | public function set($scopes) |
| 28 | 28 | { |
@@ -152,7 +152,7 @@ |
||
| 152 | 152 | |
| 153 | 153 | public function initialize() |
| 154 | 154 | { |
| 155 | - $this->allWithControl()->each(function (ColumnInterface $column) { |
|
| 155 | + $this->allWithControl()->each(function(ColumnInterface $column) { |
|
| 156 | 156 | $column->initialize(); |
| 157 | 157 | }); |
| 158 | 158 | |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | /** |
| 10 | 10 | * @var Closure[] |
| 11 | 11 | */ |
| 12 | - protected $applies = []; |
|
| 12 | + protected $applies = [ ]; |
|
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * @return Closure[] |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function set($applies) |
| 28 | 28 | { |
| 29 | - if (! is_array($applies)) { |
|
| 29 | + if (!is_array($applies)) { |
|
| 30 | 30 | $applies = func_get_args(); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function push(Closure $apply) |
| 46 | 46 | { |
| 47 | - $this->applies[] = $apply; |
|
| 47 | + $this->applies[ ] = $apply; |
|
| 48 | 48 | |
| 49 | 49 | return $this; |
| 50 | 50 | } |
@@ -103,9 +103,9 @@ discard block |
||
| 103 | 103 | $this->class = $class; |
| 104 | 104 | $this->model = app($class); |
| 105 | 105 | |
| 106 | - $this->repository = app(RepositoryInterface::class, [$class]); |
|
| 106 | + $this->repository = app(RepositoryInterface::class, [ $class ]); |
|
| 107 | 107 | |
| 108 | - if (! $this->alias) { |
|
| 108 | + if (!$this->alias) { |
|
| 109 | 109 | $this->setDefaultAlias(); |
| 110 | 110 | } |
| 111 | 111 | } |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | public function getCreateTitle() |
| 182 | 182 | { |
| 183 | - return trans('sleeping_owl::lang.model.create', ['title' => $this->getTitle()]); |
|
| 183 | + return trans('sleeping_owl::lang.model.create', [ 'title' => $this->getTitle() ]); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /** |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | public function getEditTitle() |
| 190 | 190 | { |
| 191 | - return trans('sleeping_owl::lang.model.edit', ['title' => $this->getTitle()]); |
|
| 191 | + return trans('sleeping_owl::lang.model.edit', [ 'title' => $this->getTitle() ]); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | */ |
| 264 | 264 | public function can($action, Model $model) |
| 265 | 265 | { |
| 266 | - if (! $this->checkAccess) { |
|
| 266 | + if (!$this->checkAccess) { |
|
| 267 | 267 | return true; |
| 268 | 268 | } |
| 269 | 269 | |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | */ |
| 284 | 284 | public function hasCustomControllerClass() |
| 285 | 285 | { |
| 286 | - return ! is_null($controller = $this->getControllerClass()) and class_exists($controller); |
|
| 286 | + return !is_null($controller = $this->getControllerClass()) and class_exists($controller); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | /** |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | * |
| 292 | 292 | * @return string |
| 293 | 293 | */ |
| 294 | - public function getDisplayUrl(array $parameters = []) |
|
| 294 | + public function getDisplayUrl(array $parameters = [ ]) |
|
| 295 | 295 | { |
| 296 | 296 | array_unshift($parameters, $this->getAlias()); |
| 297 | 297 | |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | * |
| 304 | 304 | * @return string |
| 305 | 305 | */ |
| 306 | - public function getCreateUrl(array $parameters = []) |
|
| 306 | + public function getCreateUrl(array $parameters = [ ]) |
|
| 307 | 307 | { |
| 308 | 308 | array_unshift($parameters, $this->getAlias()); |
| 309 | 309 | |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | */ |
| 326 | 326 | public function getEditUrl($id) |
| 327 | 327 | { |
| 328 | - return route('admin.model.edit', [$this->getAlias(), $id]); |
|
| 328 | + return route('admin.model.edit', [ $this->getAlias(), $id ]); |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | /** |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | */ |
| 336 | 336 | public function getUpdateUrl($id) |
| 337 | 337 | { |
| 338 | - return route('admin.model.update', [$this->getAlias(), $id]); |
|
| 338 | + return route('admin.model.update', [ $this->getAlias(), $id ]); |
|
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | /** |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | */ |
| 346 | 346 | public function getDeleteUrl($id) |
| 347 | 347 | { |
| 348 | - return route('admin.model.delete', [$this->getAlias(), $id]); |
|
| 348 | + return route('admin.model.delete', [ $this->getAlias(), $id ]); |
|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | /** |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | */ |
| 356 | 356 | public function getDestroyUrl($id) |
| 357 | 357 | { |
| 358 | - return route('admin.model.destroy', [$this->getAlias(), $id]); |
|
| 358 | + return route('admin.model.destroy', [ $this->getAlias(), $id ]); |
|
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | /** |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | */ |
| 366 | 366 | public function getRestoreUrl($id) |
| 367 | 367 | { |
| 368 | - return route('admin.model.restore', [$this->getAlias(), $id]); |
|
| 368 | + return route('admin.model.restore', [ $this->getAlias(), $id ]); |
|
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | /** |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | $page->setPriority($priority); |
| 421 | 421 | |
| 422 | 422 | if ($badge) { |
| 423 | - if (! ($badge instanceof BadgeInterface)) { |
|
| 423 | + if (!($badge instanceof BadgeInterface)) { |
|
| 424 | 424 | $badge = new Badge($badge); |
| 425 | 425 | } |
| 426 | 426 | |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | */ |
| 444 | 444 | public function fireEvent($event, $halt = true, Model $model = null) |
| 445 | 445 | { |
| 446 | - if (! isset(self::$dispatcher)) { |
|
| 446 | + if (!isset(self::$dispatcher)) { |
|
| 447 | 447 | return true; |
| 448 | 448 | } |
| 449 | 449 | |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | |
| 459 | 459 | $method = $halt ? 'until' : 'fire'; |
| 460 | 460 | |
| 461 | - return self::$dispatcher->$method($event, [$this, $model]); |
|
| 461 | + return self::$dispatcher->$method($event, [ $this, $model ]); |
|
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | /** |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | ])) { |
| 478 | 478 | array_unshift($arguments, $method); |
| 479 | 479 | |
| 480 | - return call_user_func_array([$this, 'registerEvent'], $arguments); |
|
| 480 | + return call_user_func_array([ $this, 'registerEvent' ], $arguments); |
|
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | throw new BadMethodCallException($method); |
@@ -290,7 +290,7 @@ |
||
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | /** |
| 293 | - * @return null|string |
|
| 293 | + * @return boolean |
|
| 294 | 294 | */ |
| 295 | 295 | public function hasCustomControllerClass() |
| 296 | 296 | { |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * |
| 20 | 20 | * @return $this |
| 21 | 21 | */ |
| 22 | - public function addScript($handle, $script, array $dependency = []) |
|
| 22 | + public function addScript($handle, $script, array $dependency = [ ]) |
|
| 23 | 23 | { |
| 24 | 24 | if (is_null($handle)) { |
| 25 | 25 | $handle = $script; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @return $this |
| 39 | 39 | */ |
| 40 | - public function addStyle($handle, $style, array $attributes = []) |
|
| 40 | + public function addStyle($handle, $style, array $attributes = [ ]) |
|
| 41 | 41 | { |
| 42 | 42 | if (is_null($handle)) { |
| 43 | 43 | $handle = $style; |