@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @var MetaJsonLd |
| 39 | 39 | */ |
| 40 | - public $data = []; |
|
| 40 | + public $data = [ ]; |
|
| 41 | 41 | |
| 42 | 42 | // Public Methods |
| 43 | 43 | // ========================================================================= |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | Seomatic::$view->registerScript( |
| 62 | 62 | $jsonLd, |
| 63 | 63 | View::POS_END, |
| 64 | - ['type' => 'application/ld+json'] |
|
| 64 | + [ 'type' => 'application/ld+json' ] |
|
| 65 | 65 | ); |
| 66 | 66 | // If `devMode` is enabled, validate the JSON-LD and output any model errors |
| 67 | 67 | if (Seomatic::$devMode) { |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | parent::normalizeContainerData(); |
| 88 | 88 | |
| 89 | 89 | foreach ($this->data as $key => $config) { |
| 90 | - $this->data[$key] = MetaJsonLd::create($config['type'], $config); |
|
| 90 | + $this->data[ $key ] = MetaJsonLd::create($config[ 'type' ], $config); |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * |
| 37 | 37 | * @var MetaTag |
| 38 | 38 | */ |
| 39 | - public $data = []; |
|
| 39 | + public $data = [ ]; |
|
| 40 | 40 | |
| 41 | 41 | // Public Methods |
| 42 | 42 | // ========================================================================= |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | Seomatic::$view->registerMetaTag($config); |
| 57 | 57 | // If `devMode` is enabled, validate the Meta Tag and output any model errors |
| 58 | 58 | if (Seomatic::$devMode) { |
| 59 | - $scenario = []; |
|
| 60 | - $scenario['default'] = 'error'; |
|
| 61 | - $scenario['warning'] = 'warning'; |
|
| 59 | + $scenario = [ ]; |
|
| 60 | + $scenario[ 'default' ] = 'error'; |
|
| 61 | + $scenario[ 'warning' ] = 'warning'; |
|
| 62 | 62 | $metaTagModel->debugMetaItem( |
| 63 | 63 | "Tag attribute: ", |
| 64 | 64 | $scenario |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | parent::normalizeContainerData(); |
| 80 | 80 | |
| 81 | 81 | foreach ($this->data as $key => $config) { |
| 82 | - $this->data[$key] = MetaTag::create($key, $config); |
|
| 82 | + $this->data[ $key ] = MetaTag::create($key, $config); |
|
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * |
| 33 | 33 | * @return null|MetaSitemapVars |
| 34 | 34 | */ |
| 35 | - public static function create(array $config = []) |
|
| 35 | + public static function create(array $config = [ ]) |
|
| 36 | 36 | { |
| 37 | 37 | $model = new MetaSitemapVars($config); |
| 38 | 38 | |
@@ -80,12 +80,12 @@ discard block |
||
| 80 | 80 | /** |
| 81 | 81 | * @var array |
| 82 | 82 | */ |
| 83 | - public $sitemapImageFieldMap = []; |
|
| 83 | + public $sitemapImageFieldMap = [ ]; |
|
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | 86 | * @var array |
| 87 | 87 | */ |
| 88 | - public $sitemapVideoFieldMap = []; |
|
| 88 | + public $sitemapVideoFieldMap = [ ]; |
|
| 89 | 89 | |
| 90 | 90 | // Public Methods |
| 91 | 91 | // ========================================================================= |
@@ -113,10 +113,10 @@ discard block |
||
| 113 | 113 | ], |
| 114 | 114 | 'string', |
| 115 | 115 | ], |
| 116 | - [['sitemapPriority'], 'number'], |
|
| 117 | - [['sitemapLimit'], 'integer'], |
|
| 118 | - [['sitemapUrls', 'sitemapAssets', 'sitemapAltLinks', 'sitemapFiles'], 'boolean'], |
|
| 119 | - [['sitemapImageFieldMap', 'sitemapVideoFieldMap'], ArrayValidator::class], |
|
| 116 | + [ [ 'sitemapPriority' ], 'number' ], |
|
| 117 | + [ [ 'sitemapLimit' ], 'integer' ], |
|
| 118 | + [ [ 'sitemapUrls', 'sitemapAssets', 'sitemapAltLinks', 'sitemapFiles' ], 'boolean' ], |
|
| 119 | + [ [ 'sitemapImageFieldMap', 'sitemapVideoFieldMap' ], ArrayValidator::class ], |
|
| 120 | 120 | ]; |
| 121 | 121 | } |
| 122 | 122 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * |
| 35 | 35 | * @return null|MetaGlobalVars |
| 36 | 36 | */ |
| 37 | - public static function create(array $config = []) |
|
| 37 | + public static function create(array $config = [ ]) |
|
| 38 | 38 | { |
| 39 | 39 | $model = new MetaGlobalVars($config); |
| 40 | 40 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | /** |
| 163 | 163 | * @inheritdoc |
| 164 | 164 | */ |
| 165 | - public function __construct(array $config = []) |
|
| 165 | + public function __construct(array $config = [ ]) |
|
| 166 | 166 | { |
| 167 | 167 | // Unset any deprecated properties |
| 168 | 168 | //unset($config['siteNamePosition']); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | 'nocache', |
| 237 | 237 | ], |
| 238 | 238 | ], |
| 239 | - [['canonicalUrl'], 'url'], |
|
| 239 | + [ [ 'canonicalUrl' ], 'url' ], |
|
| 240 | 240 | ]; |
| 241 | 241 | } |
| 242 | 242 | } |
@@ -222,7 +222,7 @@ |
||
| 222 | 222 | [ |
| 223 | 223 | 'genericImageIds', |
| 224 | 224 | ], |
| 225 | - 'each', 'rule' => ['integer'], |
|
| 225 | + 'each', 'rule' => [ 'integer' ], |
|
| 226 | 226 | ], |
| 227 | 227 | [ |
| 228 | 228 | [ |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * |
| 35 | 35 | * @var MetaLink |
| 36 | 36 | */ |
| 37 | - public $data = []; |
|
| 37 | + public $data = [ ]; |
|
| 38 | 38 | |
| 39 | 39 | // Public Methods |
| 40 | 40 | // ========================================================================= |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | parent::normalizeContainerData(); |
| 74 | 74 | |
| 75 | 75 | foreach ($this->data as $key => $config) { |
| 76 | - $this->data[$key] = MetaLink::create($config); |
|
| 76 | + $this->data[ $key ] = MetaLink::create($config); |
|
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * |
| 35 | 35 | * @var MetaTitle |
| 36 | 36 | */ |
| 37 | - public $data = []; |
|
| 37 | + public $data = [ ]; |
|
| 38 | 38 | |
| 39 | 39 | // Public Methods |
| 40 | 40 | // ========================================================================= |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | Seomatic::$view->title = $title; |
| 54 | 54 | // If `devMode` is enabled, validate the Meta Tag and output any model errors |
| 55 | 55 | if (Seomatic::$devMode) { |
| 56 | - $scenario = []; |
|
| 57 | - $scenario['default'] = 'error'; |
|
| 58 | - $scenario['warning'] = 'warning'; |
|
| 56 | + $scenario = [ ]; |
|
| 57 | + $scenario[ 'default' ] = 'error'; |
|
| 58 | + $scenario[ 'warning' ] = 'warning'; |
|
| 59 | 59 | $metaTitleModel->debugMetaItem( |
| 60 | 60 | "Tag attribute: ", |
| 61 | 61 | $scenario |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | parent::normalizeContainerData(); |
| 76 | 76 | |
| 77 | 77 | foreach ($this->data as $key => $config) { |
| 78 | - $this->data[$key] = MetaTitle::create($config); |
|
| 78 | + $this->data[ $key ] = MetaTitle::create($config); |
|
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * |
| 40 | 40 | * @return MetaTitle |
| 41 | 41 | */ |
| 42 | - public static function create(array $config = []): MetaTitle |
|
| 42 | + public static function create(array $config = [ ]): MetaTitle |
|
| 43 | 43 | { |
| 44 | 44 | $model = new MetaTitle($config); |
| 45 | 45 | |
@@ -91,8 +91,8 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | $rules = parent::rules(); |
| 93 | 93 | $rules = array_merge($rules, [ |
| 94 | - [['title'], 'required'], |
|
| 95 | - [['title'], 'string', 'length' => [40, Seomatic::$settings->maxTitleLength], 'on' => ['warning']], |
|
| 94 | + [ [ 'title' ], 'required' ], |
|
| 95 | + [ [ 'title' ], 'string', 'length' => [ 40, Seomatic::$settings->maxTitleLength ], 'on' => [ 'warning' ] ], |
|
| 96 | 96 | ]); |
| 97 | 97 | |
| 98 | 98 | return $rules; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $suffix = ''; |
| 150 | 150 | break; |
| 151 | 151 | } |
| 152 | - $lengthAdjust = mb_strlen($prefix.$suffix); |
|
| 152 | + $lengthAdjust = mb_strlen($prefix . $suffix); |
|
| 153 | 153 | // Parse the data |
| 154 | 154 | $scenario = $this->scenario; |
| 155 | 155 | $this->setScenario('render'); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | Seomatic::$settings->maxTitleLength - $lengthAdjust, |
| 161 | 161 | '…' |
| 162 | 162 | ); |
| 163 | - $data = $prefix.$data.$suffix; |
|
| 163 | + $data = $prefix . $data . $suffix; |
|
| 164 | 164 | // devMode |
| 165 | 165 | if (Seomatic::$devMode) { |
| 166 | 166 | $data = Seomatic::$settings->devModeTitlePrefix . $data; |
@@ -173,12 +173,12 @@ discard block |
||
| 173 | 173 | /** |
| 174 | 174 | * @inheritdoc |
| 175 | 175 | */ |
| 176 | - public function render($params = []):string |
|
| 176 | + public function render($params = [ ]):string |
|
| 177 | 177 | { |
| 178 | 178 | $html = ''; |
| 179 | 179 | $title = $this->title; |
| 180 | 180 | if ($this->prepForRender($title)) { |
| 181 | - $html = Html::tag('title', $title, []); |
|
| 181 | + $html = Html::tag('title', $title, [ ]); |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | return $html; |
@@ -187,12 +187,12 @@ discard block |
||
| 187 | 187 | /** |
| 188 | 188 | * @inheritdoc |
| 189 | 189 | */ |
| 190 | - public function renderAttributes($params = []): array |
|
| 190 | + public function renderAttributes($params = [ ]): array |
|
| 191 | 191 | { |
| 192 | - $attributes = []; |
|
| 192 | + $attributes = [ ]; |
|
| 193 | 193 | $title = $this->title; |
| 194 | 194 | if ($this->prepForRender($title)) { |
| 195 | - $attributes = ['title' => $title]; |
|
| 195 | + $attributes = [ 'title' => $title ]; |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | return $attributes; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * @return MetaTag |
| 48 | 48 | */ |
| 49 | - public static function create($tagType = null, array $config = []): MetaTag |
|
| 49 | + public static function create($tagType = null, array $config = [ ]): MetaTag |
|
| 50 | 50 | { |
| 51 | 51 | $tagType = Inflector::variablize($tagType); |
| 52 | 52 | // Variablize the keys so that they coincide with our property names |
@@ -118,9 +118,9 @@ discard block |
||
| 118 | 118 | { |
| 119 | 119 | $rules = parent::rules(); |
| 120 | 120 | $rules = array_merge($rules, [ |
| 121 | - [['charset', 'httpEquiv', 'name', 'property'], 'string'], |
|
| 122 | - [['content'], 'validateStringOrArray'], |
|
| 123 | - [['name'], 'safe', 'on' => ['warning']] |
|
| 121 | + [ [ 'charset', 'httpEquiv', 'name', 'property' ], 'string' ], |
|
| 122 | + [ [ 'content' ], 'validateStringOrArray' ], |
|
| 123 | + [ [ 'name' ], 'safe', 'on' => [ 'warning' ] ] |
|
| 124 | 124 | ]); |
| 125 | 125 | |
| 126 | 126 | return $rules; |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | $error = Craft::t( |
| 156 | 156 | 'seomatic', |
| 157 | 157 | '{tagtype} tag `{key}` did not render because it is missing attributes. ' . print_r($data, true), |
| 158 | - ['tagtype' => 'Meta', 'key' => $this->key] |
|
| 158 | + [ 'tagtype' => 'Meta', 'key' => $this->key ] |
|
| 159 | 159 | ); |
| 160 | 160 | Craft::error($error, __METHOD__); |
| 161 | 161 | $shouldRender = false; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | /** |
| 169 | 169 | * @inheritdoc |
| 170 | 170 | */ |
| 171 | - public function render($params = []): string |
|
| 171 | + public function render($params = [ ]): string |
|
| 172 | 172 | { |
| 173 | 173 | $html = ''; |
| 174 | 174 | $configs = $this->tagAttributesArray(); |
@@ -185,9 +185,9 @@ discard block |
||
| 185 | 185 | /** |
| 186 | 186 | * @inheritdoc |
| 187 | 187 | */ |
| 188 | - public function renderAttributes($params = []): array |
|
| 188 | + public function renderAttributes($params = [ ]): array |
|
| 189 | 189 | { |
| 190 | - $attributes = []; |
|
| 190 | + $attributes = [ ]; |
|
| 191 | 191 | |
| 192 | 192 | $configs = $this->tagAttributesArray(); |
| 193 | 193 | foreach ($configs as $config) { |