Completed
Push — master ( 51291a...f2630e )
by Gino
01:39
created
models/Series.php 1 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
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
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
Please login to merge, or discard this patch.
models/Tag.php 1 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.
models/ModelAbstract.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
@@ -101,10 +101,10 @@  discard block
 block discarded – undo
101 101
      */
102 102
     private function queryDisplayEmpty(Builder $query, array $options)
103 103
     {
104
-        if (empty($options['displayEmpty'])) {
104
+        if (empty($options[ 'displayEmpty' ])) {
105 105
             $query->withCount(
106 106
                 [
107
-                    'posts' => function ($query) {
107
+                    'posts' => function($query) {
108 108
                         $query->isPublished();
109 109
                     }
110 110
                 ]
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
      */
121 121
     private function queryPostSlug(Builder $query, array $options)
122 122
     {
123
-        if (!empty($options['post'])) {
123
+        if (!empty($options[ 'post' ])) {
124 124
             $query->whereHas(
125 125
                 'posts',
126
-                function ($query) use ($options) {
127
-                    ModelAbstract::whereTranslatableProperty($query, 'slug', $options['post']);
126
+                function($query) use ($options) {
127
+                    ModelAbstract::whereTranslatableProperty($query, 'slug', $options[ 'post' ]);
128 128
                 }
129 129
             );
130 130
         }
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
      */
139 139
     private function queryLimit(Builder $query, array $options)
140 140
     {
141
-        if (!empty($options['limit'])) {
142
-            $query->take($options['limit']);
141
+        if (!empty($options[ 'limit' ])) {
142
+            $query->take($options[ 'limit' ]);
143 143
         }
144 144
     }
145 145
 
@@ -151,16 +151,16 @@  discard block
 block discarded – undo
151 151
      */
152 152
     private function queryOrderBy(Builder $query, array $options)
153 153
     {
154
-        if (\array_key_exists($options['sort'], static::$sortingOptions)) {
155
-            if ($options['sort'] === 'random') {
154
+        if (\array_key_exists($options[ 'sort' ], static::$sortingOptions)) {
155
+            if ($options[ 'sort' ] === 'random') {
156 156
                 $query->inRandomOrder();
157 157
             } else {
158
-                list($sortField, $sortDirection) = explode(' ', $options['sort']);
158
+                list($sortField, $sortDirection) = explode(' ', $options[ 'sort' ]);
159 159
 
160 160
                 if ($sortField === 'posts_count') {
161 161
                     $query->withCount(
162 162
                         [
163
-                            'posts' => function ($query) {
163
+                            'posts' => function($query) {
164 164
                                 $query->isPublished();
165 165
                             }
166 166
                         ]
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     {
182 182
         $query->with(
183 183
             [
184
-                'posts' => function ($query) {
184
+                'posts' => function($query) {
185 185
                     $query->isPublished();
186 186
                 }
187 187
             ]
Please login to merge, or discard this patch.