@@ -106,7 +106,7 @@ |
||
106 | 106 | */ |
107 | 107 | private static function getConfigFilePath(string $alias, string $filePath): string |
108 | 108 | { |
109 | - $path = DIRECTORY_SEPARATOR . ltrim($filePath, DIRECTORY_SEPARATOR); |
|
109 | + $path = DIRECTORY_SEPARATOR.ltrim($filePath, DIRECTORY_SEPARATOR); |
|
110 | 110 | $path = Craft::getAlias($alias) |
111 | 111 | . DIRECTORY_SEPARATOR |
112 | 112 | . self::LOCAL_CONFIG_DIR |
@@ -64,7 +64,7 @@ |
||
64 | 64 | |
65 | 65 | // Render the template with our vars passed in |
66 | 66 | try { |
67 | - $htmlText = Craft::$app->view->renderTemplate('seomatic/' . $templatePath, $params); |
|
67 | + $htmlText = Craft::$app->view->renderTemplate('seomatic/'.$templatePath, $params); |
|
68 | 68 | $templateRendered = true; |
69 | 69 | } catch (\Exception $e) { |
70 | 70 | $htmlText = Craft::t( |
@@ -196,11 +196,11 @@ |
||
196 | 196 | foreach ($typesArray as $key => $value) { |
197 | 197 | $indent = html_entity_decode(str_repeat(' ', $indentLevel)); |
198 | 198 | if (\is_array($value)) { |
199 | - $result[$key] = $indent . $key; |
|
199 | + $result[$key] = $indent.$key; |
|
200 | 200 | $value = self::flattenSchemaArray($value, $indentLevel + self::MENU_INDENT_STEP); |
201 | 201 | $result = array_merge($result, $value); |
202 | 202 | } else { |
203 | - $result[$key] = $indent . $value; |
|
203 | + $result[$key] = $indent.$value; |
|
204 | 204 | } |
205 | 205 | } |
206 | 206 |
@@ -57,7 +57,7 @@ |
||
57 | 57 | { |
58 | 58 | if ($pageInfo !== null && $pageInfo->currentPage !== null) { |
59 | 59 | // Let the meta containers know that this page is paginated |
60 | - Seomatic::$plugin->metaContainers->paginationPage = (string)$pageInfo->currentPage; |
|
60 | + Seomatic::$plugin->metaContainers->paginationPage = (string) $pageInfo->currentPage; |
|
61 | 61 | // Set the current page |
62 | 62 | $url = $pageInfo->getPageUrl($pageInfo->currentPage); |
63 | 63 | if (!empty($url)) { |
@@ -205,7 +205,7 @@ |
||
205 | 205 | // Prefix the keys with the global set name |
206 | 206 | $prefix = $global->handle; |
207 | 207 | $fields = array_combine( |
208 | - array_map(function ($key) use ($prefix) { |
|
208 | + array_map(function($key) use ($prefix) { |
|
209 | 209 | return $prefix.'.'.$key; |
210 | 210 | }, array_keys($fields)), |
211 | 211 | $fields |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | foreach ($variables['metaBundles'] as $metaBundle) { |
163 | 163 | $stat = 0; |
164 | 164 | foreach (self::SEO_SETUP_FIELDS as $setupField) { |
165 | - $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]); |
|
165 | + $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]); |
|
166 | 166 | } |
167 | 167 | $stat = round($numGrades - (($stat * $numGrades) / $numFields)); |
168 | 168 | if ($stat >= $numGrades) { |
@@ -172,12 +172,12 @@ discard block |
||
172 | 172 | } |
173 | 173 | // Global SEO grades |
174 | 174 | Seomatic::$previewingMetaContainers = true; |
175 | - $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int)$siteId); |
|
175 | + $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int) $siteId); |
|
176 | 176 | Seomatic::$previewingMetaContainers = false; |
177 | 177 | $stat = 0; |
178 | 178 | if ($metaBundle !== null) { |
179 | 179 | foreach (self::SEO_SETUP_FIELDS as $setupField) { |
180 | - $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]); |
|
180 | + $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]); |
|
181 | 181 | } |
182 | 182 | $stat = round(($stat / $numFields) * 100); |
183 | 183 | $variables['globalSetupStat'] = $stat; |
@@ -185,10 +185,10 @@ discard block |
||
185 | 185 | $numFields = \count(self::SITE_SETUP_FIELDS) + \count(self::IDENTITY_SETUP_FIELDS); |
186 | 186 | $stat = 0; |
187 | 187 | foreach (self::SITE_SETUP_FIELDS as $setupField) { |
188 | - $stat += (int)!empty($metaBundle->metaSiteVars[$setupField]); |
|
188 | + $stat += (int) !empty($metaBundle->metaSiteVars[$setupField]); |
|
189 | 189 | } |
190 | 190 | foreach (self::IDENTITY_SETUP_FIELDS as $setupField) { |
191 | - $stat += (int)!empty($metaBundle->metaSiteVars->identity[$setupField]); |
|
191 | + $stat += (int) !empty($metaBundle->metaSiteVars->identity[$setupField]); |
|
192 | 192 | } |
193 | 193 | $stat = round(($stat / $numFields) * 100); |
194 | 194 | } |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $variables['currentSubSection'] = $subSection; |
257 | 257 | // Meta bundle settings |
258 | 258 | Seomatic::$previewingMetaContainers = true; |
259 | - $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int)$variables['currentSiteId']); |
|
259 | + $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int) $variables['currentSiteId']); |
|
260 | 260 | Seomatic::$previewingMetaContainers = false; |
261 | 261 | if ($metaBundle !== null) { |
262 | 262 | $variables['metaGlobalVars'] = $metaBundle->metaGlobalVars; |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | // Preview the meta containers |
286 | 286 | Seomatic::$plugin->metaContainers->previewMetaContainers( |
287 | 287 | MetaBundles::GLOBAL_META_BUNDLE, |
288 | - (int)$variables['currentSiteId'] |
|
288 | + (int) $variables['currentSiteId'] |
|
289 | 289 | ); |
290 | 290 | |
291 | 291 | // Render the template |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | $metaBundle = Seomatic::$plugin->metaBundles->getMetaBundleBySourceHandle( |
440 | 440 | $sourceBundleType, |
441 | 441 | $sourceHandle, |
442 | - (int)$variables['currentSiteId'] |
|
442 | + (int) $variables['currentSiteId'] |
|
443 | 443 | ); |
444 | 444 | Seomatic::$previewingMetaContainers = false; |
445 | 445 | $templateTitle = ''; |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | // Preview the meta containers |
498 | 498 | Seomatic::$plugin->metaContainers->previewMetaContainers( |
499 | 499 | $uri, |
500 | - (int)$variables['currentSiteId'], |
|
500 | + (int) $variables['currentSiteId'], |
|
501 | 501 | false, |
502 | 502 | false |
503 | 503 | ); |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | |
631 | 631 | // The site settings for the appropriate meta bundle |
632 | 632 | Seomatic::$previewingMetaContainers = true; |
633 | - $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int)$variables['currentSiteId']); |
|
633 | + $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int) $variables['currentSiteId']); |
|
634 | 634 | Seomatic::$previewingMetaContainers = false; |
635 | 635 | if ($metaBundle !== null) { |
636 | 636 | $variables['site'] = $metaBundle->metaSiteVars; |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | |
769 | 769 | // The script meta containers for the global meta bundle |
770 | 770 | Seomatic::$previewingMetaContainers = true; |
771 | - $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int)$variables['currentSiteId']); |
|
771 | + $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int) $variables['currentSiteId']); |
|
772 | 772 | Seomatic::$previewingMetaContainers = false; |
773 | 773 | if ($metaBundle !== null) { |
774 | 774 | $variables['scripts'] = Seomatic::$plugin->metaBundles->getContainerDataFromBundle( |
@@ -1065,7 +1065,7 @@ discard block |
||
1065 | 1065 | if ($variables['showSites']) { |
1066 | 1066 | $variables['sitesMenuLabel'] = Craft::t( |
1067 | 1067 | 'site', |
1068 | - $sites->getSiteById((int)$variables['currentSiteId'])->name |
|
1068 | + $sites->getSiteById((int) $variables['currentSiteId'])->name |
|
1069 | 1069 | ); |
1070 | 1070 | } else { |
1071 | 1071 | $variables['sitesMenuLabel'] = ''; |
@@ -226,7 +226,7 @@ |
||
226 | 226 | { |
227 | 227 | $rules = parent::rules(); |
228 | 228 | $rules = array_merge($rules, [ |
229 | - [['currenciesAccepted','openingHours','paymentAccepted','priceRange'], 'validateJsonSchema'], |
|
229 | + [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], |
|
230 | 230 | [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
231 | 231 | [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
232 | 232 | ]); |
@@ -164,9 +164,9 @@ discard block |
||
164 | 164 | static protected $_schemaPropertyExpectedTypes = [ |
165 | 165 | 'amenityFeature' => ['LocationFeatureSpecification'], |
166 | 166 | 'floorSize' => ['QuantitativeValue'], |
167 | - 'numberOfRooms' => ['Number','QuantitativeValue'], |
|
167 | + 'numberOfRooms' => ['Number', 'QuantitativeValue'], |
|
168 | 168 | 'permittedUsage' => ['Text'], |
169 | - 'petsAllowed' => ['Boolean','Text'] |
|
169 | + 'petsAllowed' => ['Boolean', 'Text'] |
|
170 | 170 | ]; |
171 | 171 | |
172 | 172 | /** |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | { |
241 | 241 | $rules = parent::rules(); |
242 | 242 | $rules = array_merge($rules, [ |
243 | - [['amenityFeature','floorSize','numberOfRooms','permittedUsage','petsAllowed'], 'validateJsonSchema'], |
|
243 | + [['amenityFeature', 'floorSize', 'numberOfRooms', 'permittedUsage', 'petsAllowed'], 'validateJsonSchema'], |
|
244 | 244 | [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
245 | 245 | [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
246 | 246 | ]); |
@@ -226,7 +226,7 @@ |
||
226 | 226 | { |
227 | 227 | $rules = parent::rules(); |
228 | 228 | $rules = array_merge($rules, [ |
229 | - [['currenciesAccepted','openingHours','paymentAccepted','priceRange'], 'validateJsonSchema'], |
|
229 | + [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], |
|
230 | 230 | [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
231 | 231 | [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
232 | 232 | ]); |