Completed
Push — master ( a449a7...7f0061 )
by Gino
12:11
created
updates/create_taxonomies_tables.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
      */
54 54
     private function dropSeries()
55 55
     {
56
-        Schema::table('rainlab_blog_posts', function ($table) {
57
-            $table->dropForeign([Series::TABLE_NAME . '_id']);
56
+        Schema::table('rainlab_blog_posts', function($table) {
57
+            $table->dropForeign([ Series::TABLE_NAME . '_id' ]);
58 58
             $table->dropColumn(Series::TABLE_NAME . '_id');
59 59
         });
60 60
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     {
69 69
         Schema::create(
70 70
             Tag::TABLE_NAME,
71
-            function ($table) {
71
+            function($table) {
72 72
                 $table->engine = 'InnoDB';
73 73
 
74 74
                 $table->increments('id');
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
 
81 81
         Schema::create(
82 82
             Tag::CROSS_REFERENCE_TABLE_NAME,
83
-            function ($table) {
83
+            function($table) {
84 84
                 $table->engine = 'InnoDB';
85 85
 
86 86
                 $table->integer('tag_id')->unsigned()->nullable()->default(null);
87 87
                 $table->integer('post_id')->unsigned()->nullable()->default(null);
88
-                $table->index(['tag_id', 'post_id']);
88
+                $table->index([ 'tag_id', 'post_id' ]);
89 89
                 $table->foreign('tag_id', 'Tag reference')->references('id')->on(Tag::TABLE_NAME)->onDelete('cascade');
90 90
                 $table->foreign('post_id', 'Post reference')->references('id')->on('rainlab_blog_posts')->onDelete('cascade');
91 91
             }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     {
100 100
         Schema::create(
101 101
             Series::TABLE_NAME,
102
-            function ($table) {
102
+            function($table) {
103 103
                 $table->engine = 'InnoDB';
104 104
 
105 105
                 $table->increments('id');
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             }
111 111
         );
112 112
 
113
-        Schema::table('rainlab_blog_posts', function ($table) {
113
+        Schema::table('rainlab_blog_posts', function($table) {
114 114
             $table->integer(Series::TABLE_NAME . '_id')->unsigned()->nullable()->default(null);
115 115
             $table->foreign(Series::TABLE_NAME . '_id')->references('id')->on(Series::TABLE_NAME)->onDelete('cascade');
116 116
         });
Please login to merge, or discard this patch.
controllers/Tags.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
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
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     {
118 118
         $this->asExtension('FormController')->update(post('record_id'));
119 119
 
120
-        $this->vars['recordId'] = post('record_id');
120
+        $this->vars[ 'recordId' ] = post('record_id');
121 121
 
122 122
         return $this->makePartial('tag_update_modal_form');
123 123
     }
Please login to merge, or discard this patch.
models/Tag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     /**
32 32
      * @var array
33 33
      */
34
-    protected $slugs = ['slug' => 'name'];
34
+    protected $slugs = [ 'slug' => 'name' ];
35 35
 
36 36
     /**
37 37
      * Relations
Please login to merge, or discard this patch.
Plugin.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     /**
36 36
      * @var array   Require the RainLab.Blog plugin
37 37
      */
38
-    public $require = [self::REQUIRED_PLUGIN];
38
+    public $require = [ self::REQUIRED_PLUGIN ];
39 39
 
40 40
     /**
41 41
      * Returns information about this plugin
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     public function registerNavigation()
92 92
     {
93 93
         // Extend the navigation
94
-        Event::listen('backend.menu.extendItems', function ($manager) {
94
+        Event::listen('backend.menu.extendItems', function($manager) {
95 95
             $manager->addSideMenuItems(self::REQUIRED_PLUGIN, 'blog', [
96 96
                 'series' => [
97 97
                     'label' => self::LOCALIZATION_KEY . 'navigation.series',
@@ -117,14 +117,14 @@  discard block
 block discarded – undo
117 117
      */
118 118
     private function extendModel()
119 119
     {
120
-        PostModel::extend(function ($model) {
121
-            $model->belongsToMany['tags'] = [
120
+        PostModel::extend(function($model) {
121
+            $model->belongsToMany[ 'tags' ] = [
122 122
                 Tag::class,
123 123
                 'table' => Tag::CROSS_REFERENCE_TABLE_NAME,
124 124
                 'order' => 'name'
125 125
             ];
126 126
 
127
-            $model->belongsTo['series'] = [
127
+            $model->belongsTo[ 'series' ] = [
128 128
                 Series::class,
129 129
                 'key' => Series::TABLE_NAME . "_id"
130 130
             ];
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     private function extendPostsController()
138 138
     {
139
-        PostsController::extendFormFields(function ($form, $model) {
139
+        PostsController::extendFormFields(function($form, $model) {
140 140
             if (!$model instanceof PostModel) {
141 141
                 return;
142 142
             }
@@ -144,13 +144,13 @@  discard block
 block discarded – undo
144 144
             $tab = self::LOCALIZATION_KEY . 'navigation.taxonomy';
145 145
 
146 146
             $categoriesConfig = $form->getField('categories')->config;
147
-            $categoriesConfig['tab'] = $tab;
148
-            $categoriesConfig['mode'] = 'relation';
149
-            $categoriesConfig['type'] = 'taglist';
150
-            $categoriesConfig['label'] = 'Categories';
151
-            $categoriesConfig['comment'] = "rainlab.blog::lang.post.categories_comment";
152
-            $categoriesConfig['placeholder'] = self::LOCALIZATION_KEY . 'placeholders.tags';
153
-            unset($categoriesConfig['commentAbove']);
147
+            $categoriesConfig[ 'tab' ] = $tab;
148
+            $categoriesConfig[ 'mode' ] = 'relation';
149
+            $categoriesConfig[ 'type' ] = 'taglist';
150
+            $categoriesConfig[ 'label' ] = 'Categories';
151
+            $categoriesConfig[ 'comment' ] = "rainlab.blog::lang.post.categories_comment";
152
+            $categoriesConfig[ 'placeholder' ] = self::LOCALIZATION_KEY . 'placeholders.tags';
153
+            unset($categoriesConfig[ 'commentAbove' ]);
154 154
 
155 155
             $form->removeField('categories');
156 156
 
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
             ]);
181 181
         });
182 182
 
183
-        PostsController::extend(function (Controller $controller) {
184
-            $controller->implement[] = RelationController::class;
183
+        PostsController::extend(function(Controller $controller) {
184
+            $controller->implement[ ] = RelationController::class;
185 185
             $relationConfig = '$/' . self::DIRECTORY_KEY . '/controllers/series/config_posts_relation.yaml';
186 186
 
187 187
             if (property_exists($controller, 'relationConfig')) {
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
      */
201 201
     private function extendCategoriesController()
202 202
     {
203
-        CategoriesController::extend(function (Controller $controller) {
204
-            $controller->implement[] = RelationController::class;
203
+        CategoriesController::extend(function(Controller $controller) {
204
+            $controller->implement[ ] = RelationController::class;
205 205
             $relationConfig = '$/' . self::DIRECTORY_KEY . '/controllers/category/config_relation.yaml';
206 206
 
207 207
             if (property_exists($controller, 'relationConfig')) {
Please login to merge, or discard this patch.
components/RelatedPosts.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     /**
19 19
      * @var Collection | array
20 20
      */
21
-    public $posts = [];
21
+    public $posts = [ ];
22 22
 
23 23
     /**
24 24
      * Reference to the page name for linking to posts
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
     protected function prepareVars()
101 101
     {
102
-        $this->postParam = $this->page['postParam'] = $this->property('postParam');
102
+        $this->postParam = $this->page[ 'postParam' ] = $this->property('postParam');
103 103
     }
104 104
 
105 105
     public function getPostPageOptions()
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
             select count(*)
138 138
             from `ginopane_blogtaxonomy_post_tag`
139 139
             where `ginopane_blogtaxonomy_post_tag`.`post_id` = `rainlab_blog_posts`.`id`
140
-            and `ginopane_blogtaxonomy_post_tag`.`tag_id` in ('.implode(', ', $tagIds).')
140
+            and `ginopane_blogtaxonomy_post_tag`.`tag_id` in ('.implode(', ', $tagIds) . ')
141 141
         )');
142 142
 
143 143
         $key = $this->property('orderBy') ?: $subQuery;
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         $posts->each(
158 158
             function($post)
159 159
             {
160
-                $post->setUrl($this->postPage,$this->controller);
160
+                $post->setUrl($this->postPage, $this->controller);
161 161
             }
162 162
         );
163 163
 
Please login to merge, or discard this patch.
components/SeriesNavigation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
132 132
 
133 133
             $series->setUrl($this->seriesPage, $this->controller);
134 134
 
135
-            $series->posts->each(function ($post) {
135
+            $series->posts->each(function($post) {
136 136
                 $post->setUrl($this->postPage, $this->controller);
137 137
             });
138 138
         }
Please login to merge, or discard this patch.
models/PostsRelationScopeTrait.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,13 +18,13 @@  discard block
 block discarded – undo
18 18
      *
19 19
      * @return mixed
20 20
      */
21
-    public function scopeListFrontend($query, array $options = [])
21
+    public function scopeListFrontend($query, array $options = [ ])
22 22
     {
23
-        if (in_array($options['sort'], array_keys(self::$sortingOptions))) {
24
-            if ($options['sort'] == 'random') {
23
+        if (in_array($options[ 'sort' ], array_keys(self::$sortingOptions))) {
24
+            if ($options[ 'sort' ] == 'random') {
25 25
                 $query->inRandomOrder();
26 26
             } else {
27
-                list($sortField, $sortDirection) = explode(' ', $options['sort']);
27
+                list($sortField, $sortDirection) = explode(' ', $options[ 'sort' ]);
28 28
 
29 29
                 if ($sortField == 'posts_count') {
30 30
                     $query->withCount('posts');
@@ -34,17 +34,17 @@  discard block
 block discarded – undo
34 34
             }
35 35
         }
36 36
 
37
-        if (empty($options['displayEmpty'])) {
37
+        if (empty($options[ 'displayEmpty' ])) {
38 38
             $query->has('posts');
39 39
         }
40 40
 
41 41
         // Limit the number of results
42
-        if (!empty($options['limit'])) {
43
-            $query->take($options['limit']);
42
+        if (!empty($options[ 'limit' ])) {
43
+            $query->take($options[ 'limit' ]);
44 44
         }
45 45
 
46 46
         return $query->with([
47
-                'posts' => function($query){
47
+                'posts' => function($query) {
48 48
                     $query->isPublished();
49 49
                 }
50 50
             ]
Please login to merge, or discard this patch.
models/Series.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
     /**
84 84
      * @var array
85 85
      */
86
-    protected $slugs = ['slug' => 'title'];
86
+    protected $slugs = [ 'slug' => 'title' ];
87 87
 
88 88
     /**
89 89
      * @return mixed
Please login to merge, or discard this patch.
models/PostsRelationTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
      * @param       $query
11 11
      * @param array $options Available options are "sort", "displayEmpty", "limit"
12 12
      */
13
-    public function scopeListFrontend($query, array $options = [])
13
+    public function scopeListFrontend($query, array $options = [ ])
14 14
     {
15 15
 
16 16
     }
Please login to merge, or discard this patch.