@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | 22 | return [ |
| 23 | - MetaLinkContainer::CONTAINER_TYPE.LinkService::GENERAL_HANDLE => [ |
|
| 23 | + MetaLinkContainer::CONTAINER_TYPE . LinkService::GENERAL_HANDLE => [ |
|
| 24 | 24 | 'name' => 'General', |
| 25 | 25 | 'description' => 'Link Tags', |
| 26 | 26 | 'handle' => LinkService::GENERAL_HANDLE, |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | ], |
| 50 | 50 | 'publisher' => [ |
| 51 | 51 | 'dependencies' => [ |
| 52 | - Dependency::SITE_DEPENDENCY => ['googlePublisherLink'], |
|
| 52 | + Dependency::SITE_DEPENDENCY => [ 'googlePublisherLink' ], |
|
| 53 | 53 | ], |
| 54 | 54 | 'crossorigin' => '', |
| 55 | 55 | 'href' => '{seomatic.site.googlePublisherLink}', |
@@ -20,7 +20,7 @@ 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, |
@@ -73,14 +73,14 @@ discard block |
||
| 73 | 73 | ], |
| 74 | 74 | ], |
| 75 | 75 | ], |
| 76 | - MetaTagContainer::CONTAINER_TYPE.TagService::FACEBOOK_HANDLE => [ |
|
| 76 | + MetaTagContainer::CONTAINER_TYPE . TagService::FACEBOOK_HANDLE => [ |
|
| 77 | 77 | 'name' => 'Facebook', |
| 78 | 78 | 'description' => 'Facebook OpenGraph Meta Tags', |
| 79 | 79 | 'handle' => TagService::FACEBOOK_HANDLE, |
| 80 | 80 | 'class' => (string)MetaTagContainer::class, |
| 81 | 81 | 'include' => true, |
| 82 | 82 | 'dependencies' => [ |
| 83 | - Dependency::SITE_DEPENDENCY => ['facebookProfileId', 'facebookAppId'], |
|
| 83 | + Dependency::SITE_DEPENDENCY => [ 'facebookProfileId', 'facebookAppId' ], |
|
| 84 | 84 | ], |
| 85 | 85 | 'data' => [ |
| 86 | 86 | 'fb:profile_id' => [ |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | ], |
| 145 | 145 | 'og:image:alt' => [ |
| 146 | 146 | 'dependencies' => [ |
| 147 | - Dependency::TAG_DEPENDENCY => ['og:image'], |
|
| 147 | + Dependency::TAG_DEPENDENCY => [ 'og:image' ], |
|
| 148 | 148 | ], |
| 149 | 149 | 'charset' => '', |
| 150 | 150 | 'content' => '{seomatic.meta.ogImageDescription}', |
@@ -161,14 +161,14 @@ discard block |
||
| 161 | 161 | ], |
| 162 | 162 | ], |
| 163 | 163 | ], |
| 164 | - MetaTagContainer::CONTAINER_TYPE.TagService::TWITTER_HANDLE => [ |
|
| 164 | + MetaTagContainer::CONTAINER_TYPE . TagService::TWITTER_HANDLE => [ |
|
| 165 | 165 | 'name' => 'Twitter', |
| 166 | 166 | 'description' => 'Twitter Card Meta Tags', |
| 167 | 167 | 'handle' => TagService::TWITTER_HANDLE, |
| 168 | 168 | 'include' => true, |
| 169 | 169 | 'class' => (string)MetaTagContainer::class, |
| 170 | 170 | 'dependencies' => [ |
| 171 | - Dependency::SITE_DEPENDENCY => ['twitterHandle'], |
|
| 171 | + Dependency::SITE_DEPENDENCY => [ 'twitterHandle' ], |
|
| 172 | 172 | ], |
| 173 | 173 | 'data' => [ |
| 174 | 174 | 'twitter:card' => [ |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | ], |
| 180 | 180 | 'twitter:site' => [ |
| 181 | 181 | 'dependencies' => [ |
| 182 | - Dependency::SITE_DEPENDENCY => ['twitterHandle'], |
|
| 182 | + Dependency::SITE_DEPENDENCY => [ 'twitterHandle' ], |
|
| 183 | 183 | ], |
| 184 | 184 | 'charset' => '', |
| 185 | 185 | 'content' => '@{seomatic.site.twitterHandle}', |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | ], |
| 189 | 189 | 'twitter:creator' => [ |
| 190 | 190 | 'dependencies' => [ |
| 191 | - Dependency::META_DEPENDENCY => ['twitterCreator'], |
|
| 191 | + Dependency::META_DEPENDENCY => [ 'twitterCreator' ], |
|
| 192 | 192 | ], |
| 193 | 193 | 'charset' => '', |
| 194 | 194 | 'content' => '@{seomatic.meta.twitterCreator}', |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | ], |
| 219 | 219 | 'twitter:image:alt' => [ |
| 220 | 220 | 'dependencies' => [ |
| 221 | - Dependency::TAG_DEPENDENCY => ['twitter:image'], |
|
| 221 | + Dependency::TAG_DEPENDENCY => [ 'twitter:image' ], |
|
| 222 | 222 | ], |
| 223 | 223 | 'charset' => '', |
| 224 | 224 | 'content' => '{seomatic.meta.twitterImageDescription}', |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | ], |
| 228 | 228 | ], |
| 229 | 229 | ], |
| 230 | - MetaTagContainer::CONTAINER_TYPE.TagService::MISC_HANDLE => [ |
|
| 230 | + MetaTagContainer::CONTAINER_TYPE . TagService::MISC_HANDLE => [ |
|
| 231 | 231 | 'name' => 'Miscellaneous', |
| 232 | 232 | 'description' => 'Miscellaneous Meta Tags', |
| 233 | 233 | 'handle' => TagService::MISC_HANDLE, |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | 'data' => [ |
| 239 | 239 | 'google-site-verification' => [ |
| 240 | 240 | 'dependencies' => [ |
| 241 | - Dependency::SITE_DEPENDENCY => ['googleSiteVerification'], |
|
| 241 | + Dependency::SITE_DEPENDENCY => [ 'googleSiteVerification' ], |
|
| 242 | 242 | ], |
| 243 | 243 | 'charset' => '', |
| 244 | 244 | 'content' => '{seomatic.site.googleSiteVerification}', |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | ], |
| 248 | 248 | 'bing-site-verification' => [ |
| 249 | 249 | 'dependencies' => [ |
| 250 | - Dependency::SITE_DEPENDENCY => ['bingSiteVerification'], |
|
| 250 | + Dependency::SITE_DEPENDENCY => [ 'bingSiteVerification' ], |
|
| 251 | 251 | ], |
| 252 | 252 | 'charset' => '', |
| 253 | 253 | 'content' => '{seomatic.site.bingSiteVerification}', |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | ], |
| 257 | 257 | 'pinterest-site-verification' => [ |
| 258 | 258 | 'dependencies' => [ |
| 259 | - Dependency::SITE_DEPENDENCY => ['bingSiteVerification'], |
|
| 259 | + Dependency::SITE_DEPENDENCY => [ 'bingSiteVerification' ], |
|
| 260 | 260 | ], |
| 261 | 261 | 'charset' => '', |
| 262 | 262 | 'content' => '{seomatic.site.pinterestSiteVerification}', |
@@ -25,17 +25,17 @@ |
||
| 25 | 25 | 'sitemapPriority' => 0.5, |
| 26 | 26 | 'sitemapLimit' => null, |
| 27 | 27 | 'sitemapImageFieldMap' => [ |
| 28 | - ['property' => 'title', 'field' => 'title'], |
|
| 29 | - ['property' => 'caption', 'field' => ''], |
|
| 30 | - ['property' => 'geo_location', 'field' => ''], |
|
| 31 | - ['property' => 'license', 'field' => ''], |
|
| 28 | + [ 'property' => 'title', 'field' => 'title' ], |
|
| 29 | + [ 'property' => 'caption', 'field' => '' ], |
|
| 30 | + [ 'property' => 'geo_location', 'field' => '' ], |
|
| 31 | + [ 'property' => 'license', 'field' => '' ], |
|
| 32 | 32 | ], |
| 33 | 33 | 'sitemapVideoFieldMap' => [ |
| 34 | - ['property' => 'title', 'field' => 'title'], |
|
| 35 | - ['property' => 'description', 'field' => ''], |
|
| 36 | - ['property' => 'thumbnailLoc', 'field' => ''], |
|
| 37 | - ['property' => 'duration', 'field' => ''], |
|
| 38 | - ['property' => 'category', 'field' => ''], |
|
| 34 | + [ 'property' => 'title', 'field' => 'title' ], |
|
| 35 | + [ 'property' => 'description', 'field' => '' ], |
|
| 36 | + [ 'property' => 'thumbnailLoc', 'field' => '' ], |
|
| 37 | + [ 'property' => 'duration', 'field' => '' ], |
|
| 38 | + [ 'property' => 'category', 'field' => '' ], |
|
| 39 | 39 | ], |
| 40 | 40 | ], |
| 41 | 41 | ]; |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | 'name' => $element->title, |
| 91 | 91 | ], |
| 92 | 92 | ]); |
| 93 | - $crumbs->itemListElement[] = $listItem; |
|
| 93 | + $crumbs->itemListElement[ ] = $listItem; |
|
| 94 | 94 | } else { |
| 95 | - $crumbs->itemListElement[] = MetaJsonLd::create("ListItem", [ |
|
| 95 | + $crumbs->itemListElement[ ] = MetaJsonLd::create("ListItem", [ |
|
| 96 | 96 | 'position' => $position, |
| 97 | 97 | 'item' => [ |
| 98 | 98 | '@id' => $siteUrl, |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $id = $siteUrl; |
| 127 | 127 | Craft::error($e->getMessage(), __METHOD__); |
| 128 | 128 | } |
| 129 | - $crumbs->itemListElement[] = MetaJsonLd::create("ListItem", [ |
|
| 129 | + $crumbs->itemListElement[ ] = MetaJsonLd::create("ListItem", [ |
|
| 130 | 130 | 'position' => $position, |
| 131 | 131 | 'item' => [ |
| 132 | 132 | '@id' => $id, |
@@ -149,11 +149,11 @@ discard block |
||
| 149 | 149 | $sites = self::getLocalizedUrls(); |
| 150 | 150 | |
| 151 | 151 | // Add the x-default hreflang |
| 152 | - $site = $sites[0]; |
|
| 152 | + $site = $sites[ 0 ]; |
|
| 153 | 153 | $metaTag = Seomatic::$plugin->link->create([ |
| 154 | 154 | 'rel' => 'alternate', |
| 155 | 155 | 'hreflang' => 'x-default', |
| 156 | - 'href' => $site['url'], |
|
| 156 | + 'href' => $site[ 'url' ], |
|
| 157 | 157 | ]); |
| 158 | 158 | Seomatic::$plugin->link->add($metaTag); |
| 159 | 159 | // Add the alternate language link rel's |
@@ -161,8 +161,8 @@ discard block |
||
| 161 | 161 | foreach ($sites as $site) { |
| 162 | 162 | $metaTag = Seomatic::$plugin->link->create([ |
| 163 | 163 | 'rel' => 'alternate', |
| 164 | - 'hreflang' => $site['language'], |
|
| 165 | - 'href' => $site['url'], |
|
| 164 | + 'hreflang' => $site[ 'language' ], |
|
| 165 | + 'href' => $site[ 'url' ], |
|
| 166 | 166 | ]); |
| 167 | 167 | Seomatic::$plugin->link->add($metaTag); |
| 168 | 168 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | */ |
| 191 | 191 | public static function getLocalizedUrls() |
| 192 | 192 | { |
| 193 | - $localizedUrls = []; |
|
| 193 | + $localizedUrls = [ ]; |
|
| 194 | 194 | try { |
| 195 | 195 | $requestUri = Craft::$app->getRequest()->getUrl(); |
| 196 | 196 | } catch (InvalidConfigException $e) { |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | $language = $site->language; |
| 229 | 229 | $language = strtolower($language); |
| 230 | 230 | $language = str_replace('_', '-', $language); |
| 231 | - $localizedUrls[] = [ |
|
| 231 | + $localizedUrls[ ] = [ |
|
| 232 | 232 | 'id' => $site->id, |
| 233 | 233 | 'language' => $language, |
| 234 | 234 | 'url' => $url |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | // Static Methods |
| 29 | 29 | // ========================================================================= |
| 30 | 30 | |
| 31 | - public static function renderStringTemplate(string $templateString, array $params = []): string |
|
| 31 | + public static function renderStringTemplate(string $templateString, array $params = [ ]): string |
|
| 32 | 32 | { |
| 33 | 33 | try { |
| 34 | 34 | $html = Seomatic::$view->renderString($templateString, $params); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $html = Craft::t( |
| 37 | 37 | 'seomatic', |
| 38 | 38 | 'Error rendering template string -> {error}', |
| 39 | - ['error' => $e->getMessage()] |
|
| 39 | + [ 'error' => $e->getMessage() ] |
|
| 40 | 40 | ); |
| 41 | 41 | Craft::error($html, __METHOD__); |
| 42 | 42 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * |
| 53 | 53 | * @return string |
| 54 | 54 | */ |
| 55 | - public static function renderPluginTemplate(string $templatePath, array $params = []): string |
|
| 55 | + public static function renderPluginTemplate(string $templatePath, array $params = [ ]): string |
|
| 56 | 56 | { |
| 57 | 57 | $templateRendered = false; |
| 58 | 58 | // Stash the old template mode, and set it AdminCP template mode |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $htmlText = Craft::t( |
| 72 | 72 | 'seomatic', |
| 73 | 73 | 'Error rendering `{template}` -> {error}', |
| 74 | - ['template' => $templatePath, 'error' => $e->getMessage()] |
|
| 74 | + [ 'template' => $templatePath, 'error' => $e->getMessage() ] |
|
| 75 | 75 | ); |
| 76 | 76 | Craft::error($htmlText, __METHOD__); |
| 77 | 77 | $templateRendered = false; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $htmlText = Craft::t( |
| 93 | 93 | 'seomatic', |
| 94 | 94 | 'Error rendering `{template}` -> {error}', |
| 95 | - ['template' => $templatePath, 'error' => $e->getMessage()] |
|
| 95 | + [ 'template' => $templatePath, 'error' => $e->getMessage() ] |
|
| 96 | 96 | ); |
| 97 | 97 | Craft::error($htmlText, __METHOD__); |
| 98 | 98 | $templateRendered = false; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | // Iterate through all of the matrix blocks |
| 80 | 80 | $tags = $tagQuery->all(); |
| 81 | 81 | foreach ($tags as $tag) { |
| 82 | - $result .= $tag->title.", "; |
|
| 82 | + $result .= $tag->title . ", "; |
|
| 83 | 83 | } |
| 84 | 84 | $result = rtrim($result, ", "); |
| 85 | 85 | |
@@ -108,14 +108,14 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | // Find any text fields inside of the matrix block |
| 110 | 110 | if ($matrixBlockTypeModel) { |
| 111 | - $fieldClasses = FieldHelper::FIELD_CLASSES[FieldHelper::TEXT_FIELD_CLASS_KEY]; |
|
| 111 | + $fieldClasses = FieldHelper::FIELD_CLASSES[ FieldHelper::TEXT_FIELD_CLASS_KEY ]; |
|
| 112 | 112 | $fields = $matrixBlockTypeModel->getFields(); |
| 113 | 113 | |
| 114 | 114 | foreach ($fields as $field) { |
| 115 | 115 | foreach ($fieldClasses as $fieldClassKey) { |
| 116 | 116 | if ($field instanceof $fieldClassKey) { |
| 117 | 117 | if ($field->handle == $fieldHandle || empty($fieldHandle)) { |
| 118 | - $result .= self::extractTextFromField($block[$field->handle]).' '; |
|
| 118 | + $result .= self::extractTextFromField($block[ $field->handle ]) . ' '; |
|
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | } |
@@ -237,13 +237,13 @@ discard block |
||
| 237 | 237 | protected static function stopWordsForLanguage(string $language) |
| 238 | 238 | { |
| 239 | 239 | $stopWords = null; |
| 240 | - if (!empty(self::LANGUAGE_MAP[$language])) { |
|
| 241 | - $language = self::LANGUAGE_MAP[$language]; |
|
| 240 | + if (!empty(self::LANGUAGE_MAP[ $language ])) { |
|
| 241 | + $language = self::LANGUAGE_MAP[ $language ]; |
|
| 242 | 242 | } else { |
| 243 | 243 | $language = 'English'; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - $className = 'PhpScience\\TextRank\\Tool\\StopWords\\'.ucfirst($language); |
|
| 246 | + $className = 'PhpScience\\TextRank\\Tool\\StopWords\\' . ucfirst($language); |
|
| 247 | 247 | if (class_exists($className)) { |
| 248 | 248 | $stopWords = new $className; |
| 249 | 249 | } |
@@ -31,10 +31,10 @@ |
||
| 31 | 31 | { |
| 32 | 32 | foreach ($array as $k => $v) { |
| 33 | 33 | if (is_array($v)) { |
| 34 | - $array[$k] = self::arrayFilterRecursive($v, $callback); |
|
| 34 | + $array[ $k ] = self::arrayFilterRecursive($v, $callback); |
|
| 35 | 35 | } else { |
| 36 | 36 | if ($callback($v, $k)) { |
| 37 | - unset($array[$k]); |
|
| 37 | + unset($array[ $k ]); |
|
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | } |
@@ -48,12 +48,12 @@ discard block |
||
| 48 | 48 | // Now try our own internal config |
| 49 | 49 | $path = self::getConfigFilePath('@nystudio107/seomatic', $filePath); |
| 50 | 50 | if (!file_exists($path)) { |
| 51 | - return []; |
|
| 51 | + return [ ]; |
|
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | if (!is_array($config = @include $path)) { |
| 56 | - return []; |
|
| 56 | + return [ ]; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // If it's not a multi-environment config, return the whole thing |
@@ -63,10 +63,10 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | // If no environment was specified, just look in the '*' array |
| 65 | 65 | if (Seomatic::$settings->environment === null) { |
| 66 | - return $config['*']; |
|
| 66 | + return $config[ '*' ]; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - $mergedConfig = []; |
|
| 69 | + $mergedConfig = [ ]; |
|
| 70 | 70 | foreach ($config as $env => $envConfig) { |
| 71 | 71 | if ($env === '*' || StringHelper::contains(Seomatic::$settings->environment, $env)) { |
| 72 | 72 | $mergedConfig = ArrayHelper::merge($mergedConfig, $envConfig); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public static function getMergedConfigFromFiles(array $filePaths): array |
| 87 | 87 | { |
| 88 | - $mergedConfig = []; |
|
| 88 | + $mergedConfig = [ ]; |
|
| 89 | 89 | foreach ($filePaths as $filePath) { |
| 90 | 90 | $mergedConfig = ArrayHelper::merge($mergedConfig, self::getConfigFromFile($filePath)); |
| 91 | 91 | } |
@@ -67,8 +67,8 @@ |
||
| 67 | 67 | { |
| 68 | 68 | $url = ''; |
| 69 | 69 | $config = array_merge( |
| 70 | - self::$transforms['base'], |
|
| 71 | - self::$transforms[$transformName] ?? self::$transforms['base'] |
|
| 70 | + self::$transforms[ 'base' ], |
|
| 71 | + self::$transforms[ $transformName ] ?? self::$transforms[ 'base' ] |
|
| 72 | 72 | ); |
| 73 | 73 | $transform = new AssetTransform($config); |
| 74 | 74 | if (is_int($asset)) { |