Passed
Push — v4 ( 7020b0...4ea8ea )
by Andrew
24:21 queued 11:58
created
src/helpers/MetaValue.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
                 $metaValue = Craft::t(
295 295
                     'seomatic',
296 296
                     'Error rendering `{template}` -> {error}',
297
-                    ['template' => $metaValue, 'error' => $e->getMessage() . ' - ' . print_r($metaValue, true)]
297
+                    ['template' => $metaValue, 'error' => $e->getMessage().' - '.print_r($metaValue, true)]
298 298
                 );
299 299
                 Craft::error($metaValue, __METHOD__);
300 300
                 Craft::$app->getErrorHandler()->logException($e);
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
         // Handle being passed in an object
314 314
         if (is_object($metaValue)) {
315 315
             if ($metaValue instanceof Markup) {
316
-                return trim(html_entity_decode((string)$metaValue, ENT_NOQUOTES, 'UTF-8'));
316
+                return trim(html_entity_decode((string) $metaValue, ENT_NOQUOTES, 'UTF-8'));
317 317
             }
318 318
             if ($metaValue instanceof Asset) {
319 319
                 return $metaValue->uri;
Please login to merge, or discard this patch.
src/helpers/Text.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         if (!empty($string)) {
74 74
             $string = HtmlPurifier::process($string, ['HTML.Allowed' => '']);
75 75
             $string = html_entity_decode($string, ENT_NOQUOTES, 'UTF-8');
76
-            $result = (string)Stringy::create($string)->truncate($length, $substring);
76
+            $result = (string) Stringy::create($string)->truncate($length, $substring);
77 77
         }
78 78
 
79 79
         return $result;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         if (!empty($string)) {
99 99
             $string = HtmlPurifier::process($string, ['HTML.Allowed' => '']);
100 100
             $string = html_entity_decode($string, ENT_NOQUOTES, 'UTF-8');
101
-            $result = (string)Stringy::create($string)->safeTruncate($length, $substring);
101
+            $result = (string) Stringy::create($string)->safeTruncate($length, $substring);
102 102
         }
103 103
 
104 104
         return $result;
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
             $result = self::smartStripTags(Doxter::$plugin->getService()->parseMarkdown($field->getRaw()));
133 133
         } else {
134 134
             if (is_array($field)) {
135
-                $result = self::smartStripTags((string)$field[0]);
135
+                $result = self::smartStripTags((string) $field[0]);
136 136
             } else {
137
-                $result = self::smartStripTags((string)$field);
137
+                $result = self::smartStripTags((string) $field);
138 138
             }
139 139
         }
140 140
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
             $tags = $tags->all();
162 162
         }
163 163
         foreach ($tags as $tag) {
164
-            $result .= $tag->title . ', ';
164
+            $result .= $tag->title.', ';
165 165
         }
166 166
         $result = rtrim($result, ', ');
167 167
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
                     foreach ($fieldClasses as $fieldClassKey) {
204 204
                         if ($field instanceof $fieldClassKey) {
205 205
                             if ($field->handle === $fieldHandle || empty($fieldHandle)) {
206
-                                $result .= self::extractTextFromField($block[$field->handle]) . ' ';
206
+                                $result .= self::extractTextFromField($block[$field->handle]).' ';
207 207
                             }
208 208
                         }
209 209
                     }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
                     foreach ($fieldClasses as $fieldClassKey) {
246 246
                         if ($field instanceof $fieldClassKey) {
247 247
                             if ($field->handle === $fieldHandle || empty($fieldHandle)) {
248
-                                $result .= self::extractTextFromField($block[$field->handle]) . ' ';
248
+                                $result .= self::extractTextFromField($block[$field->handle]).' ';
249 249
                             }
250 250
                         }
251 251
                     }
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
                     foreach ($fieldClasses as $fieldClassKey) {
295 295
                         if ($field instanceof $fieldClassKey) {
296 296
                             if ($field->handle === $fieldHandle || empty($fieldHandle)) {
297
-                                $result .= self::extractTextFromField($block[$field->handle]) . ' ';
297
+                                $result .= self::extractTextFromField($block[$field->handle]).' ';
298 298
                             }
299 299
                         }
300 300
                     }
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
         $str = html_entity_decode($str, ENT_NOQUOTES, 'UTF-8');
394 394
         $str = rawurldecode($str);
395 395
         // Remove any linebreaks
396
-        $str = (string)preg_replace("/\r|\n/", "", $str);
396
+        $str = (string) preg_replace("/\r|\n/", "", $str);
397 397
         $str = HtmlPurifier::process($str, ['HTML.Allowed' => '']);
398 398
         $str = html_entity_decode($str, ENT_NOQUOTES, 'UTF-8');
399 399
         // Remove any embedded Twig code
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
             $language = 'English';
474 474
         }
475 475
 
476
-        $className = 'PhpScience\\TextRank\\Tool\\StopWords\\' . ucfirst($language);
476
+        $className = 'PhpScience\\TextRank\\Tool\\StopWords\\'.ucfirst($language);
477 477
         if (class_exists($className)) {
478 478
             $stopWords = new $className();
479 479
         }
Please login to merge, or discard this patch.
src/debug/views/seomatic/render-tag.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,8 +75,11 @@
 block discarded – undo
75 75
                     </ul><?php endif; ?><?php endforeach; ?><?php endif; ?></div>
76 76
         </details>
77 77
     </td>
78
-<?php else: ?>
78
+<?php else {
79
+    : ?>
79 80
     <td>
80 81
         <div class="callout callout-secondary seomatic-callout">not included</div>
81 82
     </td>
82
-<?php endif; ?>
83
+<?php endif;
84
+}
85
+?>
Please login to merge, or discard this patch.
src/debug/views/seomatic/render-value.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,10 @@
 block discarded – undo
45 45
             </div>
46 46
         </details>
47 47
     </td>
48
-<?php else: ?>
48
+<?php else {
49
+    : ?>
49 50
     <td><?= htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES | ENT_SUBSTITUTE,
50 51
             Yii::$app->charset, true) ?></td>
51
-<?php endif; ?>
52
+<?php endif;
53
+}
54
+?>
Please login to merge, or discard this patch.
src/seoelements/SeoEvent.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
         $query
242 242
             ->setCalendar($metaBundle->sourceHandle)
243 243
             ->setLoadOccurrences(false)
244
-            ->siteId((int)$metaBundle->sourceSiteId)
245
-            ->limit((int)$metaBundle->metaSitemapVars->sitemapLimit);
244
+            ->siteId((int) $metaBundle->sourceSiteId)
245
+            ->limit((int) $metaBundle->metaSitemapVars->sitemapLimit);
246 246
 
247 247
         return $query;
248 248
     }
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
             ConfigHelper::getConfigFromFile(self::configFilePath()),
406 406
             [
407 407
                 'sourceId' => $sourceModel->id,
408
-                'sourceName' => (string)$sourceModel->name,
408
+                'sourceName' => (string) $sourceModel->name,
409 409
                 'sourceHandle' => $sourceModel->handle,
410 410
             ]
411 411
         );
Please login to merge, or discard this patch.
src/base/FluentModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
         // Set the property
68 68
         $value = $args[0];
69 69
         if (is_object($value) && $value instanceof Markup) {
70
-            $value = (string)$value;
70
+            $value = (string) $value;
71 71
         }
72 72
         $property->setValue($this, $value);
73 73
 
Please login to merge, or discard this patch.
src/base/MetaItem.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                 // Add a URL to the schema.org type if this is a MetaJsonLD object
163 163
                 if ($isMetaJsonLdModel) {
164 164
                     /** @var MetaJsonLd $this */
165
-                    $extraInfo = ' for http://schema.org/' . $this->type;
165
+                    $extraInfo = ' for http://schema.org/'.$this->type;
166 166
                 }
167 167
                 $errorMsg =
168 168
                     Craft::t('seomatic', 'Scenario: "')
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
                     . print_r($this->render(), true);
174 174
                 Craft::info($errorMsg, __METHOD__);
