Passed
Push — v3 ( 21dc87...5a2177 )
by Andrew
13:57 queued 07:33
created
src/models/MetaSiteVars.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
      * @return null|MetaSiteVars
39 39
      */
40
-    public static function create(array $config = [])
40
+    public static function create(array $config = [ ])
41 41
     {
42 42
         $model = new MetaSiteVars($config);
43 43
         if ($model) {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     /**
99 99
      * @var array Array of links for Same As... sites, indexed by the handle
100 100
      */
101
-    public $sameAsLinks = [];
101
+    public $sameAsLinks = [ ];
102 102
 
103 103
     // Public Methods
104 104
     // =========================================================================
Please login to merge, or discard this patch.
src/models/MetaLink.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      *
46 46
      * @return MetaLink
47 47
      */
48
-    public static function create(array $config = []): MetaLink
48
+    public static function create(array $config = [ ]): MetaLink
49 49
     {
50 50
         foreach ($config as $key => $value) {
51 51
             ArrayHelper::rename($config, $key, Inflector::variablize($key));
@@ -114,15 +114,15 @@  discard block
 block discarded – undo
114 114
     {
115 115
         $rules = parent::rules();
116 116
         $rules = array_merge($rules, [
117
-            [['crossorigin', 'href', 'hreflang', 'media', 'rel', 'sizes', 'type'], 'string'],
118
-            ['crossorigin', 'in', 'range' => [
117
+            [ [ 'crossorigin', 'href', 'hreflang', 'media', 'rel', 'sizes', 'type' ], 'string' ],
118
+            [ 'crossorigin', 'in', 'range' => [
119 119
                 'anonymous',
120 120
                 'use-credentials'
121
-            ]],
122
-            ['href', 'url'],
123
-            ['hreflang', 'string'],
124
-            ['rel', 'required'],
125
-            ['rel', 'in', 'range' => [
121
+            ] ],
122
+            [ 'href', 'url' ],
123
+            [ 'hreflang', 'string' ],
124
+            [ 'rel', 'required' ],
125
+            [ 'rel', 'in', 'range' => [
126 126
                 'alternate',
127 127
                 'author',
128 128
                 'canonical',
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                 'publisher',
142 142
                 'search',
143 143
                 'stylesheet',
144
-            ]],
144
+            ] ],
145 145
         ]);
146 146
 
147 147
         return $rules;
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                 $error = Craft::t(
177 177
                     'seomatic',
178 178
                     '{tagtype} tag `{key}` did not render because it is missing attributes.',
179
-                    ['tagtype' => 'Link', 'key' => $this->key]
179
+                    [ 'tagtype' => 'Link', 'key' => $this->key ]
180 180
                 );
181 181
                 Craft::error($error, __METHOD__);
182 182
                 $shouldRender = false;
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     /**
190 190
      * @inheritdoc
191 191
      */
192
-    public function render($params = []):string
192
+    public function render($params = [ ]):string
193 193
     {
194 194
         $html = '';
195 195
         $configs = $this->tagAttributesArray();
@@ -206,9 +206,9 @@  discard block
 block discarded – undo
206 206
     /**
207 207
      * @inheritdoc
208 208
      */
209
-    public function renderAttributes($params = []): array
209
+    public function renderAttributes($params = [ ]): array
210 210
     {
211
-        $attributes = [];
211
+        $attributes = [ ];
212 212
 
213 213
         $configs = $this->tagAttributesArray();
214 214
         foreach ($configs as $config) {
Please login to merge, or discard this patch.
src/models/MetaScript.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      *
39 39
      * @return MetaScript
40 40
      */
41
-    public static function create(array $config = []): MetaScript
41
+    public static function create(array $config = [ ]): MetaScript
42 42
     {
43 43
         $model = new MetaScript($config);
44 44
         // Load $templateString from the source template if it's not set
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                 ],
163 163
                 'required'
164 164
             ],
165
-            [['vars'], 'safe'],
165
+            [ [ 'vars' ], 'safe' ],
166 166
         ]);
167 167
 
168 168
         return $rules;
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
      *
211 211
      * @return string
212 212
      */
213
-    public function renderBodyHtml($params = []):string
213
+    public function renderBodyHtml($params = [ ]):string
214 214
     {
215 215
         $html = '';
216 216
         if (!empty($this->bodyTemplatePath)) {
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
     /**
226 226
      * @inheritdoc
227 227
      */
228
-    public function render($params = []):string
228
+    public function render($params = [ ]):string
229 229
     {
230 230
         $html = '';
231 231
         if ($this->prepForRender($params)) {
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
     /**
239 239
      * @inheritdoc
240 240
      */
241
-    public function renderAttributes($params = []): array
241
+    public function renderAttributes($params = [ ]): array
242 242
     {
243
-        $attributes = [];
243
+        $attributes = [ ];
244 244
 
245 245
         if ($this->prepForRender($options)) {
246
-            $attributes = ['script' => PluginTemplateHelper::renderStringTemplate($this->templateString, $this->vars)];
246
+            $attributes = [ 'script' => PluginTemplateHelper::renderStringTemplate($this->templateString, $this->vars) ];
247 247
         }
248 248
 
249 249
         return $attributes;
Please login to merge, or discard this patch.
src/models/FrontendTemplateContainer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      *
29 29
      * @var EditableTemplate
30 30
      */
31
-    public $data = [];
31
+    public $data = [ ];
32 32
 
33 33
     // Public Methods
34 34
     // =========================================================================
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     /**
37 37
      * @inheritdoc
38 38
      */
39
-    public function render($params = []): string
39
+    public function render($params = [ ]): string
40 40
     {
41 41
         return '';
42 42
     }
Please login to merge, or discard this patch.
src/models/EditableTemplate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      *
38 38
      * @return null|EditableTemplate
39 39
      */
40
-    public static function create(array $config = [])
40
+    public static function create(array $config = [ ])
41 41
     {
42 42
         $model = new EditableTemplate($config);
43 43
         // Load $templateString from the source template if it's not set
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
     {
102 102
         $rules = parent::rules();
103 103
         $rules = array_merge($rules, [
104
-            [['templateString'], 'required'],
105
-            [['templateString'], 'string'],
104
+            [ [ 'templateString' ], 'required' ],
105
+            [ [ 'templateString' ], 'string' ],
106 106
         ]);
107 107
 
108 108
         return $rules;
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     /**
112 112
      * @inheritdoc
113 113
      */
114
-    public function render($params = []): string
114
+    public function render($params = [ ]): string
115 115
     {
116 116
         $html = PluginTemplateHelper::renderStringTemplate($this->templateString);
117 117
 
Please login to merge, or discard this patch.
src/models/metatag/TwitterDescriptionTag.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         $rules = parent::rules();
54 54
         $rules = array_merge($rules, [
55 55
             // Description tags have a special length
56
-            [['content'], 'string', 'length' => [70, 200], 'on' => ['warning']],
56
+            [ [ 'content' ], 'string', 'length' => [ 70, 200 ], 'on' => [ 'warning' ] ],
57 57
         ]);
58 58
 
59 59
         return $rules;
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
     {
67 67
         $shouldRender = parent::prepForRender($data);
68 68
         if ($shouldRender) {
69
-            if (!empty($data['content'])) {
69
+            if (!empty($data[ 'content' ])) {
70 70
                 // Truncate the Description tag content
71
-                $data['content'] = (string)Stringy::create($data['content'])->safeTruncate(
71
+                $data[ 'content' ] = (string)Stringy::create($data[ 'content' ])->safeTruncate(
72 72
                     200,
73 73
                     '…'
74 74
                 );
Please login to merge, or discard this patch.
src/models/metatag/DescriptionTag.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         $rules = parent::rules();
54 54
         $rules = array_merge($rules, [
55 55
             // Description tags have a special length
56
-            [['content'], 'string', 'length' => [70, Seomatic::$settings->maxDescriptionLength], 'on' => ['warning']],
56
+            [ [ 'content' ], 'string', 'length' => [ 70, Seomatic::$settings->maxDescriptionLength ], 'on' => [ 'warning' ] ],
57 57
         ]);
58 58
 
59 59
         return $rules;
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
     {
67 67
         $shouldRender = parent::prepForRender($data);
68 68
         if ($shouldRender) {
69
-            if (!empty($data['content'])) {
69
+            if (!empty($data[ 'content' ])) {
70 70
                 // Truncate the Description tag content
71
-                $data['content'] = (string)Stringy::create($data['content'])->safeTruncate(
71
+                $data[ 'content' ] = (string)Stringy::create($data[ 'content' ])->safeTruncate(
72 72
                     Seomatic::$settings->maxDescriptionLength,
73 73
                     '…'
74 74
                 );
Please login to merge, or discard this patch.
src/models/metatag/TwitterTitleTag.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $rules = parent::rules();
72 72
         $rules = array_merge($rules, [
73 73
             // Title tags have a special length
74
-            [['content'], 'string', 'length' => [40, Seomatic::$settings->maxTitleLength], 'on' => ['warning']],
74
+            [ [ 'content' ], 'string', 'length' => [ 40, Seomatic::$settings->maxTitleLength ], 'on' => [ 'warning' ] ],
75 75
         ]);
76 76
 
77 77
         return $rules;
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
                     $suffix = '';
129 129
                     break;
130 130
             }
131
-            $lengthAdjust = mb_strlen($prefix.$suffix);
131
+            $lengthAdjust = mb_strlen($prefix . $suffix);
132 132
             // Truncate the twitter:title tag content
133
-            $data['content'] = (string)Stringy::create($data['content'])->safeTruncate(
133
+            $data[ 'content' ] = (string)Stringy::create($data[ 'content' ])->safeTruncate(
134 134
                 Seomatic::$settings->maxTitleLength - $lengthAdjust,
135 135
                 '…'
136 136
             );
137
-            $data['content'] = $prefix.$data['content'].$suffix;
137
+            $data[ 'content' ] = $prefix . $data[ 'content' ] . $suffix;
138 138
         }
139 139
 
140 140
         return $shouldRender;
Please login to merge, or discard this patch.
src/models/metatag/OgDescriptionTag.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         $rules = parent::rules();
54 54
         $rules = array_merge($rules, [
55 55
             // Description tags have a special length
56
-            [['content'], 'string', 'length' => [70, 300], 'on' => ['warning']],
56
+            [ [ 'content' ], 'string', 'length' => [ 70, 300 ], 'on' => [ 'warning' ] ],
57 57
         ]);
58 58
 
59 59
         return $rules;
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
     {
67 67
         $shouldRender = parent::prepForRender($data);
68 68
         if ($shouldRender) {
69
-            if (!empty($data['content'])) {
69
+            if (!empty($data[ 'content' ])) {
70 70
                 // Truncate the Description tag content
71
-                $data['content'] = (string)Stringy::create($data['content'])->safeTruncate(
71
+                $data[ 'content' ] = (string)Stringy::create($data[ 'content' ])->safeTruncate(
72 72
                     300,
73 73
                     '…'
74 74
                 );
Please login to merge, or discard this patch.