Completed
Push — master ( daa76e...482fde )
by Gino
01:30
created
components/PostListAbstract.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
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
@@ -148,13 +148,13 @@  discard block
 block discarded – undo
148 148
     {
149 149
         $this->currentPage = intval($this->property('page', 1)) ?: intval(post('page'));
150 150
         $this->resultsPerPage = intval($this->property('resultsPerPage'))
151
-            ?: $this->defineProperties()['resultsPerPage']['default'];
151
+            ?: $this->defineProperties()[ 'resultsPerPage' ][ 'default' ];
152 152
 
153
-        $this->orderBy = $this->page['orderBy'] = $this->property('orderBy');
153
+        $this->orderBy = $this->page[ 'orderBy' ] = $this->property('orderBy');
154 154
 
155 155
         // Page links
156
-        $this->postPage = $this->page['postPage' ] = $this->property('postPage');
157
-        $this->categoryPage = $this->page['categoryPage'] = $this->property('categoryPage');
156
+        $this->postPage = $this->page[ 'postPage' ] = $this->property('postPage');
157
+        $this->categoryPage = $this->page[ 'categoryPage' ] = $this->property('categoryPage');
158 158
     }
159 159
 
160 160
     /**
Please login to merge, or discard this patch.
models/PostsRelationScopeTrait.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      *
21 21
      * @return mixed
22 22
      */
23
-    public function scopeListFrontend(Builder $query, array $options = [])
23
+    public function scopeListFrontend(Builder $query, array $options = [ ])
24 24
     {
25 25
         $this->withRelation($query);
26 26
 
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
      */
44 44
     private function queryDisplayEmpty(Builder $query, array $options)
45 45
     {
46
-        if (empty($options['displayEmpty'])) {
46
+        if (empty($options[ 'displayEmpty' ])) {
47 47
             $query->withCount(
48 48
                 [
49
-                    'posts' => function ($query) {
49
+                    'posts' => function($query) {
50 50
                         $query->isPublished();
51 51
                     }
52 52
                 ]
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
      */
63 63
     private function queryPostSlug(Builder $query, array $options)
64 64
     {
65
-        if (!empty($options['post'])) {
65
+        if (!empty($options[ 'post' ])) {
66 66
             $query->whereHas(
67 67
                 'posts',
68
-                function ($query) use ($options) {
69
-                    $query->whereSlug($options['post']);
68
+                function($query) use ($options) {
69
+                    $query->whereSlug($options[ 'post' ]);
70 70
                 }
71 71
             );
72 72
         }
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
      */
81 81
     private function queryLimit(Builder $query, array $options)
82 82
     {
83
-        if (!empty($options['limit'])) {
84
-            $query->take($options['limit']);
83
+        if (!empty($options[ 'limit' ])) {
84
+            $query->take($options[ 'limit' ]);
85 85
         }
86 86
     }
87 87
 
@@ -93,16 +93,16 @@  discard block
 block discarded – undo
93 93
      */
94 94
     private function queryOrderBy(Builder $query, array $options)
95 95
     {
96
-        if (in_array($options['sort'], array_keys(self::$sortingOptions))) {
97
-            if ($options['sort'] == 'random') {
96
+        if (in_array($options[ 'sort' ], array_keys(self::$sortingOptions))) {
97
+            if ($options[ 'sort' ] == 'random') {
98 98
                 $query->inRandomOrder();
99 99
             } else {
100
-                list($sortField, $sortDirection) = explode(' ', $options['sort']);
100
+                list($sortField, $sortDirection) = explode(' ', $options[ 'sort' ]);
101 101
 
102 102
                 if ($sortField == 'posts_count') {
103 103
                     $query->withCount(
104 104
                         [
105
-                            'posts' => function ($query) {
105
+                            'posts' => function($query) {
106 106
                                 $query->isPublished();
107 107
                             }
108 108
                         ]
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     {
124 124
         $query->with(
125 125
             [
126
-                'posts' => function ($query) {
126
+                'posts' => function($query) {
127 127
                     $query->isPublished();
128 128
                 }
129 129
             ]
Please login to merge, or discard this patch.
Plugin.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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')) {
Please login to merge, or discard this patch.