Passed
Push — develop-v3 ( 7899ae...810808 )
by Andrew
10:26 queued 05:57
created
src/helpers/Analytics.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             $urlParts = parse_url($url);
71 71
             $url = $urlParts['path'] ?? '/';
72 72
             if (isset($urlParts['query'])) {
73
-                $url .= '?' . $urlParts['query'];
73
+                $url .= '?'.$urlParts['query'];
74 74
             }
75 75
         }
76 76
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $path = parse_url($url, PHP_URL_PATH);
112 112
         $pathFragments = explode('/', rtrim($path, '/'));
113 113
         $fileName = end($pathFragments);
114
-        $trackingUrl = UrlHelper::siteUrl('instantanalytics/pageViewTrack/' . $fileName, $urlParams);
114
+        $trackingUrl = UrlHelper::siteUrl('instantanalytics/pageViewTrack/'.$fileName, $urlParams);
115 115
 
116 116
         InstantAnalytics::$plugin->logAnalyticsEvent(
117 117
             'Created pageViewTrackingUrl for: {trackingUrl}',
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         $urlParams = compact('url', 'eventName', 'params');
143 143
 
144 144
         $fileName = pathinfo(parse_url($url, PHP_URL_PATH), PATHINFO_BASENAME);
145
-        $trackingUrl = UrlHelper::siteUrl('instantanalytics/eventTrack/' . $fileName, $urlParams);
145
+        $trackingUrl = UrlHelper::siteUrl('instantanalytics/eventTrack/'.$fileName, $urlParams);
146 146
 
147 147
         InstantAnalytics::$plugin->logAnalyticsEvent(
148 148
             'Created eventTrackingUrl for: {trackingUrl}',
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $result = true;
167 167
         $request = Craft::$app->getRequest();
168 168
 
169
-        $logExclusion = static function (string $setting)
169
+        $logExclusion = static function(string $setting)
170 170
         {
171 171
             if (InstantAnalytics::$settings->logExcludedAnalytics) {
172 172
                 $request = Craft::$app->getRequest();
Please login to merge, or discard this patch.
src/services/ServicesTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
         // so we can't extract it from the passed in $config
34 34
         $majorVersion = '1';
35 35
         // Dev server container name & port are based on the major version of this plugin
36
-        $devPort = 3000 + (int)$majorVersion;
37
-        $versionName = 'v' . $majorVersion;
36
+        $devPort = 3000 + (int) $majorVersion;
37
+        $versionName = 'v'.$majorVersion;
38 38
         // Merge in the passed config, so it our config can be overridden by Plugins::pluginConfigs['vite']
39 39
         // ref: https://github.com/craftcms/cms/issues/1989
40 40
         $config = ArrayHelper::merge([
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
                     'assetClass' => InstantAnalyticsAsset::class,
47 47
                     'checkDevServer' => true,
48 48
                     'class' => VitePluginService::class,
49
-                    'devServerInternal' => 'http://craft-instantanalytics-' . $versionName . '-buildchain-dev:' . $devPort,
50
-                    'devServerPublic' => 'http://localhost:' . $devPort,
49
+                    'devServerInternal' => 'http://craft-instantanalytics-'.$versionName.'-buildchain-dev:'.$devPort,
50
+                    'devServerPublic' => 'http://localhost:'.$devPort,
51 51
                     'errorEntry' => 'src/js/app.ts',
52 52
                     'useDevServer' => true,
53 53
                 ],
Please login to merge, or discard this patch.
src/services/Commerce.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -385,7 +385,7 @@
 block discarded – undo
385 385
                 $name = $cat->title;
386 386
 
387 387
                 while ($cat = $cat->parent) {
388
-                    $name = $cat->title . '/' . $name;
388
+                    $name = $cat->title.'/'.$name;
389 389
                 }
390 390
 
391 391
                 $cats[] = $name;
Please login to merge, or discard this patch.
src/ga4/ComponentFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
         ];
83 83
 
84 84
         if (!array_key_exists($componentName, $componentMap)) {
85
-            throw new InvalidArgumentException(Craft::t('instant-analytics-ga4', 'Unknown event type - ' . $componentName));
85
+            throw new InvalidArgumentException(Craft::t('instant-analytics-ga4', 'Unknown event type - '.$componentName));
86 86
         }
87 87
         
88 88
         return new $componentMap[$componentName];
Please login to merge, or discard this patch.
src/ga4/Analytics.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -352,7 +352,7 @@
 block discarded – undo
352 352
             // Load them up for GA4
353 353
             foreach ($campaignParams as $key => $method) {
354 354
                 $value = $request->getParam($key) ?? $session->get($key) ?? null;
355
-                $method = 'set' . $method;
355
+                $method = 'set'.$method;
356 356
 
357 357
                 $this->$method($value);
358 358
 
Please login to merge, or discard this patch.
src/helpers/Field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -190,7 +190,7 @@
 block discarded – undo
190 190
                 // Prefix the keys with the global set name
191 191
                 $prefix = $global->handle;
192 192
                 $fields = array_combine(
193
-                    array_map(function ($key) use ($prefix) {
193
+                    array_map(function($key) use ($prefix) {
194 194
                         return $prefix.'.'.$key;
195 195
                     }, array_keys($fields)),
196 196
                     $fields
Please login to merge, or discard this patch.
src/InstantAnalytics.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -214,13 +214,13 @@  discard block
 block discarded – undo
214 214
 
215 215
         $ga4 = $this->ga4;
216 216
         // Install our template hook
217
-        $view->hook('iaSendPageView', function (array $context) use ($ga4) { return (string) $ga4->addPageViewEvent(); });
217
+        $view->hook('iaSendPageView', function(array $context) use ($ga4) { return (string) $ga4->addPageViewEvent(); });
218 218
 
219 219
         // Register our variables
220 220
         Event::on(
221 221
             CraftVariable::class,
222 222
             CraftVariable::EVENT_INIT,
223
-            function (Event $event): void {
223
+            function(Event $event): void {
224 224
                 /** @var CraftVariable $variable */
225 225
                 $variable = $event->sender;
226 226
                 $variable->set('instantAnalytics', [
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         Event::on(
241 241
             Plugins::class,
242 242
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
243
-            function (PluginEvent $event): void {
243
+            function(PluginEvent $event): void {
244 244
                 if ($event->plugin === $this) {
245 245
                     $request = Craft::$app->getRequest();
246 246
                     if ($request->isCpRequest) {
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         Event::on(
271 271
             UrlManager::class,
272 272
             UrlManager::EVENT_REGISTER_SITE_URL_RULES,
273
-            function (RegisterUrlRulesEvent $event): void {
273
+            function(RegisterUrlRulesEvent $event): void {
274 274
                 Craft::debug(
275 275
                     'UrlManager::EVENT_REGISTER_SITE_URL_RULES',
276 276
                     __METHOD__
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
         Event::on(
287 287
             View::class,
288 288
             View::EVENT_BEFORE_RENDER_PAGE_TEMPLATE,
289
-            static function (TemplateEvent $event): void {
289
+            static function(TemplateEvent $event): void {
290 290
                 self::$currentTemplate = $event->template;
291 291
             }
292 292
         );
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
         Event::on(
295 295
             View::class,
296 296
             View::EVENT_AFTER_RENDER_PAGE_TEMPLATE,
297
-            function (TemplateEvent $event): void {
297
+            function(TemplateEvent $event): void {
298 298
                 if (self::$settings->autoSendPageView) {
299 299
                     $request = Craft::$app->getRequest();
300 300
                     if (!$request->getIsAjax()) {
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
         Event::on(
309 309
             Response::class,
310 310
             Response::EVENT_BEFORE_SEND,
311
-            function (Event $event): void {
311
+            function(Event $event): void {
312 312
                 // Initialize this sooner rather than later, since it's possible this will want to tinker with cookies
313 313
                 $this->ga4->getAnalytics();
314 314
             }
@@ -318,21 +318,21 @@  discard block
 block discarded – undo
318 318
         Event::on(
319 319
             Response::class,
320 320
             Response::EVENT_AFTER_SEND,
321
-            function (Event $event): void {
321
+            function(Event $event): void {
322 322
                 $this->ga4->getAnalytics()->sendCollectedEvents();
323 323
             }
324 324
         );
325 325
 
326 326
         // Commerce-specific hooks
327 327
         if (self::$commercePlugin !== null) {
328
-            Event::on(Order::class, Order::EVENT_AFTER_COMPLETE_ORDER, function (Event $e): void {
328
+            Event::on(Order::class, Order::EVENT_AFTER_COMPLETE_ORDER, function(Event $e): void {
329 329
                 $order = $e->sender;
330 330
                 if (self::$settings->autoSendPurchaseComplete) {
331 331
                     $this->commerce->triggerOrderCompleteEvent($order);
332 332
                 }
333 333
             });
334 334
 
335
-            Event::on(Order::class, Order::EVENT_AFTER_ADD_LINE_ITEM, function (LineItemEvent $e): void {
335
+            Event::on(Order::class, Order::EVENT_AFTER_ADD_LINE_ITEM, function(LineItemEvent $e): void {
336 336
                 $lineItem = $e->lineItem;
337 337
                 if (self::$settings->autoSendAddToCart) {
338 338
                     $this->commerce->triggerAddToCartEvent($lineItem);
@@ -340,8 +340,8 @@  discard block
 block discarded – undo
340 340
             });
341 341
 
342 342
             // Check to make sure Order::EVENT_AFTER_REMOVE_LINE_ITEM is defined
343
-            if (defined(Order::class . '::EVENT_AFTER_REMOVE_LINE_ITEM')) {
344
-                Event::on(Order::class, Order::EVENT_AFTER_REMOVE_LINE_ITEM, function (LineItemEvent $e): void {
343
+            if (defined(Order::class.'::EVENT_AFTER_REMOVE_LINE_ITEM')) {
344
+                Event::on(Order::class, Order::EVENT_AFTER_REMOVE_LINE_ITEM, function(LineItemEvent $e): void {
345 345
                     $lineItem = $e->lineItem;
346 346
                     if (self::$settings->autoSendRemoveFromCart) {
347 347
                         $this->commerce->triggerRemoveFromCartEvent($lineItem);
Please login to merge, or discard this patch.