@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | public function up() |
| 20 | 20 | { |
| 21 | 21 | if (Schema::hasTable(Series::TABLE_NAME)) { |
| 22 | - Schema::table(Series::TABLE_NAME, function ($table) { |
|
| 22 | + Schema::table(Series::TABLE_NAME, function($table) { |
|
| 23 | 23 | $table->text('description')->nullable()->change(); |
| 24 | 24 | }); |
| 25 | 25 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | public function down() |
| 32 | 32 | { |
| 33 | 33 | if (Schema::hasTable(Series::TABLE_NAME)) { |
| 34 | - Schema::table(Series::TABLE_NAME, function ($table) { |
|
| 34 | + Schema::table(Series::TABLE_NAME, function($table) { |
|
| 35 | 35 | $table->string('description')->nullable()->change(); |
| 36 | 36 | }); |
| 37 | 37 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function onBulkDelete() |
| 56 | 56 | { |
| 57 | - if ($checkedIds = (array)post('checked', [])) { |
|
| 57 | + if ($checkedIds = (array)post('checked', [ ])) { |
|
| 58 | 58 | $delete = Tag::whereIn('id', $checkedIds)->delete(); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | { |
| 115 | 115 | $this->asExtension('FormController')->update(post('record_id')); |
| 116 | 116 | |
| 117 | - $this->vars['recordId'] = post('record_id'); |
|
| 117 | + $this->vars[ 'recordId' ] = post('record_id'); |
|
| 118 | 118 | |
| 119 | 119 | return $this->makePartial('tag_update_modal_form'); |
| 120 | 120 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @var array |
| 39 | 39 | */ |
| 40 | - public $implement = ['RainLab.Translate.Behaviors.TranslatableModel']; |
|
| 40 | + public $implement = [ 'RainLab.Translate.Behaviors.TranslatableModel' ]; |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Translatable properties, indexed property will be available in queries |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | /** |
| 56 | 56 | * @var array |
| 57 | 57 | */ |
| 58 | - protected $slugs = ['slug' => 'name']; |
|
| 58 | + protected $slugs = [ 'slug' => 'name' ]; |
|
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * Relations |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | /** |
| 19 | 19 | * @var array |
| 20 | 20 | */ |
| 21 | - public static $sortingOptions = []; |
|
| 21 | + public static $sortingOptions = [ ]; |
|
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * Sets the URL attribute with a URL to this object |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * |
| 52 | 52 | * @return mixed |
| 53 | 53 | */ |
| 54 | - public function scopeListFrontend(Builder $query, array $options = []) |
|
| 54 | + public function scopeListFrontend(Builder $query, array $options = [ ]) |
|
| 55 | 55 | { |
| 56 | 56 | $this->withRelation($query); |
| 57 | 57 | |
@@ -96,10 +96,10 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | private function queryDisplayEmpty(Builder $query, array $options) |
| 98 | 98 | { |
| 99 | - if (empty($options['displayEmpty'])) { |
|
| 99 | + if (empty($options[ 'displayEmpty' ])) { |
|
| 100 | 100 | $query->withCount( |
| 101 | 101 | [ |
| 102 | - 'posts' => function ($query) { |
|
| 102 | + 'posts' => function($query) { |
|
| 103 | 103 | $query->isPublished(); |
| 104 | 104 | } |
| 105 | 105 | ] |
@@ -115,11 +115,11 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | private function queryPostSlug(Builder $query, array $options) |
| 117 | 117 | { |
| 118 | - if (!empty($options['post'])) { |
|
| 118 | + if (!empty($options[ 'post' ])) { |
|
| 119 | 119 | $query->whereHas( |
| 120 | 120 | 'posts', |
| 121 | - function ($query) use ($options) { |
|
| 122 | - ModelAbstract::whereTranslatableProperty($query, 'slug', $options['post']); |
|
| 121 | + function($query) use ($options) { |
|
| 122 | + ModelAbstract::whereTranslatableProperty($query, 'slug', $options[ 'post' ]); |
|
| 123 | 123 | } |
| 124 | 124 | ); |
| 125 | 125 | } |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | private function queryLimit(Builder $query, array $options) |
| 135 | 135 | { |
| 136 | - if (!empty($options['limit'])) { |
|
| 137 | - $query->take($options['limit']); |
|
| 136 | + if (!empty($options[ 'limit' ])) { |
|
| 137 | + $query->take($options[ 'limit' ]); |
|
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
@@ -146,16 +146,16 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | private function queryOrderBy(Builder $query, array $options) |
| 148 | 148 | { |
| 149 | - if (array_key_exists($options['sort'], self::$sortingOptions)) { |
|
| 150 | - if ($options['sort'] === 'random') { |
|
| 149 | + if (array_key_exists($options[ 'sort' ], self::$sortingOptions)) { |
|
| 150 | + if ($options[ 'sort' ] === 'random') { |
|
| 151 | 151 | $query->inRandomOrder(); |
| 152 | 152 | } else { |
| 153 | - list($sortField, $sortDirection) = explode(' ', $options['sort']); |
|
| 153 | + list($sortField, $sortDirection) = explode(' ', $options[ 'sort' ]); |
|
| 154 | 154 | |
| 155 | 155 | if ($sortField === 'posts_count') { |
| 156 | 156 | $query->withCount( |
| 157 | 157 | [ |
| 158 | - 'posts' => function ($query) { |
|
| 158 | + 'posts' => function($query) { |
|
| 159 | 159 | $query->isPublished(); |
| 160 | 160 | } |
| 161 | 161 | ] |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | { |
| 177 | 177 | $query->with( |
| 178 | 178 | [ |
| 179 | - 'posts' => function ($query) { |
|
| 179 | + 'posts' => function($query) { |
|
| 180 | 180 | $query->isPublished(); |
| 181 | 181 | } |
| 182 | 182 | ] |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @var array |
| 39 | 39 | */ |
| 40 | - public $implement = ['RainLab.Translate.Behaviors.TranslatableModel']; |
|
| 40 | + public $implement = [ 'RainLab.Translate.Behaviors.TranslatableModel' ]; |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Translatable properties, indexed property will be available in queries |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | /** |
| 122 | 122 | * @var array |
| 123 | 123 | */ |
| 124 | - protected $slugs = ['slug' => 'title']; |
|
| 124 | + protected $slugs = [ 'slug' => 'title' ]; |
|
| 125 | 125 | |
| 126 | 126 | /** |
| 127 | 127 | * @return mixed |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | */ |
| 67 | 67 | protected function getPostsQuery() |
| 68 | 68 | { |
| 69 | - $query = Post::whereHas('tags', function ($query) { |
|
| 69 | + $query = Post::whereHas('tags', function($query) { |
|
| 70 | 70 | $query->whereTranslatable('slug', $this->tag->slug); |
| 71 | 71 | })->isPublished(); |
| 72 | 72 | |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | */ |
| 65 | 65 | protected function getPostsQuery() |
| 66 | 66 | { |
| 67 | - $query = Post::whereHas('series', function ($query) { |
|
| 67 | + $query = Post::whereHas('series', function($query) { |
|
| 68 | 68 | $query->whereTranslatable('slug', $this->series->slug); |
| 69 | 69 | })->isPublished(); |
| 70 | 70 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | /** |
| 22 | 22 | * @var Collection | array |
| 23 | 23 | */ |
| 24 | - public $posts = []; |
|
| 24 | + public $posts = [ ]; |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * @var integer The current page |
@@ -149,13 +149,13 @@ discard block |
||
| 149 | 149 | // Paginator settings |
| 150 | 150 | $this->currentPage = (int)$this->property('page', 1) ?: (int)post('page'); |
| 151 | 151 | $this->resultsPerPage = (int)$this->property('resultsPerPage') |
| 152 | - ?: $this->defineProperties()['resultsPerPage']['default']; |
|
| 152 | + ?: $this->defineProperties()[ 'resultsPerPage' ][ 'default' ]; |
|
| 153 | 153 | |
| 154 | - $this->orderBy = $this->page['orderBy'] = $this->property('orderBy'); |
|
| 154 | + $this->orderBy = $this->page[ 'orderBy' ] = $this->property('orderBy'); |
|
| 155 | 155 | |
| 156 | 156 | // Page links |
| 157 | - $this->postPage = $this->page['postPage' ] = $this->property('postPage'); |
|
| 158 | - $this->categoryPage = $this->page['categoryPage'] = $this->property('categoryPage'); |
|
| 157 | + $this->postPage = $this->page[ 'postPage' ] = $this->property('postPage'); |
|
| 158 | + $this->categoryPage = $this->page[ 'categoryPage' ] = $this->property('categoryPage'); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /** |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | ); |
| 75 | 75 | |
| 76 | 76 | if (!empty($this->categoryPage) && $post->categories->count()) { |
| 77 | - $post->categories->each(function ($category) use ($blogCategoriesComponent) { |
|
| 77 | + $post->categories->each(function($category) use ($blogCategoriesComponent) { |
|
| 78 | 78 | /** @var Category $category */ |
| 79 | 79 | $category->setUrl( |
| 80 | 80 | $this->categoryPage, |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function getProperty(string $property, $default = null) |
| 115 | 115 | { |
| 116 | - return $this->property($property, $this->defineProperties()[$property]['default'] ?? $default); |
|
| 116 | + return $this->property($property, $this->defineProperties()[ $property ][ 'default' ] ?? $default); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $component = $page->getComponent($componentName); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - if (!empty($component) && \is_callable([$this->controller, 'setComponentPropertiesFromParams'])) { |
|
| 134 | + if (!empty($component) && \is_callable([ $this->controller, 'setComponentPropertiesFromParams' ])) { |
|
| 135 | 135 | $this->controller->setComponentPropertiesFromParams($component); |
| 136 | 136 | } |
| 137 | 137 | |