Passed
Pull Request — develop-v4 (#13)
by
unknown
20:44
created
src/helpers/Analytics.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             $urlParts = parse_url($url);
73 73
             $url = $urlParts['path'] ?? '/';
74 74
             if (isset($urlParts['query'])) {
75
-                $url .= '?' . $urlParts['query'];
75
+                $url .= '?'.$urlParts['query'];
76 76
             }
77 77
         }
78 78
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $path = parse_url($url, PHP_URL_PATH);
114 114
         $pathFragments = explode('/', rtrim($path, '/'));
115 115
         $fileName = end($pathFragments);
116
-        $trackingUrl = UrlHelper::siteUrl('instantanalytics/pageViewTrack/' . $fileName, $urlParams);
116
+        $trackingUrl = UrlHelper::siteUrl('instantanalytics/pageViewTrack/'.$fileName, $urlParams);
117 117
 
118 118
         InstantAnalytics::$plugin->logAnalyticsEvent(
119 119
             'Created pageViewTrackingUrl for: {trackingUrl}',
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         $urlParams = compact('url', 'eventName', 'params');
145 145
 
146 146
         $fileName = pathinfo(parse_url($url, PHP_URL_PATH), PATHINFO_BASENAME);
147
-        $trackingUrl = UrlHelper::siteUrl('instantanalytics/eventTrack/' . $fileName, $urlParams);
147
+        $trackingUrl = UrlHelper::siteUrl('instantanalytics/eventTrack/'.$fileName, $urlParams);
148 148
 
149 149
         InstantAnalytics::$plugin->logAnalyticsEvent(
150 150
             'Created eventTrackingUrl for: {trackingUrl}',
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         $result = true;
169 169
         $request = Craft::$app->getRequest();
170 170
 
171
-        $logExclusion = static function (string $setting)
171
+        $logExclusion = static function(string $setting)
172 172
         {
173 173
             if (InstantAnalytics::$settings->logExcludedAnalytics) {
174 174
                 $request = Craft::$app->getRequest();
@@ -277,11 +277,11 @@  discard block
 block discarded – undo
277 277
             $cid = $_COOKIE['_ia'];
278 278
         } else {
279 279
             // Generate our own client id, otherwise.
280
-            $cid = static::gaGenUUID() . '.1';
280
+            $cid = static::gaGenUUID().'.1';
281 281
         }
282 282
 
283 283
         if (InstantAnalytics::$settings->createGclidCookie && !empty($cid)) {
284
-            setcookie('_ia', $cid, strtotime('+' . InstantAnalytics::$settings->sessionDuration . ' minutes'), '/'); // Two years
284
+            setcookie('_ia', $cid, strtotime('+'.InstantAnalytics::$settings->sessionDuration.' minutes'), '/'); // Two years
285 285
         }
286 286
 
287 287
         return $cid;
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
     public static function getSessionCookie(): ?array
297 297
     {
298 298
         $measurementId = App::parseEnv(InstantAnalytics::$settings->googleAnalyticsMeasurementId);
299
-        $cookieName = '_ga_' . StringHelper::removeLeft($measurementId, 'G-');
299
+        $cookieName = '_ga_'.StringHelper::removeLeft($measurementId, 'G-');
300 300
         if (isset($_COOKIE[$cookieName])) {
301 301
             $sessionCookie = null;
302 302
 
Please login to merge, or discard this patch.