@@ -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); |
@@ -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; |
@@ -16,26 +16,26 @@ discard block |
||
| 16 | 16 | * @var array |
| 17 | 17 | */ |
| 18 | 18 | protected $sqlOperators = [ |
| 19 | - 'equal' => ['method' => 'where', 'op' => '='], |
|
| 20 | - 'not_equal' => ['method' => 'where', 'op' => '!='], |
|
| 21 | - 'less' => ['method' => 'where', 'op' => '<'], |
|
| 22 | - 'less_or_equal' => ['method' => 'where', 'op' => '<='], |
|
| 23 | - 'greater' => ['method' => 'where', 'op' => '>'], |
|
| 24 | - 'greater_or_equal' => ['method' => 'where', 'op' => '>='], |
|
| 25 | - 'begins_with' => ['method' => 'where', 'op' => 'like', 'mod' => '?%'], |
|
| 26 | - 'not_begins_with' => ['method' => 'where', 'op' => 'not like', 'mod' => '?%'], |
|
| 27 | - 'contains' => ['method' => 'where', 'op' => 'like', 'mod' => '%?%'], |
|
| 28 | - 'not_contains' => ['method' => 'where', 'op' => 'not like', 'mod' => '%?%'], |
|
| 29 | - 'ends_with' => ['method' => 'where', 'op' => 'like', 'mod' => '%?'], |
|
| 30 | - 'not_ends_with' => ['method' => 'where', 'op' => 'not like', 'mod' => '%?'], |
|
| 31 | - 'is_empty' => ['method' => 'where', 'op' => '=', 'value' => ''], |
|
| 32 | - 'is_not_empty' => ['method' => 'where', 'op' => '!=', 'value' => ''], |
|
| 33 | - 'is_null' => ['method' => 'whereNull'], |
|
| 34 | - 'is_not_null' => ['method' => 'whereNotNull'], |
|
| 35 | - 'between' => ['method' => 'whereBetween'], |
|
| 36 | - 'not_between' => ['method' => 'whereNotBetween'], |
|
| 37 | - 'in' => ['method' => 'whereIn'], |
|
| 38 | - 'not_in' => ['method' => 'whereNotIn'], |
|
| 19 | + 'equal' => [ 'method' => 'where', 'op' => '=' ], |
|
| 20 | + 'not_equal' => [ 'method' => 'where', 'op' => '!=' ], |
|
| 21 | + 'less' => [ 'method' => 'where', 'op' => '<' ], |
|
| 22 | + 'less_or_equal' => [ 'method' => 'where', 'op' => '<=' ], |
|
| 23 | + 'greater' => [ 'method' => 'where', 'op' => '>' ], |
|
| 24 | + 'greater_or_equal' => [ 'method' => 'where', 'op' => '>=' ], |
|
| 25 | + 'begins_with' => [ 'method' => 'where', 'op' => 'like', 'mod' => '?%' ], |
|
| 26 | + 'not_begins_with' => [ 'method' => 'where', 'op' => 'not like', 'mod' => '?%' ], |
|
| 27 | + 'contains' => [ 'method' => 'where', 'op' => 'like', 'mod' => '%?%' ], |
|
| 28 | + 'not_contains' => [ 'method' => 'where', 'op' => 'not like', 'mod' => '%?%' ], |
|
| 29 | + 'ends_with' => [ 'method' => 'where', 'op' => 'like', 'mod' => '%?' ], |
|
| 30 | + 'not_ends_with' => [ 'method' => 'where', 'op' => 'not like', 'mod' => '%?' ], |
|
| 31 | + 'is_empty' => [ 'method' => 'where', 'op' => '=', 'value' => '' ], |
|
| 32 | + 'is_not_empty' => [ 'method' => 'where', 'op' => '!=', 'value' => '' ], |
|
| 33 | + 'is_null' => [ 'method' => 'whereNull' ], |
|
| 34 | + 'is_not_null' => [ 'method' => 'whereNotNull' ], |
|
| 35 | + 'between' => [ 'method' => 'whereBetween' ], |
|
| 36 | + 'not_between' => [ 'method' => 'whereNotBetween' ], |
|
| 37 | + 'in' => [ 'method' => 'whereIn' ], |
|
| 38 | + 'not_in' => [ 'method' => 'whereNotIn' ], |
|
| 39 | 39 | ]; |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -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 | |
@@ -71,12 +71,12 @@ discard block |
||
| 71 | 71 | protected function buildQuery(Builder $query, $column, $value) |
| 72 | 72 | { |
| 73 | 73 | $params = $this->getOperatorParams(); |
| 74 | - $method = $params['method']; |
|
| 74 | + $method = $params[ 'method' ]; |
|
| 75 | 75 | |
| 76 | 76 | switch ($method) { |
| 77 | 77 | case 'where': |
| 78 | 78 | $value = str_replace('?', $value, array_get($params, 'mod', '?')); |
| 79 | - $query->where($column, $params['op'], $value); |
|
| 79 | + $query->where($column, $params[ 'op' ], $value); |
|
| 80 | 80 | break; |
| 81 | 81 | case 'whereNull': |
| 82 | 82 | case 'whereNotNull': |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | protected function getOperatorParams() |
| 100 | 100 | { |
| 101 | - return array_get($this->sqlOperators, $this->getOperator(), ['method' => 'where', 'op' => '=']); |
|
| 101 | + return array_get($this->sqlOperators, $this->getOperator(), [ 'method' => 'where', 'op' => '=' ]); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | protected function prepareValue($value) |
| 110 | 110 | { |
| 111 | 111 | $params = $this->getOperatorParams(); |
| 112 | - $method = $params['method']; |
|
| 112 | + $method = $params[ 'method' ]; |
|
| 113 | 113 | switch ($method) { |
| 114 | 114 | case 'where': |
| 115 | 115 | case 'whereNull': |
@@ -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; |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | } else { |
| 31 | 31 | $method = 'set'.ucfirst($name); |
| 32 | 32 | if (method_exists($this, 'set'.ucfirst($name))) { |
| 33 | - $this->attributes[$name] = $this->{$method}($value); |
|
| 33 | + $this->attributes[ $name ] = $this->{$method}($value); |
|
| 34 | 34 | } else { |
| 35 | - $this->attributes[$name] = $value; |
|
| 35 | + $this->attributes[ $name ] = $value; |
|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function __isset($name) |
| 69 | 69 | { |
| 70 | - return isset($this->attributes[$name]); |
|
| 70 | + return isset($this->attributes[ $name ]); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |
@@ -75,6 +75,6 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function __unset($name) |
| 77 | 77 | { |
| 78 | - unset($this->attributes[$name]); |
|
| 78 | + unset($this->attributes[ $name ]); |
|
| 79 | 79 | } |
| 80 | 80 | } |
@@ -9,11 +9,11 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | protected static function bootOrderableModel() |
| 11 | 11 | { |
| 12 | - static::creating(function ($row) { |
|
| 12 | + static::creating(function($row) { |
|
| 13 | 13 | $row->updateOrderFieldOnCreate(); |
| 14 | 14 | }); |
| 15 | 15 | |
| 16 | - static::deleted(function ($row) { |
|
| 16 | + static::deleted(function($row) { |
|
| 17 | 17 | $row->updateOrderFieldOnDelete(); |
| 18 | 18 | }); |
| 19 | 19 | } |
@@ -32,8 +32,8 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | public function setPasswordAttribute($value) |
| 34 | 34 | { |
| 35 | - if (! empty($value)) { |
|
| 36 | - $this->attributes['password'] = bcrypt($value); |
|
| 35 | + if (!empty($value)) { |
|
| 36 | + $this->attributes[ 'password' ] = bcrypt($value); |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -23,5 +23,5 @@ |
||
| 23 | 23 | * |
| 24 | 24 | * @return \BladeView|bool|\Illuminate\Contracts\View\Factory|\Illuminate\View\View |
| 25 | 25 | */ |
| 26 | - public function view($view, $data = [], $mergeData = []); |
|
| 26 | + public function view($view, $data = [ ], $mergeData = [ ]); |
|
| 27 | 27 | } |
@@ -142,14 +142,14 @@ |
||
| 142 | 142 | * |
| 143 | 143 | * @return string |
| 144 | 144 | */ |
| 145 | - public function getDisplayUrl(array $parameters = []); |
|
| 145 | + public function getDisplayUrl(array $parameters = [ ]); |
|
| 146 | 146 | |
| 147 | 147 | /** |
| 148 | 148 | * @param array $parameters |
| 149 | 149 | * |
| 150 | 150 | * @return string |
| 151 | 151 | */ |
| 152 | - public function getCreateUrl(array $parameters = []); |
|
| 152 | + public function getCreateUrl(array $parameters = [ ]); |
|
| 153 | 153 | |
| 154 | 154 | /** |
| 155 | 155 | * @return string |