@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | ->siteId($metaBundle->sourceSiteId) |
| 224 | 224 | ->limit($metaBundle->metaSitemapVars->sitemapLimit); |
| 225 | 225 | if (!empty($metaBundle->metaSitemapVars->structureDepth)) { |
| 226 | - $query->level('<=' . $metaBundle->metaSitemapVars->structureDepth); |
|
| 226 | + $query->level('<='.$metaBundle->metaSitemapVars->structureDepth); |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | return $query; |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
| 380 | 380 | [ |
| 381 | 381 | 'sourceId' => $sourceModel->id, |
| 382 | - 'sourceName' => (string)$sourceModel->name, |
|
| 382 | + 'sourceName' => (string) $sourceModel->name, |
|
| 383 | 383 | 'sourceHandle' => $sourceModel->handle, |
| 384 | 384 | ] |
| 385 | 385 | ); |
@@ -388,7 +388,7 @@ |
||
| 388 | 388 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
| 389 | 389 | [ |
| 390 | 390 | 'sourceId' => $sourceModel->id, |
| 391 | - 'sourceName' => (string)$sourceModel->name, |
|
| 391 | + 'sourceName' => (string) $sourceModel->name, |
|
| 392 | 392 | 'sourceHandle' => $sourceModel->handle, |
| 393 | 393 | ] |
| 394 | 394 | ); |
@@ -388,7 +388,7 @@ |
||
| 388 | 388 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
| 389 | 389 | [ |
| 390 | 390 | 'sourceId' => $sourceModel->id, |
| 391 | - 'sourceName' => (string)$sourceModel->name, |
|
| 391 | + 'sourceName' => (string) $sourceModel->name, |
|
| 392 | 392 | 'sourceHandle' => $sourceModel->handle, |
| 393 | 393 | ] |
| 394 | 394 | ); |
@@ -66,8 +66,8 @@ |
||
| 66 | 66 | string $sort = 'sourceName|asc', |
| 67 | 67 | int $page = 1, |
| 68 | 68 | int $per_page = 20, |
| 69 | - $filter = '', |
|
| 70 | - $siteId = 0, |
|
| 69 | + $filter = '', |
|
| 70 | + $siteId = 0, |
|
| 71 | 71 | ): Response { |
| 72 | 72 | $data = []; |
| 73 | 73 | $sortField = 'sourceName'; |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | /** |
| 46 | 46 | * @inheritdoc |
| 47 | 47 | */ |
| 48 | - protected array|bool|int $allowAnonymous = [ |
|
| 48 | + protected array | bool | int $allowAnonymous = [ |
|
| 49 | 49 | ]; |
| 50 | 50 | |
| 51 | 51 | // Public Methods |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | // Query the db table |
| 100 | 100 | $offset = ($page - 1) * $per_page; |
| 101 | 101 | $currentSiteHandle = ''; |
| 102 | - if ((int)$siteId !== 0) { |
|
| 102 | + if ((int) $siteId !== 0) { |
|
| 103 | 103 | $site = Craft::$app->getSites()->getSiteById($siteId); |
| 104 | 104 | if ($site !== null) { |
| 105 | 105 | $currentSiteHandle = $site->handle; |
@@ -156,11 +156,11 @@ discard block |
||
| 156 | 156 | $numGrades = count(SettingsController::SETUP_GRADES); |
| 157 | 157 | $numFields = count(SettingsController::SEO_SETUP_FIELDS); |
| 158 | 158 | foreach (SettingsController::SEO_SETUP_FIELDS as $setupField => $setupLabel) { |
| 159 | - $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]); |
|
| 159 | + $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]); |
|
| 160 | 160 | $value = $variables['contentSetupChecklist'][$setupField]['value'] ?? 0; |
| 161 | 161 | $variables['contentSetupChecklist'][$setupField] = [ |
| 162 | 162 | 'label' => $setupLabel, |
| 163 | - 'value' => $value + (int)!empty($metaBundle->metaGlobalVars[$setupField]), |
|
| 163 | + 'value' => $value + (int) !empty($metaBundle->metaGlobalVars[$setupField]), |
|
| 164 | 164 | ]; |
| 165 | 165 | } |
| 166 | 166 | $stat = round($numGrades - (($stat * $numGrades) / $numFields)); |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | array $params = [], |
| 74 | 74 | string $minifier = null, |
| 75 | 75 | ): string { |
| 76 | - $template = 'seomatic/' . $templatePath; |
|
| 76 | + $template = 'seomatic/'.$templatePath; |
|
| 77 | 77 | $oldMode = Craft::$app->view->getTemplateMode(); |
| 78 | 78 | // Look for the template on the frontend first |
| 79 | 79 | try { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | public static function create($schemaType, array $config = []): MetaJsonLd |
| 120 | 120 | { |
| 121 | 121 | // Try the passed in $schemaType |
| 122 | - $className = self::SCHEMA_NAMESPACE_PREFIX . $schemaType; |
|
| 122 | + $className = self::SCHEMA_NAMESPACE_PREFIX.$schemaType; |
|
| 123 | 123 | /** @var $model MetaJsonLd */ |
| 124 | 124 | if (class_exists($className)) { |
| 125 | 125 | self::cleanProperties($className, $config); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | return new $className($config); |
| 128 | 128 | } |
| 129 | 129 | // Try the prefixed $schemaType |
| 130 | - $className = self::SCHEMA_NAMESPACE_PREFIX . self::SCHEMA_NAME_PREFIX . $schemaType; |
|
| 130 | + $className = self::SCHEMA_NAMESPACE_PREFIX.self::SCHEMA_NAME_PREFIX.$schemaType; |
|
| 131 | 131 | /** @var $model MetaJsonLd */ |
| 132 | 132 | if (class_exists($className)) { |
| 133 | 133 | self::cleanProperties($className, $config); |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | foreach ($dataToValidate as $key => $data) { |
| 384 | 384 | /** @var array $expectedTypes */ |
| 385 | 385 | foreach ($expectedTypes as $expectedType) { |
| 386 | - $className = 'nystudio107\\seomatic\\models\\jsonld\\' . $expectedType; |
|
| 386 | + $className = 'nystudio107\\seomatic\\models\\jsonld\\'.$expectedType; |
|
| 387 | 387 | switch ($expectedType) { |
| 388 | 388 | // Text always validates |
| 389 | 389 | case 'Text': |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | case 'Date': |
| 424 | 424 | $validator = new DateValidator(); |
| 425 | 425 | $validator->type = DateValidator::TYPE_DATE; |
| 426 | - $validator->format = 'php:' . DateTime::ATOM; |
|
| 426 | + $validator->format = 'php:'.DateTime::ATOM; |
|
| 427 | 427 | if ($validator->validate($data, $error)) { |
| 428 | 428 | $validated = true; |
| 429 | 429 | } |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | $validated = true; |
| 470 | 470 | } |
| 471 | 471 | if (is_string($data)) { |
| 472 | - $targetClass = 'nystudio107\\seomatic\\models\\jsonld\\' . $data; |
|
| 472 | + $targetClass = 'nystudio107\\seomatic\\models\\jsonld\\'.$data; |
|
| 473 | 473 | if (class_exists($targetClass)) { |
| 474 | 474 | $validated = true; |
| 475 | 475 | } |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | } |
| 479 | 479 | } |
| 480 | 480 | if (!$validated) { |
| 481 | - $this->addError($attribute, 'Must be one of these types: ' . implode(', ', $expectedTypes)); |
|
| 481 | + $this->addError($attribute, 'Must be one of these types: '.implode(', ', $expectedTypes)); |
|
| 482 | 482 | } |
| 483 | 483 | } |
| 484 | 484 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | if ($width === null) { |
| 198 | 198 | $width = ''; |
| 199 | 199 | } |
| 200 | - $width = (string)$width; |
|
| 200 | + $width = (string) $width; |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | return $width; |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | if ($height === null) { |
| 230 | 230 | $height = ''; |
| 231 | 231 | } |
| 232 | - $height = (string)$height; |
|
| 232 | + $height = (string) $height; |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | return $height; |
@@ -251,12 +251,12 @@ discard block |
||
| 251 | 251 | if (is_array($assetIds)) { |
| 252 | 252 | foreach ($assetIds as $assetId) { |
| 253 | 253 | if (!empty($assetId)) { |
| 254 | - $assets[] = $elements->getElementById((int)$assetId, Asset::class, $siteId); |
|
| 254 | + $assets[] = $elements->getElementById((int) $assetId, Asset::class, $siteId); |
|
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | } else { |
| 258 | 258 | $assetId = $assetIds; |
| 259 | - $assets[] = $elements->getElementById((int)$assetId, Asset::class, $siteId); |
|
| 259 | + $assets[] = $elements->getElementById((int) $assetId, Asset::class, $siteId); |
|
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | return $asset->one(); |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | - $resolvedAssetId = (int)$asset; |
|
| 295 | + $resolvedAssetId = (int) $asset; |
|
| 296 | 296 | $resolvedSiteId = $siteId ?? 0; |
| 297 | 297 | if (isset(self::$cachedAssetsElements[$resolvedAssetId][$resolvedSiteId])) { |
| 298 | 298 | return self::$cachedAssetsElements[$resolvedAssetId][$resolvedSiteId]; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $foundFields = []; |
| 126 | 126 | if (!empty(self::FIELD_CLASSES[$fieldClassKey])) { |
| 127 | 127 | // Cache me if you can |
| 128 | - $memoKey = $fieldClassKey . $layout->id . ($keysOnly ? 'keys' : 'nokeys'); |
|
| 128 | + $memoKey = $fieldClassKey.$layout->id.($keysOnly ? 'keys' : 'nokeys'); |
|
| 129 | 129 | if (!empty(self::$fieldsOfTypeFromLayoutCache[$memoKey])) { |
| 130 | 130 | return self::$fieldsOfTypeFromLayoutCache[$memoKey]; |
| 131 | 131 | } |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | $prefix = $global->handle; |
| 243 | 243 | $fields = array_combine( |
| 244 | 244 | array_map(function($key) use ($prefix) { |
| 245 | - return $prefix . '.' . $key; |
|
| 245 | + return $prefix.'.'.$key; |
|
| 246 | 246 | }, array_keys($fields)), |
| 247 | 247 | $fields |
| 248 | 248 | ); |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | } |
| 317 | 317 | if ($matrixBlockTypeModel) { |
| 318 | 318 | // Cache me if you can |
| 319 | - $memoKey = $fieldType . $matrixBlock->id . ($keysOnly ? 'keys' : 'nokeys'); |
|
| 319 | + $memoKey = $fieldType.$matrixBlock->id.($keysOnly ? 'keys' : 'nokeys'); |
|
| 320 | 320 | if (!empty(self::$matrixFieldsOfTypeCache[$memoKey])) { |
| 321 | 321 | return self::$matrixFieldsOfTypeCache[$memoKey]; |
| 322 | 322 | } |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | $layout = $neoBlock->getFieldLayout(); |
| 356 | 356 | if ($layout) { |
| 357 | 357 | // Cache me if you can |
| 358 | - $memoKey = $fieldType . $neoBlock->id . ($keysOnly ? 'keys' : 'nokeys'); |
|
| 358 | + $memoKey = $fieldType.$neoBlock->id.($keysOnly ? 'keys' : 'nokeys'); |
|
| 359 | 359 | if (!empty(self::$neoFieldsOfTypeCache[$memoKey])) { |
| 360 | 360 | return self::$neoFieldsOfTypeCache[$memoKey]; |
| 361 | 361 | } |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | } |
| 399 | 399 | if ($superTableBlockTypeModel) { |
| 400 | 400 | // Cache me if you can |
| 401 | - $memoKey = $fieldType . $superTableBlock->id . ($keysOnly ? 'keys' : 'nokeys'); |
|
| 401 | + $memoKey = $fieldType.$superTableBlock->id.($keysOnly ? 'keys' : 'nokeys'); |
|
| 402 | 402 | if (!empty(self::$superTableFieldsOfTypeCache[$memoKey])) { |
| 403 | 403 | return self::$superTableFieldsOfTypeCache[$memoKey]; |
| 404 | 404 | } |
@@ -275,7 +275,7 @@ |
||
| 275 | 275 | string $sourceHandle, |
| 276 | 276 | string $fieldClassKey, |
| 277 | 277 | bool $keysOnly = true, |
| 278 | - $typeId = null, |
|
| 278 | + $typeId = null, |
|
| 279 | 279 | ): array { |
| 280 | 280 | $foundFields = []; |
| 281 | 281 | $layouts = []; |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | } elseif ($json === null || $json === '') { |
| 56 | 56 | return null; |
| 57 | 57 | } |
| 58 | - $decode = json_decode((string)$json, $asArray, 512, JSON_BIGINT_AS_STRING); |
|
| 58 | + $decode = json_decode((string) $json, $asArray, 512, JSON_BIGINT_AS_STRING); |
|
| 59 | 59 | static::handleJsonError(json_last_error()); |
| 60 | 60 | |
| 61 | 61 | return $decode; |