Passed
Push — develop ( 421797...7f10a1 )
by Andrew
09:07
created
src/services/MetaBundles.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function updateMetaBundle(MetaBundle $metaBundle, int $siteId)
143 143
     {
144
-        $metaBundle->sourceName = (string)$metaBundle->sourceName;
145
-        $metaBundle->sourceTemplate = (string)$metaBundle->sourceTemplate;
144
+        $metaBundle->sourceName = (string) $metaBundle->sourceName;
145
+        $metaBundle->sourceTemplate = (string) $metaBundle->sourceTemplate;
146 146
         // Make sure it validates
147 147
         if ($metaBundle->validate(null, true)) {
148 148
             // Save it out to a record
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                 'sourceSiteId' => $siteId,
153 153
             ];
154 154
             if ($metaBundle->typeId !== null) {
155
-                $metaBundle->typeId = (int)$metaBundle->typeId;
155
+                $metaBundle->typeId = (int) $metaBundle->typeId;
156 156
             }
157 157
             if (!empty($metaBundle->typeId)) {
158 158
                 $params['typeId'] = $metaBundle->typeId;
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     public function getMetaBundleBySourceId(string $sourceBundleType, int $sourceId, int $sourceSiteId, $typeId = null)
213 213
     {
214 214
         $metaBundle = null;
215
-        $typeId = (int)$typeId;
215
+        $typeId = (int) $typeId;
216 216
         // See if we have the meta bundle cached
217 217
         if (!empty($this->metaBundlesBySourceId[$sourceBundleType][$sourceId][$sourceSiteId][$typeId])) {
218 218
             $id = $this->metaBundlesBySourceId[$sourceBundleType][$sourceId][$sourceSiteId][$typeId];
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
     public function getMetaBundleBySourceHandle(string $sourceBundleType, string $sourceHandle, int $sourceSiteId, $typeId = null)
282 282
     {
283 283
         $metaBundle = null;
284
-        $typeId = (int)$typeId;
284
+        $typeId = (int) $typeId;
285 285
         // See if we have the meta bundle cached
286 286
         if (!empty($this->metaBundlesBySourceHandle[$sourceBundleType][$sourceHandle][$sourceSiteId][$typeId])) {
287 287
             $id = $this->metaBundlesBySourceHandle[$sourceBundleType][$sourceHandle][$sourceSiteId][$typeId];
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
                             /** @var Section|CategoryGroup|ProductType $sourceModel */
370 370
                             $sourceModel = $seoElement::sourceModelFromId($sourceId);
371 371
                             if ($sourceModel !== null) {
372
-                                $metaBundle->sourceName = (string)$sourceModel->name;
372
+                                $metaBundle->sourceName = (string) $sourceModel->name;
373 373
                                 $metaBundle->sourceHandle = $sourceModel->handle;
374 374
                             }
375 375
                         }
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
                 ->from(['{{%seomatic_metabundles}}'])
553 553
                 ->where(['=', 'sourceBundleType', $seoElement::META_BUNDLE_TYPE]);
554 554
 
555
-            if ((int)$sourceSiteId !== 0) {
555
+            if ((int) $sourceSiteId !== 0) {
556 556
                 $subQuery->andWhere(['sourceSiteId' => $sourceSiteId]);
557 557
             }
558 558
             if ($filter !== '') {
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
                 $metaBundleDefaults = ArrayHelper::merge(
846 846
                     $seoElement::metaBundleConfig($sourceModel),
847 847
                     [
848
-                        'sourceTemplate' => (string)$siteSetting->template,
848
+                        'sourceTemplate' => (string) $siteSetting->template,
849 849
                         'sourceSiteId' => $siteSetting->siteId,
850 850
                         'sourceAltSiteSettings' => $siteSettingsArray,
851 851
                         'sourceDateUpdated' => $dateUpdated,
Please login to merge, or discard this patch.
src/models/SitemapTemplate.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
         $metaBundle = Seomatic::$plugin->metaBundles->getMetaBundleBySourceHandle($type, $handle, $siteId);
112 112
         // If it doesn't exist, throw a 404
113
-        if ($metaBundle === null ) {
113
+        if ($metaBundle === null) {
114 114
             throw new NotFoundHttpException(Craft::t('seomatic', 'Page not found.'));
115 115
         }
116 116
         // Check to see if robots is `none` or `no index`
@@ -188,11 +188,11 @@  discard block
 block discarded – undo
188 188
             // Return an empty XML document
189 189
             $lines[] = '<?xml version="1.0" encoding="UTF-8"?>';
190 190
             $lines[] = '<?xml-stylesheet type="text/xsl" href="sitemap-empty.xsl"?>';
191
-            $lines[] = '<!-- ' . Craft::t('seomatic', 'This sitemap has not been generated yet.') . ' -->';
192
-            $lines[] = '<!-- ' . Craft::t('seomatic', 'If you are seeing this in local dev or an') . ' -->';
193
-            $lines[] = '<!-- ' . Craft::t('seomatic', 'environment with `devMode` on, caches only') . ' -->';
194
-            $lines[] = '<!-- ' . Craft::t('seomatic', 'last for 30 seconds in local dev, so it is') . ' -->';
195
-            $lines[] = '<!-- ' . Craft::t('seomatic', 'normal for the sitemap to not be cached.') . ' -->';
191
+            $lines[] = '<!-- '.Craft::t('seomatic', 'This sitemap has not been generated yet.').' -->';
192
+            $lines[] = '<!-- '.Craft::t('seomatic', 'If you are seeing this in local dev or an').' -->';
193
+            $lines[] = '<!-- '.Craft::t('seomatic', 'environment with `devMode` on, caches only').' -->';
194
+            $lines[] = '<!-- '.Craft::t('seomatic', 'last for 30 seconds in local dev, so it is').' -->';
195
+            $lines[] = '<!-- '.Craft::t('seomatic', 'normal for the sitemap to not be cached.').' -->';
196 196
             $lines[] = '<urlset>';
197 197
             $lines[] = '</urlset>';
198 198
             $lines = implode("\r\n", $lines);
Please login to merge, or discard this patch.