@@ -225,10 +225,10 @@ |
||
225 | 225 | } |
226 | 226 | // Make sure these are strings |
227 | 227 | if (!empty($this->facebookProfileId)) { |
228 | - $this->facebookProfileId = (string)$this->facebookProfileId; |
|
228 | + $this->facebookProfileId = (string) $this->facebookProfileId; |
|
229 | 229 | } |
230 | 230 | if (!empty($this->facebookAppId)) { |
231 | - $this->facebookAppId = (string)$this->facebookAppId; |
|
231 | + $this->facebookAppId = (string) $this->facebookAppId; |
|
232 | 232 | } |
233 | 233 | // Identity |
234 | 234 | if ($this->identity !== null && is_array($this->identity)) { |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $suffix = ''; |
126 | 126 | break; |
127 | 127 | } |
128 | - $lengthAdjust = mb_strlen($prefix . $suffix); |
|
128 | + $lengthAdjust = mb_strlen($prefix.$suffix); |
|
129 | 129 | // Truncate the twitter:title tag content |
130 | 130 | $truncLen = Seomatic::$settings->maxTitleLength - $lengthAdjust; |
131 | 131 | if ($truncLen < 0) { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | '…' |
139 | 139 | ); |
140 | 140 | } |
141 | - $data['content'] = $prefix . $data['content'] . $suffix; |
|
141 | + $data['content'] = $prefix.$data['content'].$suffix; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | return $shouldRender; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $suffix = ''; |
126 | 126 | break; |
127 | 127 | } |
128 | - $lengthAdjust = mb_strlen($prefix . $suffix); |
|
128 | + $lengthAdjust = mb_strlen($prefix.$suffix); |
|
129 | 129 | // Truncate the og:title tag content |
130 | 130 | $truncLen = Seomatic::$settings->maxTitleLength - $lengthAdjust; |
131 | 131 | if ($truncLen < 0) { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | '…' |
139 | 139 | ); |
140 | 140 | } |
141 | - $data['content'] = $prefix . $data['content'] . $suffix; |
|
141 | + $data['content'] = $prefix.$data['content'].$suffix; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | return $shouldRender; |
@@ -143,16 +143,16 @@ discard block |
||
143 | 143 | break; |
144 | 144 | } |
145 | 145 | // Handle the case of empty titles |
146 | - if ($prefix === (' ' . $separator . ' ')) { |
|
146 | + if ($prefix === (' '.$separator.' ')) { |
|
147 | 147 | $prefix = ''; |
148 | 148 | } |
149 | - if ($suffix === (' ' . $separator)) { |
|
149 | + if ($suffix === (' '.$separator)) { |
|
150 | 150 | $suffix = ''; |
151 | 151 | } |
152 | 152 | // Remove potential double spaces |
153 | 153 | $prefix = preg_replace('/\s+/', ' ', $prefix); |
154 | 154 | $suffix = preg_replace('/\s+/', ' ', $suffix); |
155 | - $lengthAdjust = mb_strlen($prefix . $suffix); |
|
155 | + $lengthAdjust = mb_strlen($prefix.$suffix); |
|
156 | 156 | // Parse the data |
157 | 157 | $scenario = $this->scenario; |
158 | 158 | $this->setScenario('render'); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | '…' |
172 | 172 | ); |
173 | 173 | } |
174 | - $data = $prefix . $data . $suffix; |
|
174 | + $data = $prefix.$data.$suffix; |
|
175 | 175 | } else { |
176 | 176 | // If no title is provided, just use the site name |
177 | 177 | $data = MetaValueHelper::parseString($this->siteName); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $data = trim($data); |
181 | 181 | // devMode |
182 | 182 | if (Seomatic::$devMode) { |
183 | - $data = Seomatic::$settings->devModeTitlePrefix . $data; |
|
183 | + $data = Seomatic::$settings->devModeTitlePrefix.$data; |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * @param MetaBundle $metaBundle |
179 | 179 | * @param bool $forceUpdate |
180 | 180 | */ |
181 | - public function syncBundleWithConfig(MetaBundle &$metaBundle, bool $forceUpdate = false) |
|
181 | + public function syncBundleWithConfig(MetaBundle & $metaBundle, bool $forceUpdate = false) |
|
182 | 182 | { |
183 | 183 | $prevMetaBundle = $metaBundle; |
184 | 184 | $config = []; |
@@ -259,8 +259,8 @@ discard block |
||
259 | 259 | */ |
260 | 260 | public function updateMetaBundle(MetaBundle $metaBundle, int $siteId) |
261 | 261 | { |
262 | - $metaBundle->sourceName = (string)$metaBundle->sourceName; |
|
263 | - $metaBundle->sourceTemplate = (string)$metaBundle->sourceTemplate; |
|
262 | + $metaBundle->sourceName = (string) $metaBundle->sourceName; |
|
263 | + $metaBundle->sourceTemplate = (string) $metaBundle->sourceTemplate; |
|
264 | 264 | // Make sure it validates |
265 | 265 | if ($metaBundle->validate(null, true)) { |
266 | 266 | // Save it out to a record |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | 'sourceSiteId' => $siteId, |
271 | 271 | ]; |
272 | 272 | if ($metaBundle->typeId !== null) { |
273 | - $metaBundle->typeId = (int)$metaBundle->typeId; |
|
273 | + $metaBundle->typeId = (int) $metaBundle->typeId; |
|
274 | 274 | } |
275 | 275 | if (!empty($metaBundle->typeId)) { |
276 | 276 | $params['typeId'] = $metaBundle->typeId; |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | // @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 |
287 | 287 | // The issue was that the containers were getting saved to the db with a hard-coded setting in them, because they'd |
288 | 288 | // been set that way by the environment, whereas to be changeable via the GUI, it needs to be set to {seomatic.meta.robots} |
289 | - $robotsTag = $metaBundle->metaContainers[MetaTagContainer::CONTAINER_TYPE . TagService::GENERAL_HANDLE]->data['robots'] ?? null; |
|
289 | + $robotsTag = $metaBundle->metaContainers[MetaTagContainer::CONTAINER_TYPE.TagService::GENERAL_HANDLE]->data['robots'] ?? null; |
|
290 | 290 | if (!empty($robotsTag)) { |
291 | 291 | $robotsTag->content = $robotsTag->environment['live']['content'] ?? '{{ seomatic.meta.robots }}'; |
292 | 292 | } |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | $metaBundleDefaults = ArrayHelper::merge( |
369 | 369 | $seoElement::metaBundleConfig($sourceModel), |
370 | 370 | [ |
371 | - 'sourceTemplate' => (string)$siteSetting->template, |
|
371 | + 'sourceTemplate' => (string) $siteSetting->template, |
|
372 | 372 | 'sourceSiteId' => $siteSetting->siteId, |
373 | 373 | 'sourceAltSiteSettings' => $siteSettingsArray, |
374 | 374 | 'sourceDateUpdated' => $dateUpdated, |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | public function getMetaBundleBySourceHandle(string $sourceBundleType, string $sourceHandle, int $sourceSiteId, $typeId = null) |
417 | 417 | { |
418 | 418 | $metaBundle = null; |
419 | - $typeId = (int)$typeId; |
|
419 | + $typeId = (int) $typeId; |
|
420 | 420 | // See if we have the meta bundle cached |
421 | 421 | if (!empty($this->metaBundlesBySourceHandle[$sourceBundleType][$sourceHandle][$sourceSiteId][$typeId])) { |
422 | 422 | $id = $this->metaBundlesBySourceHandle[$sourceBundleType][$sourceHandle][$sourceSiteId][$typeId]; |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | /** @var Section|CategoryGroup|ProductType $sourceModel */ |
504 | 504 | $sourceModel = $seoElement::sourceModelFromId($sourceId); |
505 | 505 | if ($sourceModel !== null) { |
506 | - $metaBundle->sourceName = (string)$sourceModel->name; |
|
506 | + $metaBundle->sourceName = (string) $sourceModel->name; |
|
507 | 507 | $metaBundle->sourceHandle = $sourceModel->handle; |
508 | 508 | } |
509 | 509 | } |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | public function getMetaBundleBySourceId(string $sourceBundleType, int $sourceId, int $sourceSiteId, $typeId = null) |
545 | 545 | { |
546 | 546 | $metaBundle = null; |
547 | - $typeId = (int)$typeId; |
|
547 | + $typeId = (int) $typeId; |
|
548 | 548 | // See if we have the meta bundle cached |
549 | 549 | if (!empty($this->metaBundlesBySourceId[$sourceBundleType][$sourceId][$sourceSiteId][$typeId])) { |
550 | 550 | $id = $this->metaBundlesBySourceId[$sourceBundleType][$sourceId][$sourceSiteId][$typeId]; |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | ->from(['{{%seomatic_metabundles}}']) |
740 | 740 | ->where(['=', 'sourceBundleType', $seoElement::META_BUNDLE_TYPE]); |
741 | 741 | |
742 | - if ((int)$sourceSiteId !== 0) { |
|
742 | + if ((int) $sourceSiteId !== 0) { |
|
743 | 743 | $subQuery->andWhere(['sourceSiteId' => $sourceSiteId]); |
744 | 744 | } |
745 | 745 | if ($filter !== '') { |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | public function getContentMetaBundleForElement(Element $element) |
777 | 777 | { |
778 | 778 | $source = $this->getMetaSourceFromElement($element); |
779 | - $key = implode(".", $source) . '.' . $element->siteId; |
|
779 | + $key = implode(".", $source).'.'.$element->siteId; |
|
780 | 780 | |
781 | 781 | if (empty($this->elementContentMetaBundles[$key])) { |
782 | 782 | $this->elementContentMetaBundles[$key] = $this->getMetaBundleBySourceId($source[1], $source[0], $element->siteId, $source[4]); |
@@ -798,10 +798,10 @@ discard block |
||
798 | 798 | $seoSettingsField = Craft::$app->getFields()->getFieldByHandle($fieldHandle); |
799 | 799 | if ($seoSettingsField) { |
800 | 800 | $seoSettingsEnabledFields = array_flip(array_merge( |
801 | - (array)$seoSettingsField->generalEnabledFields, |
|
802 | - (array)$seoSettingsField->twitterEnabledFields, |
|
803 | - (array)$seoSettingsField->facebookEnabledFields, |
|
804 | - (array)$seoSettingsField->sitemapEnabledFields |
|
801 | + (array) $seoSettingsField->generalEnabledFields, |
|
802 | + (array) $seoSettingsField->twitterEnabledFields, |
|
803 | + (array) $seoSettingsField->facebookEnabledFields, |
|
804 | + (array) $seoSettingsField->sitemapEnabledFields |
|
805 | 805 | )); |
806 | 806 | // Always include some fields, as they are calculated even if not explicitly included |
807 | 807 | $seoSettingsEnabledFields = array_merge( |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | |
830 | 830 | |
831 | 831 | // Handle the mainEntityOfPage |
832 | - if (!in_array('mainEntityOfPage', (array)$seoSettingsField->generalEnabledFields, false)) { |
|
832 | + if (!in_array('mainEntityOfPage', (array) $seoSettingsField->generalEnabledFields, false)) { |
|
833 | 833 | $metaBundle->metaGlobalVars->mainEntityOfPage = ''; |
834 | 834 | } |
835 | 835 | // metaSiteVars |
@@ -54,7 +54,7 @@ |
||
54 | 54 | $result = MetaValueHelper::parseString($this->$property); |
55 | 55 | } |
56 | 56 | |
57 | - return (string)$result; |
|
57 | + return (string) $result; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | // so we can't extract it from the passed in $config |
64 | 64 | $majorVersion = '4'; |
65 | 65 | // Dev server container name & port are based on the major version of this plugin |
66 | - $devPort = 3000 + (int)$majorVersion; |
|
67 | - $versionName = 'v' . $majorVersion; |
|
66 | + $devPort = 3000 + (int) $majorVersion; |
|
67 | + $versionName = 'v'.$majorVersion; |
|
68 | 68 | return [ |
69 | 69 | 'components' => [ |
70 | 70 | 'frontendTemplates' => FrontendTemplatesService::class, |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | 'assetClass' => SeomaticAsset::class, |
84 | 84 | 'checkDevServer' => true, |
85 | 85 | 'class' => VitePluginService::class, |
86 | - 'devServerInternal' => 'http://craft-seomatic-' . $versionName . '-buildchain-dev:' . $devPort, |
|
87 | - 'devServerPublic' => 'http://localhost:' . $devPort, |
|
86 | + 'devServerInternal' => 'http://craft-seomatic-'.$versionName.'-buildchain-dev:'.$devPort, |
|
87 | + 'devServerPublic' => 'http://localhost:'.$devPort, |
|
88 | 88 | 'errorEntry' => 'src/js/seomatic.js', |
89 | 89 | 'useDevServer' => true, |
90 | 90 | ], |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | */ |
21 | 21 | |
22 | 22 | return [ |
23 | - MetaTagContainer::CONTAINER_TYPE . TagService::GENERAL_HANDLE => [ |
|
23 | + MetaTagContainer::CONTAINER_TYPE.TagService::GENERAL_HANDLE => [ |
|
24 | 24 | 'name' => 'General', |
25 | 25 | 'description' => 'General Meta Tags', |
26 | 26 | 'handle' => TagService::GENERAL_HANDLE, |
27 | - 'class' => (string)MetaTagContainer::class, |
|
27 | + 'class' => (string) MetaTagContainer::class, |
|
28 | 28 | 'include' => true, |
29 | 29 | 'dependencies' => [ |
30 | 30 | ], |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | ], |
77 | 77 | ], |
78 | 78 | ], |
79 | - MetaTagContainer::CONTAINER_TYPE . TagService::FACEBOOK_HANDLE => [ |
|
79 | + MetaTagContainer::CONTAINER_TYPE.TagService::FACEBOOK_HANDLE => [ |
|
80 | 80 | 'name' => 'Facebook', |
81 | 81 | 'description' => 'Facebook OpenGraph Meta Tags', |
82 | 82 | 'handle' => TagService::FACEBOOK_HANDLE, |
83 | - 'class' => (string)MetaTagContainer::class, |
|
83 | + 'class' => (string) MetaTagContainer::class, |
|
84 | 84 | 'include' => true, |
85 | 85 | 'dependencies' => [ |
86 | 86 | ], |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | ], |
207 | 207 | ], |
208 | 208 | ], |
209 | - MetaTagContainer::CONTAINER_TYPE . TagService::TWITTER_HANDLE => [ |
|
209 | + MetaTagContainer::CONTAINER_TYPE.TagService::TWITTER_HANDLE => [ |
|
210 | 210 | 'name' => 'Twitter', |
211 | 211 | 'description' => 'Twitter Card Meta Tags', |
212 | 212 | 'handle' => TagService::TWITTER_HANDLE, |
213 | 213 | 'include' => true, |
214 | - 'class' => (string)MetaTagContainer::class, |
|
214 | + 'class' => (string) MetaTagContainer::class, |
|
215 | 215 | 'data' => [ |
216 | 216 | 'twitter:card' => [ |
217 | 217 | 'charset' => '', |
@@ -287,11 +287,11 @@ discard block |
||
287 | 287 | ], |
288 | 288 | ], |
289 | 289 | ], |
290 | - MetaTagContainer::CONTAINER_TYPE . TagService::MISC_HANDLE => [ |
|
290 | + MetaTagContainer::CONTAINER_TYPE.TagService::MISC_HANDLE => [ |
|
291 | 291 | 'name' => 'Miscellaneous', |
292 | 292 | 'description' => 'Miscellaneous Meta Tags', |
293 | 293 | 'handle' => TagService::MISC_HANDLE, |
294 | - 'class' => (string)MetaTagContainer::class, |
|
294 | + 'class' => (string) MetaTagContainer::class, |
|
295 | 295 | 'include' => true, |
296 | 296 | 'dependencies' => [ |
297 | 297 | ], |
@@ -20,11 +20,11 @@ |
||
20 | 20 | */ |
21 | 21 | |
22 | 22 | return [ |
23 | - MetaScriptContainer::CONTAINER_TYPE . ScriptService::GENERAL_HANDLE => [ |
|
23 | + MetaScriptContainer::CONTAINER_TYPE.ScriptService::GENERAL_HANDLE => [ |
|
24 | 24 | 'name' => 'General', |
25 | 25 | 'description' => 'Script Tags', |
26 | 26 | 'handle' => ScriptService::GENERAL_HANDLE, |
27 | - 'class' => (string)MetaScriptContainer::class, |
|
27 | + 'class' => (string) MetaScriptContainer::class, |
|
28 | 28 | 'include' => true, |
29 | 29 | 'dependencies' => [ |
30 | 30 | ], |