@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | ]; |
| 92 | 92 | |
| 93 | 93 | if ($this->isTaggable()) { |
| 94 | - $attributes['class'] .= ' input-taggable'; |
|
| 94 | + $attributes[ 'class' ] .= ' input-taggable'; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | return [ |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $attribute = $this->getAttribute(); |
| 117 | 117 | |
| 118 | 118 | if (is_null(Request::input($this->getPath()))) { |
| 119 | - $values = []; |
|
| 119 | + $values = [ ]; |
|
| 120 | 120 | } else { |
| 121 | 121 | $values = $this->getValue(); |
| 122 | 122 | } |
@@ -125,19 +125,19 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | if ($relation instanceof \Illuminate\Database\Eloquent\Relations\BelongsToMany) { |
| 127 | 127 | foreach ($values as $i => $value) { |
| 128 | - if (! array_key_exists($value, $this->getOptions()) and $this->isTaggable()) { |
|
| 128 | + if (!array_key_exists($value, $this->getOptions()) and $this->isTaggable()) { |
|
| 129 | 129 | $model = clone $this->getModelForOptions(); |
| 130 | 130 | $model->{$this->getDisplay()} = $value; |
| 131 | 131 | $model->save(); |
| 132 | 132 | |
| 133 | - $values[$i] = $model->getKey(); |
|
| 133 | + $values[ $i ] = $model->getKey(); |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | $relation->sync($values); |
| 138 | 138 | } elseif ($relation instanceof \Illuminate\Database\Eloquent\Relations\HasMany) { |
| 139 | 139 | foreach ($relation->get() as $item) { |
| 140 | - if (! in_array($item->getKey(), $values)) { |
|
| 140 | + if (!in_array($item->getKey(), $values)) { |
|
| 141 | 141 | if ($this->isDeleteRelatedItem()) { |
| 142 | 142 | $item->delete(); |
| 143 | 143 | } else { |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | $item = $model->find($value); |
| 154 | 154 | |
| 155 | 155 | if (is_null($item)) { |
| 156 | - if (! $this->isTaggable()) { |
|
| 156 | + if (!$this->isTaggable()) { |
|
| 157 | 157 | continue; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | * @deprecated 4.5.0 |
| 214 | 214 | * @see getElements() |
| 215 | 215 | * |
| 216 | - * @return Collection[] |
|
| 216 | + * @return Collection |
|
| 217 | 217 | */ |
| 218 | 218 | public function getItems() |
| 219 | 219 | { |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | * |
| 302 | 302 | * @param ModelConfigurationInterface $modelConfiguration |
| 303 | 303 | * |
| 304 | - * @return bool |
|
| 304 | + * @return null|boolean |
|
| 305 | 305 | */ |
| 306 | 306 | public function saveForm(ModelConfigurationInterface $modelConfiguration) |
| 307 | 307 | { |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | * |
| 247 | 247 | * @param Request $request |
| 248 | 248 | * |
| 249 | - * @return bool |
|
| 249 | + * @return boolean|null |
|
| 250 | 250 | */ |
| 251 | 251 | public function inlineEdit(ModelConfigurationInterface $model, Request $request) |
| 252 | 252 | { |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | /** |
| 348 | - * @param ModelConfigurationInterface|ModelConfiguration $model |
|
| 348 | + * @param ModelConfigurationInterface $model |
|
| 349 | 349 | * @param Request $request |
| 350 | 350 | * @param int $id |
| 351 | 351 | * |
@@ -39,34 +39,34 @@ discard block |
||
| 39 | 39 | public function __construct(Request $request, \Illuminate\Contracts\Foundation\Application $application) |
| 40 | 40 | { |
| 41 | 41 | $this->application = $application; |
| 42 | - $this->navigation = $application['sleeping_owl.navigation']; |
|
| 42 | + $this->navigation = $application[ 'sleeping_owl.navigation' ]; |
|
| 43 | 43 | $this->navigation->setCurrentUrl($request->url()); |
| 44 | 44 | |
| 45 | - if (! Breadcrumbs::exists('home')) { |
|
| 46 | - Breadcrumbs::register('home', function ($breadcrumbs) { |
|
| 45 | + if (!Breadcrumbs::exists('home')) { |
|
| 46 | + Breadcrumbs::register('home', function($breadcrumbs) { |
|
| 47 | 47 | $breadcrumbs->push(trans('sleeping_owl::lang.dashboard'), route('admin.dashboard')); |
| 48 | 48 | }); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - $breadcrumbs = []; |
|
| 51 | + $breadcrumbs = [ ]; |
|
| 52 | 52 | |
| 53 | 53 | if ($currentPage = $this->navigation->getCurrentPage()) { |
| 54 | 54 | foreach ($currentPage->getPathArray() as $page) { |
| 55 | - $breadcrumbs[] = [ |
|
| 56 | - 'id' => $page['id'], |
|
| 57 | - 'title' => $page['title'], |
|
| 58 | - 'url' => $page['url'], |
|
| 55 | + $breadcrumbs[ ] = [ |
|
| 56 | + 'id' => $page[ 'id' ], |
|
| 57 | + 'title' => $page[ 'title' ], |
|
| 58 | + 'url' => $page[ 'url' ], |
|
| 59 | 59 | 'parent' => $this->parentBreadcrumb, |
| 60 | 60 | ]; |
| 61 | 61 | |
| 62 | - $this->parentBreadcrumb = $page['id']; |
|
| 62 | + $this->parentBreadcrumb = $page[ 'id' ]; |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | foreach ($breadcrumbs as $breadcrumb) { |
| 67 | - Breadcrumbs::register($breadcrumb['id'], function ($breadcrumbs) use ($breadcrumb) { |
|
| 68 | - $breadcrumbs->parent($breadcrumb['parent']); |
|
| 69 | - $breadcrumbs->push($breadcrumb['title'], $breadcrumb['url']); |
|
| 67 | + Breadcrumbs::register($breadcrumb[ 'id' ], function($breadcrumbs) use ($breadcrumb) { |
|
| 68 | + $breadcrumbs->parent($breadcrumb[ 'parent' ]); |
|
| 69 | + $breadcrumbs->push($breadcrumb[ 'title' ], $breadcrumb[ 'url' ]); |
|
| 70 | 70 | }); |
| 71 | 71 | } |
| 72 | 72 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function getDisplay(ModelConfigurationInterface $model) |
| 96 | 96 | { |
| 97 | - if (! $model->isDisplayable()) { |
|
| 97 | + if (!$model->isDisplayable()) { |
|
| 98 | 98 | abort(404); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function getCreate(ModelConfigurationInterface $model) |
| 110 | 110 | { |
| 111 | - if (! $model->isCreatable()) { |
|
| 111 | + if (!$model->isCreatable()) { |
|
| 112 | 112 | abort(404); |
| 113 | 113 | } |
| 114 | 114 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function postStore(ModelConfigurationInterface $model, Request $request) |
| 128 | 128 | { |
| 129 | - if (! $model->isCreatable()) { |
|
| 129 | + if (!$model->isCreatable()) { |
|
| 130 | 130 | abort(404); |
| 131 | 131 | } |
| 132 | 132 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | { |
| 183 | 183 | $item = $model->getRepository()->find($id); |
| 184 | 184 | |
| 185 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
| 185 | + if (is_null($item) || !$model->isEditable($item)) { |
|
| 186 | 186 | abort(404); |
| 187 | 187 | } |
| 188 | 188 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | $editForm = $model->fireEdit($id); |
| 205 | 205 | $item = $editForm->getModel(); |
| 206 | 206 | |
| 207 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
| 207 | + if (is_null($item) || !$model->isEditable($item)) { |
|
| 208 | 208 | abort(404); |
| 209 | 209 | } |
| 210 | 210 | |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | $display = $model->fireDisplay(); |
| 258 | 258 | |
| 259 | 259 | /** @var ColumnEditableInterface|null $column */ |
| 260 | - $column = $display->getColumns()->all()->filter(function ($column) use ($field) { |
|
| 260 | + $column = $display->getColumns()->all()->filter(function($column) use ($field) { |
|
| 261 | 261 | return ($column instanceof ColumnEditableInterface) and $field == $column->getName(); |
| 262 | 262 | })->first(); |
| 263 | 263 | |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | $repository = $model->getRepository(); |
| 269 | 269 | $item = $repository->find($id); |
| 270 | 270 | |
| 271 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
| 271 | + if (is_null($item) || !$model->isEditable($item)) { |
|
| 272 | 272 | abort(404); |
| 273 | 273 | } |
| 274 | 274 | |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | { |
| 294 | 294 | $item = $model->getRepository()->find($id); |
| 295 | 295 | |
| 296 | - if (is_null($item) || ! $model->isDeletable($item)) { |
|
| 296 | + if (is_null($item) || !$model->isDeletable($item)) { |
|
| 297 | 297 | abort(404); |
| 298 | 298 | } |
| 299 | 299 | |
@@ -320,13 +320,13 @@ discard block |
||
| 320 | 320 | */ |
| 321 | 321 | public function deleteDestroy(ModelConfigurationInterface $model, Request $request, $id) |
| 322 | 322 | { |
| 323 | - if (! $model->isRestorableModel()) { |
|
| 323 | + if (!$model->isRestorableModel()) { |
|
| 324 | 324 | abort(404); |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | $item = $model->getRepository()->findOnlyTrashed($id); |
| 328 | 328 | |
| 329 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
| 329 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
| 330 | 330 | abort(404); |
| 331 | 331 | } |
| 332 | 332 | |
@@ -353,13 +353,13 @@ discard block |
||
| 353 | 353 | */ |
| 354 | 354 | public function postRestore(ModelConfigurationInterface $model, Request $request, $id) |
| 355 | 355 | { |
| 356 | - if (! $model->isRestorableModel()) { |
|
| 356 | + if (!$model->isRestorableModel()) { |
|
| 357 | 357 | abort(404); |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | $item = $model->getRepository()->findOnlyTrashed($id); |
| 361 | 361 | |
| 362 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
| 362 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
| 363 | 363 | abort(404); |
| 364 | 364 | } |
| 365 | 365 | |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | { |
| 428 | 428 | $lang = trans('sleeping_owl::lang'); |
| 429 | 429 | if ($lang == 'sleeping_owl::lang') { |
| 430 | - $lang = trans('sleeping_owl::lang', [], 'messages', 'en'); |
|
| 430 | + $lang = trans('sleeping_owl::lang', [ ], 'messages', 'en'); |
|
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | $data = [ |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | { |
| 471 | 471 | if (($backUrl = $request->input('_redirectBack')) == \URL::previous()) { |
| 472 | 472 | $backUrl = null; |
| 473 | - $request->merge(['_redirectBack' => $backUrl]); |
|
| 473 | + $request->merge([ '_redirectBack' => $backUrl ]); |
|
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | return $backUrl; |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | */ |
| 488 | 488 | protected function registerBreadcrumb($title, $parent) |
| 489 | 489 | { |
| 490 | - Breadcrumbs::register('render', function ($breadcrumbs) use ($title, $parent) { |
|
| 490 | + Breadcrumbs::register('render', function($breadcrumbs) use ($title, $parent) { |
|
| 491 | 491 | $breadcrumbs->parent($parent); |
| 492 | 492 | $breadcrumbs->push($title); |
| 493 | 493 | }); |
@@ -210,9 +210,9 @@ discard block |
||
| 210 | 210 | { |
| 211 | 211 | $instance = $this->find($id); |
| 212 | 212 | $attributes = $instance->getAttributes(); |
| 213 | - $attributes[$this->getLeftColumn($instance)] = $left; |
|
| 214 | - $attributes[$this->getRightColumn($instance)] = $right; |
|
| 215 | - $attributes[$this->getParentColumn($instance)] = $parentId; |
|
| 213 | + $attributes[ $this->getLeftColumn($instance) ] = $left; |
|
| 214 | + $attributes[ $this->getRightColumn($instance) ] = $right; |
|
| 215 | + $attributes[ $this->getParentColumn($instance) ] = $parentId; |
|
| 216 | 216 | $instance->setRawAttributes($attributes); |
| 217 | 217 | $instance->save(); |
| 218 | 218 | } |
@@ -327,11 +327,11 @@ discard block |
||
| 327 | 327 | protected function recursiveReorder($root, $parentId, $left) |
| 328 | 328 | { |
| 329 | 329 | $right = $left + 1; |
| 330 | - $children = array_get($root, 'children', []); |
|
| 330 | + $children = array_get($root, 'children', [ ]); |
|
| 331 | 331 | foreach ($children as $child) { |
| 332 | - $right = $this->recursiveReorder($child, $root['id'], $right); |
|
| 332 | + $right = $this->recursiveReorder($child, $root[ 'id' ], $right); |
|
| 333 | 333 | } |
| 334 | - $this->move($root['id'], $parentId, $left, $right); |
|
| 334 | + $this->move($root[ 'id' ], $parentId, $left, $right); |
|
| 335 | 335 | $left = $right + 1; |
| 336 | 336 | |
| 337 | 337 | return $left; |
@@ -346,15 +346,15 @@ discard block |
||
| 346 | 346 | protected function recursiveReorderSimple(array $data, $parentId) |
| 347 | 347 | { |
| 348 | 348 | foreach ($data as $order => $item) { |
| 349 | - $id = $item['id']; |
|
| 349 | + $id = $item[ 'id' ]; |
|
| 350 | 350 | |
| 351 | 351 | $instance = $this->find($id); |
| 352 | 352 | $instance->{$this->getParentField()} = $parentId; |
| 353 | 353 | $instance->{$this->getOrderField()} = $order; |
| 354 | 354 | $instance->save(); |
| 355 | 355 | |
| 356 | - if (isset($item['children'])) { |
|
| 357 | - $this->recursiveReorderSimple($item['children'], $id); |
|
| 356 | + if (isset($item[ 'children' ])) { |
|
| 357 | + $this->recursiveReorderSimple($item[ 'children' ], $id); |
|
| 358 | 358 | } |
| 359 | 359 | } |
| 360 | 360 | } |
@@ -370,14 +370,14 @@ discard block |
||
| 370 | 370 | protected function getChildren($collection, $id) |
| 371 | 371 | { |
| 372 | 372 | $parentField = $this->getParentField(); |
| 373 | - $result = []; |
|
| 373 | + $result = [ ]; |
|
| 374 | 374 | foreach ($collection as $instance) { |
| 375 | - if ((int)$instance->$parentField != $id) { |
|
| 375 | + if ((int) $instance->$parentField != $id) { |
|
| 376 | 376 | continue; |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | $instance->setRelation('children', $this->getChildren($collection, $instance->getKey())); |
| 380 | - $result[] = $instance; |
|
| 380 | + $result[ ] = $instance; |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | return new Collection($result); |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | |
| 52 | 52 | /* Workaround to allow use ServiceProvider-based configurations in old fashion */ |
| 53 | 53 | if (is_file(app_path('Providers/AdminSectionsServiceProvider.php'))) { |
| 54 | - $this->app->register($this->app->getNamespace() . 'Providers\\AdminSectionsServiceProvider'); |
|
| 54 | + $this->app->register($this->app->getNamespace().'Providers\\AdminSectionsServiceProvider'); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
@@ -28,17 +28,17 @@ |
||
| 28 | 28 | public function fire() |
| 29 | 29 | { |
| 30 | 30 | $provider = $this->laravel->getProvider( |
| 31 | - $this->laravel->getNamespace() . 'Providers\\AdminSectionsServiceProvider' |
|
| 31 | + $this->laravel->getNamespace().'Providers\\AdminSectionsServiceProvider' |
|
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | - if (! $provider) { |
|
| 34 | + if (!$provider) { |
|
| 35 | 35 | $this->error('[App\Providers\AdminSectionsServiceProvider] not found'); |
| 36 | 36 | |
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | foreach ($provider->sections() as $model => $section) { |
| 41 | - $this->callSilent('sleepingowl:section:make', ['name' => $section, 'model' => $model]); |
|
| 41 | + $this->callSilent('sleepingowl:section:make', [ 'name' => $section, 'model' => $model ]); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $this->info('Sections generated successfully!'); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * @var array |
| 25 | 25 | */ |
| 26 | - protected $options = []; |
|
| 26 | + protected $options = [ ]; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * @var bool |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | /** |
| 44 | 44 | * @var array |
| 45 | 45 | */ |
| 46 | - protected $exclude = []; |
|
| 46 | + protected $exclude = [ ]; |
|
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | 49 | * @var string|null |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * @var array |
| 55 | 55 | */ |
| 56 | - protected $fetchColumns = []; |
|
| 56 | + protected $fetchColumns = [ ]; |
|
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * @var function|\Closure|object callable |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | * @param string|null $label |
| 66 | 66 | * @param array|Model $options |
| 67 | 67 | */ |
| 68 | - public function __construct($path, $label = null, $options = []) |
|
| 68 | + public function __construct($path, $label = null, $options = [ ]) |
|
| 69 | 69 | { |
| 70 | 70 | parent::__construct($path, $label); |
| 71 | 71 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $modelForOptions = app($modelForOptions); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if (! ($modelForOptions instanceof Model)) { |
|
| 99 | + if (!($modelForOptions instanceof Model)) { |
|
| 100 | 100 | throw new SelectException('Class must be instanced of Illuminate\Database\Eloquent\Model'); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | public function getOptions() |
| 132 | 132 | { |
| 133 | - if (! is_null($this->getModelForOptions()) && ! is_null($this->getDisplay())) { |
|
| 133 | + if (!is_null($this->getModelForOptions()) && !is_null($this->getDisplay())) { |
|
| 134 | 134 | $this->loadOptions(); |
| 135 | 135 | } |
| 136 | 136 | |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | */ |
| 238 | 238 | public function setFetchColumns($columns) |
| 239 | 239 | { |
| 240 | - if (! is_array($columns)) { |
|
| 240 | + if (!is_array($columns)) { |
|
| 241 | 241 | $columns = func_get_args(); |
| 242 | 242 | } |
| 243 | 243 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | */ |
| 299 | 299 | public function exclude($keys) |
| 300 | 300 | { |
| 301 | - if (! is_array($keys)) { |
|
| 301 | + if (!is_array($keys)) { |
|
| 302 | 302 | $keys = func_get_args(); |
| 303 | 303 | } |
| 304 | 304 | |
@@ -344,14 +344,14 @@ discard block |
||
| 344 | 344 | ]; |
| 345 | 345 | |
| 346 | 346 | if ($this->isReadonly()) { |
| 347 | - $attributes['disabled'] = 'disabled'; |
|
| 347 | + $attributes[ 'disabled' ] = 'disabled'; |
|
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | $options = $this->getOptions(); |
| 351 | 351 | |
| 352 | 352 | if ($this->isNullable()) { |
| 353 | - $attributes['data-nullable'] = 'true'; |
|
| 354 | - $options = [null => trans('sleeping_owl::lang.select.nothing')] + $options; |
|
| 353 | + $attributes[ 'data-nullable' ] = 'true'; |
|
| 354 | + $options = [ null => trans('sleeping_owl::lang.select.nothing') ] + $options; |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | $options = array_except($options, $this->exclude); |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | */ |
| 369 | 369 | protected function loadOptions() |
| 370 | 370 | { |
| 371 | - $repository = app(RepositoryInterface::class, [$this->getModelForOptions()]); |
|
| 371 | + $repository = app(RepositoryInterface::class, [ $this->getModelForOptions() ]); |
|
| 372 | 372 | |
| 373 | 373 | $key = $repository->getModel()->getKeyName(); |
| 374 | 374 | |
@@ -379,12 +379,12 @@ discard block |
||
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | if (count($this->fetchColumns) > 0) { |
| 382 | - $columns = array_merge([$key], $this->fetchColumns); |
|
| 382 | + $columns = array_merge([ $key ], $this->fetchColumns); |
|
| 383 | 383 | $options->select($columns); |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | // call the pre load options query preparer if has be set |
| 387 | - if (! is_null($preparer = $this->getLoadOptionsQueryPreparer())) { |
|
| 387 | + if (!is_null($preparer = $this->getLoadOptionsQueryPreparer())) { |
|
| 388 | 388 | $options = $preparer($this, $options); |
| 389 | 389 | } |
| 390 | 390 | |
@@ -401,9 +401,9 @@ discard block |
||
| 401 | 401 | |
| 402 | 402 | // iterate for all options and redefine it as |
| 403 | 403 | // list of KEY and TEXT pair |
| 404 | - $options = array_map(function ($opt) use ($key, $makeDisplay) { |
|
| 404 | + $options = array_map(function($opt) use ($key, $makeDisplay) { |
|
| 405 | 405 | // get the KEY and make the display text |
| 406 | - return [data_get($opt, $key), $makeDisplay($opt)]; |
|
| 406 | + return [ data_get($opt, $key), $makeDisplay($opt) ]; |
|
| 407 | 407 | }, $options); |
| 408 | 408 | |
| 409 | 409 | // take options as array with KEY => VALUE pair |
@@ -55,11 +55,11 @@ discard block |
||
| 55 | 55 | { |
| 56 | 56 | $this->content = $content; |
| 57 | 57 | |
| 58 | - if (! is_null($label)) { |
|
| 58 | + if (!is_null($label)) { |
|
| 59 | 59 | $this->setLabel($label); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - if (! is_null($icon)) { |
|
| 62 | + if (!is_null($icon)) { |
|
| 63 | 63 | $this->setIcon($icon); |
| 64 | 64 | } |
| 65 | 65 | } |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | return $this->getContent()->getValidationRules(); |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - return []; |
|
| 310 | + return [ ]; |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | /** |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | return $this->getContent()->getValidationMessages(); |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | - return []; |
|
| 322 | + return [ ]; |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | /** |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | return $this->getContent()->getValidationLabels(); |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | - return []; |
|
| 334 | + return [ ]; |
|
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | /** |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | /** |
| 51 | 51 | * @var array |
| 52 | 52 | */ |
| 53 | - protected $with = []; |
|
| 53 | + protected $with = [ ]; |
|
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * @var string |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $this->repository = $this->makeRepository(); |
| 168 | 168 | $this->repository->with($this->with); |
| 169 | 169 | |
| 170 | - $this->extensions->each(function (DisplayExtensionInterface $extension) { |
|
| 170 | + $this->extensions->each(function(DisplayExtensionInterface $extension) { |
|
| 171 | 171 | if ($extension instanceof Initializable) { |
| 172 | 172 | $extension->initialize(); |
| 173 | 173 | } |
@@ -201,9 +201,9 @@ discard block |
||
| 201 | 201 | $this->title, |
| 202 | 202 | ]; |
| 203 | 203 | |
| 204 | - $this->getExtensions()->each(function (DisplayExtensionInterface $extension) use (&$titles) { |
|
| 204 | + $this->getExtensions()->each(function(DisplayExtensionInterface $extension) use (&$titles) { |
|
| 205 | 205 | if (method_exists($extension, $method = 'getTitle')) { |
| 206 | - $titles[] = call_user_func([$extension, $method]); |
|
| 206 | + $titles[ ] = call_user_func([ $extension, $method ]); |
|
| 207 | 207 | } |
| 208 | 208 | }); |
| 209 | 209 | |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | })->each(function($extension) use($view) { |
| 271 | 271 | $html = app('sleeping_owl.template')->view($extension->getView(), $extension->toArray())->render(); |
| 272 | 272 | |
| 273 | - if (! empty($html)) { |
|
| 273 | + if (!empty($html)) { |
|
| 274 | 274 | $factory = $view->getFactory(); |
| 275 | 275 | |
| 276 | 276 | $factory->startSection($extension->getPlacement()); |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | $extension = $this->extensions->get($method); |
| 307 | 307 | |
| 308 | 308 | if (method_exists($extension, 'set')) { |
| 309 | - return call_user_func_array([$extension, 'set'], $arguments); |
|
| 309 | + return call_user_func_array([ $extension, 'set' ], $arguments); |
|
| 310 | 310 | } |
| 311 | 311 | } |
| 312 | 312 | |
@@ -327,9 +327,9 @@ discard block |
||
| 327 | 327 | */ |
| 328 | 328 | protected function makeRepository() |
| 329 | 329 | { |
| 330 | - $repository = app($this->repositoryClass, [$this->modelClass]); |
|
| 330 | + $repository = app($this->repositoryClass, [ $this->modelClass ]); |
|
| 331 | 331 | |
| 332 | - if (! ($repository instanceof RepositoryInterface)) { |
|
| 332 | + if (!($repository instanceof RepositoryInterface)) { |
|
| 333 | 333 | throw new \Exception('Repository class must be instanced of [RepositoryInterface]'); |
| 334 | 334 | } |
| 335 | 335 | |