@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | /** |
24 | 24 | * @var Collection | array |
25 | 25 | */ |
26 | - public $posts = []; |
|
26 | + public $posts = [ ]; |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Reference to the page name for linking to posts |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | |
127 | 127 | private function prepareVars() |
128 | 128 | { |
129 | - $this->orderBy = $this->page['orderBy'] = $this->property('orderBy'); |
|
129 | + $this->orderBy = $this->page[ 'orderBy' ] = $this->property('orderBy'); |
|
130 | 130 | |
131 | 131 | // Page links |
132 | - $this->postPage = $this->page['postPage' ] = $this->property('postPage'); |
|
132 | + $this->postPage = $this->page[ 'postPage' ] = $this->property('postPage'); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | public function getPostPageOptions() |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | $query = Post::isPublished() |
166 | 166 | ->where('id', '<>', $post->id) |
167 | - ->whereHas('tags', function ($tag) use ($tagIds) { |
|
167 | + ->whereHas('tags', function($tag) use ($tagIds) { |
|
168 | 168 | $tag->whereIn('id', $tagIds); |
169 | 169 | }) |
170 | 170 | ->with('tags'); |
@@ -109,8 +109,8 @@ |
||
109 | 109 | { |
110 | 110 | $this->postPage = $this->property('postPage'); |
111 | 111 | $this->seriesPage = $this->property('seriesPage'); |
112 | - $this->slug = $this->page['slug'] = $this->property('slug'); |
|
113 | - $this->series = $this->page['series'] = $this->listSeries(); |
|
112 | + $this->slug = $this->page[ 'slug' ] = $this->property('slug'); |
|
113 | + $this->series = $this->page[ 'series' ] = $this->listSeries(); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | public function registerNavigation() |
94 | 94 | { |
95 | 95 | // Extend the navigation |
96 | - Event::listen('backend.menu.extendItems', function ($manager) { |
|
96 | + Event::listen('backend.menu.extendItems', function($manager) { |
|
97 | 97 | $manager->addSideMenuItems(self::REQUIRED_PLUGIN_RAINLAB_BLOG, 'blog', [ |
98 | 98 | 'series' => [ |
99 | 99 | 'label' => self::LOCALIZATION_KEY . 'navigation.series', |
@@ -119,14 +119,14 @@ discard block |
||
119 | 119 | */ |
120 | 120 | private function extendModel() |
121 | 121 | { |
122 | - PostModel::extend(function ($model) { |
|
123 | - $model->belongsToMany['tags'] = [ |
|
122 | + PostModel::extend(function($model) { |
|
123 | + $model->belongsToMany[ 'tags' ] = [ |
|
124 | 124 | Tag::class, |
125 | 125 | 'table' => Tag::CROSS_REFERENCE_TABLE_NAME, |
126 | 126 | 'order' => 'name' |
127 | 127 | ]; |
128 | 128 | |
129 | - $model->belongsTo['series'] = [ |
|
129 | + $model->belongsTo[ 'series' ] = [ |
|
130 | 130 | Series::class, |
131 | 131 | 'key' => Series::TABLE_NAME . "_id" |
132 | 132 | ]; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | private function extendPostsController() |
140 | 140 | { |
141 | - PostsController::extendFormFields(function ($form, $model) { |
|
141 | + PostsController::extendFormFields(function($form, $model) { |
|
142 | 142 | if (!$model instanceof PostModel) { |
143 | 143 | return; |
144 | 144 | } |
@@ -157,13 +157,13 @@ discard block |
||
157 | 157 | $tab = self::LOCALIZATION_KEY . 'navigation.taxonomy'; |
158 | 158 | |
159 | 159 | $categoriesConfig = $form->getField('categories')->config; |
160 | - $categoriesConfig['tab'] = $tab; |
|
161 | - $categoriesConfig['mode'] = 'relation'; |
|
162 | - $categoriesConfig['type'] = 'taglist'; |
|
163 | - $categoriesConfig['label'] = 'rainlab.blog::lang.post.tab_categories'; |
|
164 | - $categoriesConfig['comment'] = "rainlab.blog::lang.post.categories_comment"; |
|
165 | - $categoriesConfig['placeholder'] = self::LOCALIZATION_KEY . 'placeholders.categories'; |
|
166 | - unset($categoriesConfig['commentAbove']); |
|
160 | + $categoriesConfig[ 'tab' ] = $tab; |
|
161 | + $categoriesConfig[ 'mode' ] = 'relation'; |
|
162 | + $categoriesConfig[ 'type' ] = 'taglist'; |
|
163 | + $categoriesConfig[ 'label' ] = 'rainlab.blog::lang.post.tab_categories'; |
|
164 | + $categoriesConfig[ 'comment' ] = "rainlab.blog::lang.post.categories_comment"; |
|
165 | + $categoriesConfig[ 'placeholder' ] = self::LOCALIZATION_KEY . 'placeholders.categories'; |
|
166 | + unset($categoriesConfig[ 'commentAbove' ]); |
|
167 | 167 | |
168 | 168 | $form->removeField('categories'); |
169 | 169 | |
@@ -194,8 +194,8 @@ discard block |
||
194 | 194 | */ |
195 | 195 | private function extendCategoriesController() |
196 | 196 | { |
197 | - CategoriesController::extend(function (Controller $controller) { |
|
198 | - $controller->implement[] = RelationController::class; |
|
197 | + CategoriesController::extend(function(Controller $controller) { |
|
198 | + $controller->implement[ ] = RelationController::class; |
|
199 | 199 | $relationConfig = '$/' . self::DIRECTORY_KEY . '/controllers/category/config_relation.yaml'; |
200 | 200 | |
201 | 201 | if (property_exists($controller, 'relationConfig')) { |
@@ -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 | } |
@@ -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 |
@@ -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 |
@@ -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 ($blogPostsComponent) { |
|
77 | + $post->categories->each(function($category) use ($blogPostsComponent) { |
|
78 | 78 | /** @var Category $category */ |
79 | 79 | $category->setUrl( |
80 | 80 | $this->categoryPage, |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | if ($component !== null && ($property = $component->property($name))) { |
107 | 107 | preg_match('/{{ :([^ ]+) }}/', $property, $matches); |
108 | 108 | |
109 | - if (isset($matches[1])) { |
|
110 | - $property = $matches[1]; |
|
109 | + if (isset($matches[ 1 ])) { |
|
110 | + $property = $matches[ 1 ]; |
|
111 | 111 | } |
112 | 112 | } else { |
113 | 113 | $property = $name; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function getProperty(string $property, $default = null) |
129 | 129 | { |
130 | - return $this->property($property, $this->defineProperties()[$property]['default'] ?? $default); |
|
130 | + return $this->property($property, $this->defineProperties()[ $property ][ 'default' ] ?? $default); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |