Passed
Push — develop ( 674324...27f087 )
by Andrew
40:51 queued 22:51
created
src/models/SitemapIndexTemplate.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function getFilename(int $groupId): string
118 118
     {
119
-        return 'sitemaps-' . $groupId . '-sitemap.xml';
119
+        return 'sitemaps-'.$groupId.'-sitemap.xml';
120 120
     }
121 121
 
122 122
     /**
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             ],
150 150
         ]);
151 151
 
152
-        return $cache->getOrSet(self::CACHE_KEY.$groupId.'.'.$siteId, function () use ($groupSiteIds, $siteId) {
152
+        return $cache->getOrSet(self::CACHE_KEY.$groupId.'.'.$siteId, function() use ($groupSiteIds, $siteId) {
153 153
             Craft::info(
154 154
                 'Sitemap index cache miss',
155 155
                 __METHOD__
Please login to merge, or discard this patch.
src/seomatic-config/globalmeta/FrontendTemplatesContainer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     'name' => 'Frontend Templates',
23 23
     'description' => 'Templates that are rendered on the frontend',
24 24
     'handle' => FrontendTemplates::FRONTENDTEMPLATES_CONTAINER,
25
-    'class' => (string)FrontendTemplateContainer::class,
25
+    'class' => (string) FrontendTemplateContainer::class,
26 26
     'include' => true,
27 27
     'data' => [
28 28
         FrontendTemplates::HUMANS_TXT_HANDLE => [
Please login to merge, or discard this patch.
src/helpers/DynamicMeta.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     {
85 85
         if ($pageInfo !== null && $pageInfo->currentPage !== null) {
86 86
             // Let the meta containers know that this page is paginated
87
-            Seomatic::$plugin->metaContainers->paginationPage = (string)$pageInfo->currentPage;
87
+            Seomatic::$plugin->metaContainers->paginationPage = (string) $pageInfo->currentPage;
88 88
             // See if we should strip the query params
89 89
             $stripQueryParams = true;
90 90
             $pageTrigger = Craft::$app->getConfig()->getGeneral()->pageTrigger;
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                     if (is_array($content)) {
158 158
                         $headerValue = '';
159 159
                         foreach ($content as $contentVal) {
160
-                            $headerValue .= ($contentVal . ',');
160
+                            $headerValue .= ($contentVal.',');
161 161
                         }
162 162
                         $headerValue = rtrim($headerValue, ',');
163 163
                     } else {
@@ -176,11 +176,11 @@  discard block
 block discarded – undo
176 176
                     if (is_array($href)) {
177 177
                         $headerValue = '';
178 178
                         foreach ($href as $hrefVal) {
179
-                            $headerValue .= ('<' . $hrefVal . '>' . ',');
179
+                            $headerValue .= ('<'.$hrefVal.'>'.',');
180 180
                         }
181 181
                         $headerValue = rtrim($headerValue, ',');
182 182
                     } else {
183
-                        $headerValue = '<' . $href . '>';
183
+                        $headerValue = '<'.$href.'>';
184 184
                     }
185 185
                     $headerValue .= "; rel='canonical'";
186 186
                     $response->headers->add('Link', $headerValue);
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
                     if (is_array($content)) {
197 197
                         $headerValue = '';
198 198
                         foreach ($content as $contentVal) {
199
-                            $headerValue .= ($contentVal . ',');
199
+                            $headerValue .= ($contentVal.',');
200 200
                         }
201 201
                         $headerValue = rtrim($headerValue, ',');
202 202
                     } else {
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
         if ($lastElement && $element) {
383 383
             if ($lastElement->uri !== '__home__' && $element->uri) {
384 384
                 $path = $lastElement->uri;
385
-                $segments = array_values(array_filter(explode('/', $path), function ($segment) {
385
+                $segments = array_values(array_filter(explode('/', $path), function($segment) {
386 386
                     return $segment !== '';
387 387
                 }));
388 388
             }
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
                     $element = $elements->getElementByUri($url, $site->id, false);
543 543
                 }
544 544
                 if ($element !== null) {
545
-                    if (isset($element->enabledForSite) && !(bool)$element->enabledForSite) {
545
+                    if (isset($element->enabledForSite) && !(bool) $element->enabledForSite) {
546 546
                         $includeUrl = false;
547 547
                     }
548 548
                     /** @var MetaBundle $metaBundle */
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
                 if (isset($value[$day][$time])
796 796
                     && ($date = DateTimeHelper::toDateTime($value[$day][$time])) !== false
797 797
                 ) {
798
-                    $normalized[$day][$time] = (array)($date);
798
+                    $normalized[$day][$time] = (array) ($date);
799 799
                 } else {
800 800
                     $normalized[$day][$time] = null;
801 801
                 }
Please login to merge, or discard this patch.
src/services/MetaBundles.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
      * @param MetaBundle $metaBundle
176 176
      * @param bool $forceUpdate
177 177
      */
178
-    public function syncBundleWithConfig(MetaBundle &$metaBundle, bool $forceUpdate = false)
178
+    public function syncBundleWithConfig(MetaBundle & $metaBundle, bool $forceUpdate = false)
179 179
     {
180 180
         $prevMetaBundle = $metaBundle;
181 181
         $config = [];
@@ -304,8 +304,8 @@  discard block
 block discarded – undo
304 304
      */
305 305
     public function updateMetaBundle(MetaBundle $metaBundle, int $siteId)
306 306
     {
307
-        $metaBundle->sourceName = (string)$metaBundle->sourceName;
308
-        $metaBundle->sourceTemplate = (string)$metaBundle->sourceTemplate;
307
+        $metaBundle->sourceName = (string) $metaBundle->sourceName;
308
+        $metaBundle->sourceTemplate = (string) $metaBundle->sourceTemplate;
309 309
         // Make sure it validates
310 310
         if ($metaBundle->validate(null, true)) {
311 311
             // Save it out to a record
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
                 'sourceSiteId' => $siteId,
316 316
             ];
317 317
             if ($metaBundle->typeId !== null) {
318
-                $metaBundle->typeId = (int)$metaBundle->typeId;
318
+                $metaBundle->typeId = (int) $metaBundle->typeId;
319 319
             }
320 320
             if (!empty($metaBundle->typeId)) {
321 321
                 $params['typeId'] = $metaBundle->typeId;
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
             // @TODO remove this hack that doesn't allow environment-transformed settings to be saved in a meta bundle with a proper system to address it
332 332
             // The issue was that the containers were getting saved to the db with a hard-coded setting in them, because they'd
333 333
             // been set that way by the environment, whereas to be changeable via the GUI, it needs to be set to {seomatic.meta.robots}
334
-            $robotsTag = $metaBundle->metaContainers[MetaTagContainer::CONTAINER_TYPE . TagService::GENERAL_HANDLE]->data['robots'] ?? null;
334
+            $robotsTag = $metaBundle->metaContainers[MetaTagContainer::CONTAINER_TYPE.TagService::GENERAL_HANDLE]->data['robots'] ?? null;
335 335
             if (!empty($robotsTag)) {
336 336
                 $robotsTag->content = $robotsTag->environment['live']['content'] ?? '{seomatic.meta.robots}';
337 337
             }
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
                 $metaBundleDefaults = ArrayHelper::merge(
414 414
                     $seoElement::metaBundleConfig($sourceModel),
415 415
                     [
416
-                        'sourceTemplate' => (string)$siteSetting->template,
416
+                        'sourceTemplate' => (string) $siteSetting->template,
417 417
                         'sourceSiteId' => $siteSetting->siteId,
418 418
                         'sourceAltSiteSettings' => $siteSettingsArray,
419 419
                         'sourceDateUpdated' => $dateUpdated,
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
     public function getMetaBundleBySourceHandle(string $sourceBundleType, string $sourceHandle, int $sourceSiteId, $typeId = null)
462 462
     {
463 463
         $metaBundle = null;
464
-        $typeId = (int)$typeId;
464
+        $typeId = (int) $typeId;
465 465
         // See if we have the meta bundle cached
466 466
         if (!empty($this->metaBundlesBySourceHandle[$sourceBundleType][$sourceHandle][$sourceSiteId][$typeId])) {
467 467
             $id = $this->metaBundlesBySourceHandle[$sourceBundleType][$sourceHandle][$sourceSiteId][$typeId];
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
                             /** @var Section|CategoryGroup|ProductType $sourceModel */
549 549
                             $sourceModel = $seoElement::sourceModelFromId($sourceId);
550 550
                             if ($sourceModel !== null) {
551
-                                $metaBundle->sourceName = (string)$sourceModel->name;
551
+                                $metaBundle->sourceName = (string) $sourceModel->name;
552 552
                                 $metaBundle->sourceHandle = $sourceModel->handle;
553 553
                             }
554 554
                         }
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
     public function getMetaBundleBySourceId(string $sourceBundleType, int $sourceId, int $sourceSiteId, $typeId = null)
589 589
     {
590 590
         $metaBundle = null;
591
-        $typeId = (int)$typeId;
591
+        $typeId = (int) $typeId;
592 592
         // See if we have the meta bundle cached
593 593
         if (!empty($this->metaBundlesBySourceId[$sourceBundleType][$sourceId][$sourceSiteId][$typeId])) {
594 594
             $id = $this->metaBundlesBySourceId[$sourceBundleType][$sourceId][$sourceSiteId][$typeId];
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
                 ->from(['{{%seomatic_metabundles}}'])
785 785
                 ->where(['=', 'sourceBundleType', $seoElement::META_BUNDLE_TYPE]);
786 786
 
787
-            if ((int)$sourceSiteId !== 0) {
787
+            if ((int) $sourceSiteId !== 0) {
788 788
                 $subQuery->andWhere(['sourceSiteId' => $sourceSiteId]);
789 789
             }
790 790
             if ($filter !== '') {
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
     public function getContentMetaBundleForElement(Element $element)
822 822
     {
823 823
         $source = $this->getMetaSourceFromElement($element);
824
-        $key = implode(".", $source) . '.' . $element->siteId;
824
+        $key = implode(".", $source).'.'.$element->siteId;
825 825
 
826 826
         if (empty($this->elementContentMetaBundles[$key])) {
827 827
             $this->elementContentMetaBundles[$key] = $this->getMetaBundleBySourceId($source[1], $source[0], $element->siteId, $source[4]);
Please login to merge, or discard this patch.
src/helpers/Container.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -81,24 +81,24 @@
 block discarded – undo
81 81
         $metaContainers = Seomatic::$plugin->metaContainers;
82 82
         // Get our cache key
83 83
         $asArrayKey = $asArray ? 'true' : 'false';
84
-        $cacheKey = $uri . $siteId . implode($containerKeys) . $asArrayKey . Seomatic::$environment;
84
+        $cacheKey = $uri.$siteId.implode($containerKeys).$asArrayKey.Seomatic::$environment;
85 85
         // Load the meta containers
86 86
         $dependency = new TagDependency([
87 87
             'tags' => [
88 88
                 $metaContainers::GLOBAL_METACONTAINER_CACHE_TAG,
89
-                $metaContainers::METACONTAINER_CACHE_TAG . $sourceId . $sourceBundleType . $siteId,
90
-                $metaContainers::METACONTAINER_CACHE_TAG . $uri . $siteId,
91
-                $metaContainers::METACONTAINER_CACHE_TAG . $cacheKey,
89
+                $metaContainers::METACONTAINER_CACHE_TAG.$sourceId.$sourceBundleType.$siteId,
90
+                $metaContainers::METACONTAINER_CACHE_TAG.$uri.$siteId,
91
+                $metaContainers::METACONTAINER_CACHE_TAG.$cacheKey,
92 92
             ],
93 93
         ]);
94 94
 
95 95
         $cache = Craft::$app->getCache();
96 96
         $result = $cache->getOrSet(
97
-            self::CACHE_KEY . $cacheKey,
98
-            function () use ($uri, $siteId, $containerKeys, $asArray) {
97
+            self::CACHE_KEY.$cacheKey,
98
+            function() use ($uri, $siteId, $containerKeys, $asArray) {
99 99
                 $result = [];
100 100
                 Craft::info(
101
-                    'Meta controller container cache miss: ' . $uri . '/' . $siteId,
101
+                    'Meta controller container cache miss: '.$uri.'/'.$siteId,
102 102
                     __METHOD__
103 103
                 );
104 104
                 // Load the meta containers and parse our globals
Please login to merge, or discard this patch.
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
                 /** @var Asset $metaValue */
Please login to merge, or discard this patch.
src/helpers/PullField.php 1 patch
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -65,19 +65,19 @@  discard block
 block discarded – undo
65 65
         }
66 66
         foreach (self::PULL_TEXT_FIELDS as $fields) {
67 67
             $fieldName = $fields['fieldName'];
68
-            $source = $bundleSettings[$fieldName . 'Source'] ?? '';
69
-            $sourceField = $bundleSettings[$fieldName . 'Field'] ?? '';
68
+            $source = $bundleSettings[$fieldName.'Source'] ?? '';
69
+            $sourceField = $bundleSettings[$fieldName.'Field'] ?? '';
70 70
             if (!empty($source)) {
71 71
                 $seoField = $fields['seoField'];
72 72
                 switch ($source) {
73 73
                     case 'sameAsSeo':
74 74
                         $globalsSettings[$fieldName] =
75
-                            '{{ seomatic.meta.' . $seoField . ' }}';
75
+                            '{{ seomatic.meta.'.$seoField.' }}';
76 76
                         break;
77 77
 
78 78
                     case 'sameAsSiteTwitter':
79 79
                         $globalsSettings[$fieldName] =
80
-                            '{{ seomatic.site.' . $seoField . ' }}';
80
+                            '{{ seomatic.site.'.$seoField.' }}';
81 81
                         break;
82 82
 
83 83
                     case 'sameAsGlobal':
@@ -88,28 +88,28 @@  discard block
 block discarded – undo
88 88
                     case 'fromField':
89 89
                         $globalsSettings[$fieldName] =
90 90
                             '{{ seomatic.helper.extractTextFromField('
91
-                            . $objectPrefix . $elementName . $sourceField
91
+                            . $objectPrefix.$elementName.$sourceField
92 92
                             . ') }}';
93 93
                         break;
94 94
 
95 95
                     case 'fromUserField':
96 96
                         $globalsSettings[$fieldName] =
97 97
                             '{{ seomatic.helper.extractTextFromField('
98
-                            . $objectPrefix . $elementName . 'author.' . $sourceField
98
+                            . $objectPrefix.$elementName.'author.'.$sourceField
99 99
                             . ') }}';
100 100
                         break;
101 101
 
102 102
                     case 'summaryFromField':
103 103
                         $globalsSettings[$fieldName] =
104 104
                             '{{ seomatic.helper.extractSummary(seomatic.helper.extractTextFromField('
105
-                            . $objectPrefix . $elementName . $sourceField
105
+                            . $objectPrefix.$elementName.$sourceField
106 106
                             . ')) }}';
107 107
                         break;
108 108
 
109 109
                     case 'keywordsFromField':
110 110
                         $globalsSettings[$fieldName] =
111 111
                             '{{ seomatic.helper.extractKeywords(seomatic.helper.extractTextFromField('
112
-                            . $objectPrefix . $elementName . $sourceField
112
+                            . $objectPrefix.$elementName.$sourceField
113 113
                             . ')) }}';
114 114
                         break;
115 115
 
@@ -140,25 +140,25 @@  discard block
 block discarded – undo
140 140
         }
141 141
         foreach (self::PULL_ASSET_FIELDS as $fields) {
142 142
             $fieldName = $fields['fieldName'];
143
-            $fieldNameWidth = $fields['fieldName'] . 'Width';
144
-            $fieldNameHeight = $fields['fieldName'] . 'Height';
145
-            $source = $bundleSettings[$fieldName . 'Source'] ?? '';
146
-            $ids = $bundleSettings[$fieldName . 'Ids'] ?? [];
147
-            $sourceField = $bundleSettings[$fieldName . 'Field'] ?? '';
143
+            $fieldNameWidth = $fields['fieldName'].'Width';
144
+            $fieldNameHeight = $fields['fieldName'].'Height';
145
+            $source = $bundleSettings[$fieldName.'Source'] ?? '';
146
+            $ids = $bundleSettings[$fieldName.'Ids'] ?? [];
147
+            $sourceField = $bundleSettings[$fieldName.'Field'] ?? '';
148 148
             if (!empty($source)) {
149
-                $transformImage = $bundleSettings[$fieldName . 'Transform'] ?? true;
149
+                $transformImage = $bundleSettings[$fieldName.'Transform'] ?? true;
150 150
                 $seoField = $fields['seoField'];
151 151
                 $tranformModeField = $fields['transformModeField'];
152 152
                 $transformMode = $bundleSettings[$tranformModeField] ?? 'crop';
153 153
                 if (empty($transformMode)) {
154 154
                     $transformMode = 'crop';
155 155
                 }
156
-                $seoFieldWidth = $fields['seoField'] . 'Width';
157
-                $seoFieldHeight = $fields['seoField'] . 'Height';
156
+                $seoFieldWidth = $fields['seoField'].'Width';
157
+                $seoFieldHeight = $fields['seoField'].'Height';
158 158
                 $transformName = $fields['transformName'] ?? 'base';
159 159
                 // Quote all the things here for clarity
160
-                $transformName = '"' . $transformName . '"';
161
-                $transformMode = '"' . $transformMode . '"';
160
+                $transformName = '"'.$transformName.'"';
161
+                $transformMode = '"'.$transformMode.'"';
162 162
                 // Special-case Twitter transforms
163 163
                 if ($fieldName === 'twitterImage') {
164 164
                     $transformName = 'seomatic.helper.twitterTransform()';
@@ -173,30 +173,30 @@  discard block
 block discarded – undo
173 173
                 if ($transformImage) {
174 174
                     switch ($source) {
175 175
                         case 'sameAsSeo':
176
-                            $seoSource = $bundleSettings[$seoField . 'Source'] ?? '';
177
-                            $seoIds = $bundleSettings[$seoField . 'Ids'] ?? [];
178
-                            $seoSourceField = $bundleSettings[$seoField . 'Field'] ?? '';
176
+                            $seoSource = $bundleSettings[$seoField.'Source'] ?? '';
177
+                            $seoIds = $bundleSettings[$seoField.'Ids'] ?? [];
178
+                            $seoSourceField = $bundleSettings[$seoField.'Field'] ?? '';
179 179
                             if (!empty($seoSource)) {
180 180
                                 switch ($seoSource) {
181 181
                                     case 'fromField':
182 182
                                         if (!empty($seoSourceField)) {
183 183
                                             $globalsSettings[$fieldName] = '{{ seomatic.helper.socialTransform('
184
-                                                . $objectPrefix . $elementName . $seoSourceField
185
-                                                . ', ' . $transformName
186
-                                                . ', ' . $siteId
187
-                                                . ', ' . $transformMode
184
+                                                . $objectPrefix.$elementName.$seoSourceField
185
+                                                . ', '.$transformName
186
+                                                . ', '.$siteId
187
+                                                . ', '.$transformMode
188 188
                                                 . ') }}';
189 189
                                             $globalsSettings[$fieldNameWidth] = '{{ seomatic.helper.socialTransformWidth('
190
-                                                . $objectPrefix . $elementName . $seoSourceField
191
-                                                . ', ' . $transformName
192
-                                                . ', ' . $siteId
193
-                                                . ', ' . $transformMode
190
+                                                . $objectPrefix.$elementName.$seoSourceField
191
+                                                . ', '.$transformName
192
+                                                . ', '.$siteId
193
+                                                . ', '.$transformMode
194 194
                                                 . ') }}';
195 195
                                             $globalsSettings[$fieldNameHeight] = '{{ seomatic.helper.socialTransformHeight('
196
-                                                . $objectPrefix . $elementName . $seoSourceField
197
-                                                . ', ' . $transformName
198
-                                                . ', ' . $siteId
199
-                                                . ', ' . $transformMode
196
+                                                . $objectPrefix.$elementName.$seoSourceField
197
+                                                . ', '.$transformName
198
+                                                . ', '.$siteId
199
+                                                . ', '.$transformMode
200 200
                                                 . ') }}';
201 201
                                         }
202 202
                                         break;
@@ -204,28 +204,28 @@  discard block
 block discarded – undo
204 204
                                         if (!empty($seoIds)) {
205 205
                                             $globalsSettings[$fieldName] = '{{ seomatic.helper.socialTransform('
206 206
                                                 . $seoIds[0]
207
-                                                . ', ' . $transformName
208
-                                                . ', ' . $siteId
209
-                                                . ', ' . $transformMode
207
+                                                . ', '.$transformName
208
+                                                . ', '.$siteId
209
+                                                . ', '.$transformMode
210 210
                                                 . ') }}';
211 211
                                             $globalsSettings[$fieldNameWidth] = '{{ seomatic.helper.socialTransformWidth('
212 212
                                                 . $seoIds[0]
213
-                                                . ', ' . $transformName
214
-                                                . ', ' . $siteId
215
-                                                . ', ' . $transformMode
213
+                                                . ', '.$transformName
214
+                                                . ', '.$siteId
215
+                                                . ', '.$transformMode
216 216
                                                 . ') }}';
217 217
                                             $globalsSettings[$fieldNameHeight] = '{{ seomatic.helper.socialTransformHeight('
218 218
                                                 . $seoIds[0]
219
-                                                . ', ' . $transformName
220
-                                                . ', ' . $siteId
221
-                                                . ', ' . $transformMode
219
+                                                . ', '.$transformName
220
+                                                . ', '.$siteId
221
+                                                . ', '.$transformMode
222 222
                                                 . ') }}';
223 223
                                         }
224 224
                                         break;
225 225
                                     default:
226
-                                        $globalsSettings[$fieldName] = '{{ seomatic.meta.' . $seoField . ' }}';
227
-                                        $globalsSettings[$fieldNameWidth] = '{{ seomatic.meta.' . $seoFieldWidth . ' }}';
228
-                                        $globalsSettings[$fieldNameHeight] = '{{ seomatic.meta.' . $seoFieldHeight . ' }}';
226
+                                        $globalsSettings[$fieldName] = '{{ seomatic.meta.'.$seoField.' }}';
227
+                                        $globalsSettings[$fieldNameWidth] = '{{ seomatic.meta.'.$seoFieldWidth.' }}';
228
+                                        $globalsSettings[$fieldNameHeight] = '{{ seomatic.meta.'.$seoFieldHeight.' }}';
229 229
                                         break;
230 230
                                 }
231 231
                             }
@@ -233,22 +233,22 @@  discard block
 block discarded – undo
233 233
                         case 'fromField':
234 234
                             if (!empty($sourceField)) {
235 235
                                 $globalsSettings[$fieldName] = '{{ seomatic.helper.socialTransform('
236
-                                    . $objectPrefix . $elementName . $sourceField
237
-                                    . ', ' . $transformName
238
-                                    . ', ' . $siteId
239
-                                    . ', ' . $transformMode
236
+                                    . $objectPrefix.$elementName.$sourceField
237
+                                    . ', '.$transformName
238
+                                    . ', '.$siteId
239
+                                    . ', '.$transformMode
240 240
                                     . ') }}';
241 241
                                 $globalsSettings[$fieldNameWidth] = '{{ seomatic.helper.socialTransformWidth('
242
-                                    . $objectPrefix . $elementName . $sourceField
243
-                                    . ', ' . $transformName
244
-                                    . ', ' . $siteId
245
-                                    . ', ' . $transformMode
242
+                                    . $objectPrefix.$elementName.$sourceField
243
+                                    . ', '.$transformName
244
+                                    . ', '.$siteId
245
+                                    . ', '.$transformMode
246 246
                                     . ') }}';
247 247
                                 $globalsSettings[$fieldNameHeight] = '{{ seomatic.helper.socialTransformHeight('
248
-                                    . $objectPrefix . $elementName . $sourceField
249
-                                    . ', ' . $transformName
250
-                                    . ', ' . $siteId
251
-                                    . ', ' . $transformMode
248
+                                    . $objectPrefix.$elementName.$sourceField
249
+                                    . ', '.$transformName
250
+                                    . ', '.$siteId
251
+                                    . ', '.$transformMode
252 252
                                     . ') }}';
253 253
                             }
254 254
                             break;
@@ -256,21 +256,21 @@  discard block
 block discarded – undo
256 256
                             if (!empty($ids)) {
257 257
                                 $globalsSettings[$fieldName] = '{{ seomatic.helper.socialTransform('
258 258
                                     . $ids[0]
259
-                                    . ', ' . $transformName
260
-                                    . ', ' . $siteId
261
-                                    . ', ' . $transformMode
259
+                                    . ', '.$transformName
260
+                                    . ', '.$siteId
261
+                                    . ', '.$transformMode
262 262
                                     . ') }}';
263 263
                                 $globalsSettings[$fieldNameWidth] = '{{ seomatic.helper.socialTransformWidth('
264 264
                                     . $ids[0]
265
-                                    . ', ' . $transformName
266
-                                    . ', ' . $siteId
267
-                                    . ', ' . $transformMode
265
+                                    . ', '.$transformName
266
+                                    . ', '.$siteId
267
+                                    . ', '.$transformMode
268 268
                                     . ') }}';
269 269
                                 $globalsSettings[$fieldNameHeight] = '{{ seomatic.helper.socialTransformHeight('
270 270
                                     . $ids[0]
271
-                                    . ', ' . $transformName
272
-                                    . ', ' . $siteId
273
-                                    . ', ' . $transformMode
271
+                                    . ', '.$transformName
272
+                                    . ', '.$siteId
273
+                                    . ', '.$transformMode
274 274
                                     . ') }}';
275 275
                             }
276 276
                             break;
@@ -278,20 +278,20 @@  discard block
 block discarded – undo
278 278
                 } else {
279 279
                     switch ($source) {
280 280
                         case 'sameAsSeo':
281
-                            $globalsSettings[$fieldName] = '{{ seomatic.meta.' . $seoField . ' }}';
282
-                            $globalsSettings[$fieldNameWidth] = '{{ seomatic.meta.' . $seoFieldWidth . ' }}';
283
-                            $globalsSettings[$fieldNameHeight] = '{{ seomatic.meta.' . $seoFieldHeight . ' }}';
281
+                            $globalsSettings[$fieldName] = '{{ seomatic.meta.'.$seoField.' }}';
282
+                            $globalsSettings[$fieldNameWidth] = '{{ seomatic.meta.'.$seoFieldWidth.' }}';
283
+                            $globalsSettings[$fieldNameHeight] = '{{ seomatic.meta.'.$seoFieldHeight.' }}';
284 284
                             break;
285 285
                         case 'fromField':
286 286
                             if (!empty($sourceField)) {
287 287
                                 $globalsSettings[$fieldName] = '{{ '
288
-                                    . $elementName . $sourceField . '[0].url'
288
+                                    . $elementName.$sourceField.'[0].url'
289 289
                                     . ' }}';
290 290
                                 $globalsSettings[$fieldNameWidth] = '{{ '
291
-                                    . $elementName . $sourceField . '[0].width'
291
+                                    . $elementName.$sourceField.'[0].width'
292 292
                                     . ' }}';
293 293
                                 $globalsSettings[$fieldNameHeight] = '{{ '
294
-                                    . $elementName . $sourceField . '[0].height'
294
+                                    . $elementName.$sourceField.'[0].height'
295 295
                                     . ' }}';
296 296
                             }
297 297
                             break;
@@ -299,13 +299,13 @@  discard block
 block discarded – undo
299 299
                             if (!empty($ids)) {
300 300
                                 $globalsSettings[$fieldName] = '{{ craft.app.assets.assetById('
301 301
                                     . $ids[0]
302
-                                    . ', ' . $siteId . ').url }}';
302
+                                    . ', '.$siteId.').url }}';
303 303
                                 $globalsSettings[$fieldNameWidth] = '{{ craft.app.assets.assetById('
304 304
                                     . $ids[0]
305
-                                    . ', ' . $siteId . ').width }}';
305
+                                    . ', '.$siteId.').width }}';
306 306
                                 $globalsSettings[$fieldNameHeight] = '{{ craft.app.assets.assetById('
307 307
                                     . $ids[0]
308
-                                    . ', ' . $siteId . ').height }}';
308
+                                    . ', '.$siteId.').height }}';
309 309
                             }
310 310
                             break;
311 311
                     }
Please login to merge, or discard this patch.
src/helpers/ImageTransform.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         }
188 188
         $asset = self::assetFromAssetOrIdOrQuery($asset, $siteId);
189 189
         if (($asset !== null) && ($asset instanceof Asset)) {
190
-            $width = (string)$asset->getWidth($transform);
190
+            $width = (string) $asset->getWidth($transform);
191 191
             if ($width === null) {
192 192
                 $width = '';
193 193
             }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         }
220 220
         $asset = self::assetFromAssetOrIdOrQuery($asset, $siteId);
221 221
         if (($asset !== null) && ($asset instanceof Asset)) {
222
-            $height = (string)$asset->getHeight($transform);
222
+            $height = (string) $asset->getHeight($transform);
223 223
             if ($height === null) {
224 224
                 $height = '';
225 225
             }
@@ -244,13 +244,13 @@  discard block
 block discarded – undo
244 244
             if (\is_array($assetIds)) {
245 245
                 foreach ($assetIds as $assetId) {
246 246
                     if (!empty($assetId)) {
247
-                        $assets[] = $elements->getElementById((int)$assetId, Asset::class, $siteId);
247
+                        $assets[] = $elements->getElementById((int) $assetId, Asset::class, $siteId);
248 248
                     }
249 249
                 }
250 250
             } else {
251 251
                 $assetId = $assetIds;
252 252
                 if (!empty($assetId)) {
253
-                    $assets[] = $elements->getElementById((int)$assetId, Asset::class, $siteId);
253
+                    $assets[] = $elements->getElementById((int) $assetId, Asset::class, $siteId);
254 254
                 }
255 255
             }
256 256
         }
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
             return $asset->one();
288 288
         }
289 289
 
290
-        $resolvedAssetId = (int)$asset;
290
+        $resolvedAssetId = (int) $asset;
291 291
         $resolvedSiteId = $siteId ?? 0;
292 292
         if (isset(self::$cachedAssetsElements[$resolvedAssetId][$resolvedSiteId])) {
293 293
             return self::$cachedAssetsElements[$resolvedAssetId][$resolvedSiteId];
Please login to merge, or discard this patch.
src/fields/SeoSettings.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                 $value = StringHelper::encodeMb4($value);
255 255
             }
256 256
             if (\is_array($value)) {
257
-                array_walk_recursive($value, function (&$arrayValue, $arrayKey) {
257
+                array_walk_recursive($value, function(&$arrayValue, $arrayKey) {
258 258
                     if ($arrayValue !== null && \is_string($arrayValue)) {
259 259
                         $arrayValue = StringHelper::encodeMb4($arrayValue);
260 260
                     }
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
         if ($element !== null && $element->uri !== null) {
391 391
             $siteId = $element->siteId;
392 392
             $uri = $element->uri;
393
-            $cacheKey = self::CACHE_KEY . $uri . $siteId . $this->elementDisplayPreviewType;
393
+            $cacheKey = self::CACHE_KEY.$uri.$siteId.$this->elementDisplayPreviewType;
394 394
             $metaBundleSourceType = Seomatic::$plugin->seoElements->getMetaBundleTypeFromElement($element);
395 395
             $seoElement = Seomatic::$plugin->seoElements->getSeoElementByMetaBundleType($metaBundleSourceType);
396 396
             $metaBundleSourceType = SeoEntry::getMetaBundleType();
@@ -401,15 +401,15 @@  discard block
 block discarded – undo
401 401
             $dependency = new TagDependency([
402 402
                 'tags' => [
403 403
                     MetaContainers::GLOBAL_METACONTAINER_CACHE_TAG,
404
-                    MetaContainers::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId,
405
-                    MetaContainers::METACONTAINER_CACHE_TAG . $uri . $siteId,
404
+                    MetaContainers::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId,
405
+                    MetaContainers::METACONTAINER_CACHE_TAG.$uri.$siteId,
406 406
                 ],
407 407
             ]);
408 408
             $cache = Craft::$app->getCache();
409 409
             $cacheDuration = null;
410 410
             $html = $cache->getOrSet(
411
-                self::CACHE_KEY . $cacheKey,
412
-                function () use ($uri, $siteId, $element) {
411
+                self::CACHE_KEY.$cacheKey,
412
+                function() use ($uri, $siteId, $element) {
413 413
                     Seomatic::$plugin->metaContainers->previewMetaContainers($uri, $siteId, true);
414 414
                     $variables = [
415 415
                         'previewTypes' => [
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
     )
452 452
     {
453 453
         $variables['textFieldSources'] = array_merge(
454
-            ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'],
454
+            ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'],
455 455
             FieldHelper::fieldsOfTypeFromElement(
456 456
                 $element,
457 457
                 FieldHelper::TEXT_FIELD_CLASS_KEY,
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
             )
460 460
         );
461 461
         $variables['assetFieldSources'] = array_merge(
462
-            ['entryGroup' => ['optgroup' => $groupName . ' Fields']],
462
+            ['entryGroup' => ['optgroup' => $groupName.' Fields']],
463 463
             FieldHelper::fieldsOfTypeFromElement(
464 464
                 $element,
465 465
                 FieldHelper::ASSET_FIELD_CLASS_KEY,
Please login to merge, or discard this patch.