175 175
                 foreach ($this->errors as $param => $errors) {
176
-                    $errorMsg = Craft::t('seomatic', $errorLabel) . $param;
176
+                    $errorMsg = Craft::t('seomatic', $errorLabel).$param;
177 177
                     /** @var array $errors */
178 178
                     foreach ($errors as $error) {
179
-                        $errorMsg .= ' -> ' . $error;
179
+                        $errorMsg .= ' -> '.$error;
180 180
                         // Change the error level depending on the error message if this is a MetaJsonLD object
181 181
                         if ($isMetaJsonLdModel) {
182 182
                             if (strpos($error, 'recommended') !== false) {
@@ -189,14 +189,14 @@  discard block
 block discarded – undo
189 189
                             }
190 190
                         }
191 191
                     }
192
-                    Craft::info(strtoupper($logLevel) . ' - ' . $errorMsg, __METHOD__);
192
+                    Craft::info(strtoupper($logLevel).' - '.$errorMsg, __METHOD__);
193 193
                     // Extra debugging info for MetaJsonLd objects
194 194
                     if ($isMetaJsonLdModel) {
195 195
                         /** @var MetaJsonLd $className */
196 196
                         $className = get_class($this);
197 197
                         if (!empty($className->schemaPropertyDescriptions[$param])) {
198
-                            $errorMsg = Craft::t('seomatic', $errorLabel) . $param;
199
-                            $errorMsg .= ' -> ' . $className->schemaPropertyDescriptions[$param];
198
+                            $errorMsg = Craft::t('seomatic', $errorLabel).$param;
199
+                            $errorMsg .= ' -> '.$className->schemaPropertyDescriptions[$param];
200 200
                             Craft::info($errorMsg, __METHOD__);
201 201
                         }
202 202
                     }
Please login to merge, or discard this patch.
src/models/MetaSiteVars.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -238,10 +238,10 @@
 block discarded – undo
238 238
         }
239 239
         // Make sure these are strings
240 240
         if (!empty($this->facebookProfileId)) {
241
-            $this->facebookProfileId = (string)$this->facebookProfileId;
241
+            $this->facebookProfileId = (string) $this->facebookProfileId;
242 242
         }
243 243
         if (!empty($this->facebookAppId)) {
244
-            $this->facebookAppId = (string)$this->facebookAppId;
244
+            $this->facebookAppId = (string) $this->facebookAppId;
245 245
         }
246 246
         // Identity
