Passed
Branch v3 (ce9cae)
by Andrew
08:41
created
src/seomatic-config/entrymeta/SitemapVars.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,16 +24,16 @@
 block discarded – undo
24 24
     'sitemapPriority'      => 0.5,
25 25
     'sitemapLimit'         => null,
26 26
     'sitemapImageFieldMap' => [
27
-        ['property' => 'title', 'field' => 'title'],
28
-        ['property' => 'caption', 'field' => ''],
29
-        ['property' => 'geo_location', 'field' => ''],
30
-        ['property' => 'license', 'field' => ''],
27
+        [ 'property' => 'title', 'field' => 'title' ],
28
+        [ 'property' => 'caption', 'field' => '' ],
29
+        [ 'property' => 'geo_location', 'field' => '' ],
30
+        [ 'property' => 'license', 'field' => '' ],
31 31
     ],
32 32
     'sitemapVideoFieldMap' => [
33
-        ['property' => 'title', 'field' => 'title'],
34
-        ['property' => 'description', 'field' => ''],
35
-        ['property' => 'thumbnailLoc', 'field' => ''],
36
-        ['property' => 'duration', 'field' => ''],
37
-        ['property' => 'category', 'field' => ''],
33
+        [ 'property' => 'title', 'field' => 'title' ],
34
+        [ 'property' => 'description', 'field' => '' ],
35
+        [ 'property' => 'thumbnailLoc', 'field' => '' ],
36
+        [ 'property' => 'duration', 'field' => '' ],
37
+        [ 'property' => 'category', 'field' => '' ],
38 38
     ],
39 39
 ];
Please login to merge, or discard this patch.
src/seomatic-config/entrymeta/TitleContainer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
  */
21 21
 
22 22
 return [
23
-    MetaTitleContainer::CONTAINER_TYPE.TitleService::GENERAL_HANDLE => [
23
+    MetaTitleContainer::CONTAINER_TYPE . TitleService::GENERAL_HANDLE => [
24 24
         'name'         => 'General',
25 25
         'description'  => 'Meta Title Tag',
26 26
         'handle'       => TitleService::GENERAL_HANDLE,
Please login to merge, or discard this patch.
src/seomatic-config/entrymeta/BundleSettings.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         'seoDescriptionField'           => '',
24 24
         'seoKeywordsSource'             => 'fromCustom',
25 25
         'seoKeywordsField'              => '',
26
-        'seoImageIds'                   => [],
26
+        'seoImageIds'                   => [ ],
27 27
         'seoImageSource'                => 'fromAsset',
28 28
         'seoImageField'                 => '',
29 29
         'seoImageTransform'             => true,
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         'twitterSiteNamePositionSource' => 'fromCustom',
38 38
         'twitterDescriptionSource'      => 'sameAsSeo',
39 39
         'twitterDescriptionField'       => '',
40
-        'twitterImageIds'               => [],
40
+        'twitterImageIds'               => [ ],
41 41
         'twitterImageSource'            => 'sameAsSeo',
42 42
         'twitterImageField'             => '',
43 43
         'twitterImageTransform'         => true,
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         'ogSiteNamePositionSource'      => 'fromCustom',
50 50
         'ogDescriptionSource'           => 'sameAsSeo',
51 51
         'ogDescriptionField'            => '',
52
-        'ogImageIds'                    => [],
52
+        'ogImageIds'                    => [ ],
53 53
         'ogImageSource'                 => 'sameAsSeo',
54 54
         'ogImageField'                  => '',
55 55
         'ogImageTransform'              => true,
Please login to merge, or discard this patch.
src/seomatic-config/entrymeta/ScriptContainer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.
src/helpers/DynamicMeta.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
src/helpers/PluginTemplate.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/helpers/Text.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/helpers/ArrayHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/helpers/Config.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.