Completed
Push — master ( 883ebd...28a518 )
by Gino
03:07 queued 01:32
created
controllers/Tags.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 use Backend\Behaviors\FormController;
11 11
 use Backend\Behaviors\ListController;
12 12
 use October\Rain\Exception\SystemException;
13
-use October\Rain\Flash\FlashBag;
14 13
 
15 14
 /**
16 15
  * Class Tags
Please login to merge, or discard this 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
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
models/Tag.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
      *
87 87
      * @var array
88 88
      */
89
-     public static $sortingOptions = [
89
+        public static $sortingOptions = [
90 90
         'name asc' => Plugin::LOCALIZATION_KEY . 'order_options.name_asc',
91 91
         'name desc' => Plugin::LOCALIZATION_KEY . 'order_options.name_desc',
92 92
         'created_at asc' => Plugin::LOCALIZATION_KEY . 'order_options.created_at_asc',
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
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
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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');
Please login to merge, or discard this patch.
components/SeriesNavigation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -109,8 +109,8 @@
 block discarded – undo
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
     /**
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.
updates/change_description_field.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
components/TagPosts.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
components/SeriesPosts.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
classes/ComponentAbstract.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.