247 247
         if (is_array($this->identity)) {
Please login to merge, or discard this patch.
src/helpers/Schema.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             // Go from most specific type to least specific type
101 101
             foreach (self::SCHEMA_TYPES as $schemaType) {
102 102
                 if (!empty($settings[$schemaType]) && ($settings[$schemaType] !== 'none')) {
103
-                    $result = $settings[$schemaType] . self::SCHEMA_PATH_DELIMITER . $result;
103
+                    $result = $settings[$schemaType].self::SCHEMA_PATH_DELIMITER.$result;
104 104
                 }
105 105
             }
106 106
         }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             if (isset($result['schemaTypeDescription'])) {
132 132
                 $description = $result['schemaTypeDescription'];
133 133
                 $description = preg_replace("`\[\[([A-z]*)\]\]`", '[$1](https://schema.org/$1)', $description);
134
-                $description = Markdown::process((string)$description);
134
+                $description = Markdown::process((string) $description);
135 135
                 $description = str_replace(['<p>', '</p>', '\n'], ['', '', ' '], $description);
136 136
                 $result['schemaTypeDescription'] = $description;
137 137
             }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     {
152 152
         $result = [];
153 153
         while ($schemaType) {
154
-            $className = 'nystudio107\\seomatic\\models\\jsonld\\' . $schemaType;
154
+            $className = 'nystudio107\\seomatic\\models\\jsonld\\'.$schemaType;
155 155
             if (class_exists($className)) {
156 156
                 $classRef = new ReflectionClass($className);
157 157
                 $staticProps = $classRef->getStaticProperties();
@@ -248,15 +248,15 @@  discard block
 block discarded – undo
248 248
         $dependency = new TagDependency([
249 249
             'tags' => [
250 250
                 self::GLOBAL_SCHEMA_CACHE_TAG,
251
-                self::SCHEMA_CACHE_TAG . 'schemaArray',
251
+                self::SCHEMA_CACHE_TAG.'schemaArray',
252 252
             ],
253 253
         ]);
254 254
         $cache = Craft::$app->getCache();
255 255
         $typesArray = $cache->getOrSet(
256
-            self::CACHE_KEY . 'schemaArray',
256
+            self::CACHE_KEY.'schemaArray',
257 257
             function() use ($path) {
258 258
                 Craft::info(
259
-                    'schemaArray cache miss' . $path,
259
+                    'schemaArray cache miss'.$path,
260 260
                     __METHOD__
261 261
                 );
262 262
                 $filePath = Craft::getAlias('@nystudio107/seomatic/resources/schema/tree.jsonld');
@@ -321,12 +321,12 @@  discard block
 block discarded – undo
321 321
         $dependency = new TagDependency([
322 322
             'tags' => [
323 323
                 self::GLOBAL_SCHEMA_CACHE_TAG,
324
-                self::SCHEMA_CACHE_TAG . 'schemaTree',
324
+                self::SCHEMA_CACHE_TAG.'schemaTree',
325 325
             ],
326 326
         ]);
327 327
         $cache = Craft::$app->getCache();
328 328
         $typesArray = $cache->getOrSet(
329
-            self::CACHE_KEY . 'schemaTree',
329
+            self::CACHE_KEY.'schemaTree',
330 330
             function() {
331 331
                 Craft::info(
332 332
                     'schemaArray cache miss',
@@ -390,11 +390,11 @@  discard block
 block discarded – undo
390 390
         foreach ($typesArray as $key => $value) {
391 391
             $indent = html_entity_decode(str_repeat('&nbsp;', $indentLevel));
392 392
             if (is_array($value)) {
393
-                $result[$key] = $indent . $key;
393
+                $result[$key] = $indent.$key;
394 394
                 $value = self::flattenSchemaArray($value, $indentLevel + self::MENU_INDENT_STEP);
395 395
                 $result = array_merge($result, $value);
396 396
             } else {
397
-                $result[$key] = $indent . $value;
397
+                $result[$key] = $indent.$value;
398 398
             }
399 399
         }
400 400
 
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
             $children = [];
489 489
             $name = $typesArray['name'];
490 490
             // Construct a path-based $id, excluding the top-level `Thing` schema
491
-            $id = $name === 'Thing' ? '' : $path . self::SCHEMA_PATH_DELIMITER . $name;
491
+            $id = $name === 'Thing' ? '' : $path.self::SCHEMA_PATH_DELIMITER.$name;
492 492
             $id = ltrim($id, self::SCHEMA_PATH_DELIMITER);
493 493
             // Make sure we have at most 3 specifiers in the schema path
494 494
             $parts = explode(self::SCHEMA_PATH_DELIMITER, $id);
@@ -515,12 +515,12 @@  discard block
 block discarded – undo
515 515
             $schemaPath = explode(self::SCHEMA_PATH_DELIMITER, $id);
516 516
             // Use only the specific (last) type for now, rather than the complete path of types
517 517
             $schemaPath = [end($schemaPath)];
518
-            if ((bool)array_intersect($schemaPath, array_keys($googleRichSnippetTypes))) {
519
-                $name .= ' (' . Craft::t('seomatic', 'Google rich result') . ')';
518
+            if ((bool) array_intersect($schemaPath, array_keys($googleRichSnippetTypes))) {
519
+                $name .= ' ('.Craft::t('seomatic', 'Google rich result').')';
520 520
             }
521 521
             // Mark it as pending, if applicable
522 522
             if (isset($typesArray['pending']) && $typesArray['pending']) {
523
-                $name .= ' (' . Craft::t('seomatic', 'pending') . ')';
523
+                $name .= ' ('.Craft::t('seomatic', 'pending').')';
524 524
             }
525 525
             $result['label'] = $name;
526 526
             $result['id'] = $id;
@@ -539,12 +539,12 @@  discard block
 block discarded – undo
539 539
         $dependency = new TagDependency([
540 540
             'tags' => [
541 541
                 self::GLOBAL_SCHEMA_CACHE_TAG,
542
-                self::SCHEMA_CACHE_TAG . 'googleRichSnippets',
542
+                self::SCHEMA_CACHE_TAG.'googleRichSnippets',
543 543
             ],
544 544
         ]);
545 545
         $cache = Craft::$app->getCache();
546 546
         return $cache->getOrSet(
547
-            self::CACHE_KEY . 'googleRichSnippets',
547
+            self::CACHE_KEY.'googleRichSnippets',
548 548
             function() {
549 549
                 Craft::info(
550 550
                     'googleRichSnippets cache miss',
Please login to merge, or discard this patch.