@@ -192,7 +192,7 @@ |
||
| 192 | 192 | // Prefix the keys with the global set name |
| 193 | 193 | $prefix = $global->handle; |
| 194 | 194 | $fields = array_combine( |
| 195 | - array_map(function ($key) use ($prefix) { |
|
| 195 | + array_map(function($key) use ($prefix) { |
|
| 196 | 196 | return $prefix.'.'.$key; |
| 197 | 197 | }, array_keys($fields)), |
| 198 | 198 | $fields |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | ->setEventCategory($eventCategory) |
| 114 | 114 | ->setEventAction($eventAction) |
| 115 | 115 | ->setEventLabel($eventLabel) |
| 116 | - ->setEventValue((int)$eventValue); |
|
| 116 | + ->setEventValue((int) $eventValue); |
|
| 117 | 117 | $result = $analytics; |
| 118 | 118 | Craft::info( |
| 119 | 119 | Craft::t( |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | Event::on( |
| 182 | 182 | CraftVariable::class, |
| 183 | 183 | CraftVariable::EVENT_INIT, |
| 184 | - function (Event $event) { |
|
| 184 | + function(Event $event) { |
|
| 185 | 185 | /** @var CraftVariable $variable */ |
| 186 | 186 | $variable = $event->sender; |
| 187 | 187 | $variable->set('instantAnalytics', InstantAnalyticsVariable::class); |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | Event::on( |
| 199 | 199 | Plugins::class, |
| 200 | 200 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
| 201 | - function (PluginEvent $event) { |
|
| 201 | + function(PluginEvent $event) { |
|
| 202 | 202 | if ($event->plugin === $this) { |
| 203 | 203 | $request = Craft::$app->getRequest(); |
| 204 | 204 | if ($request->isCpRequest) { |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | Event::on( |
| 228 | 228 | UrlManager::class, |
| 229 | 229 | UrlManager::EVENT_REGISTER_SITE_URL_RULES, |
| 230 | - function (RegisterUrlRulesEvent $event) { |
|
| 230 | + function(RegisterUrlRulesEvent $event) { |
|
| 231 | 231 | Craft::debug( |
| 232 | 232 | 'UrlManager::EVENT_REGISTER_SITE_URL_RULES', |
| 233 | 233 | __METHOD__ |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | Event::on( |
| 244 | 244 | View::class, |
| 245 | 245 | View::EVENT_BEFORE_RENDER_PAGE_TEMPLATE, |
| 246 | - function (TemplateEvent $event) { |
|
| 246 | + function(TemplateEvent $event) { |
|
| 247 | 247 | self::$currentTemplate = $event->template; |
| 248 | 248 | } |
| 249 | 249 | ); |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | Event::on( |
| 252 | 252 | View::class, |
| 253 | 253 | View::EVENT_AFTER_RENDER_PAGE_TEMPLATE, |
| 254 | - function (TemplateEvent $event) { |
|
| 254 | + function(TemplateEvent $event) { |
|
| 255 | 255 | $settings = InstantAnalytics::$plugin->getSettings(); |
| 256 | 256 | if ($settings->autoSendPageView) { |
| 257 | 257 | $this->sendPageView(); |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | $cache = Craft::$app->getCache(); |
| 301 | 301 | $file = $cache->getOrSet( |
| 302 | 302 | self::CACHE_KEY.$path, |
| 303 | - function () use ($path) { |
|
| 303 | + function() use ($path) { |
|
| 304 | 304 | $result = null; |
| 305 | 305 | $string = @file_get_contents($path); |
| 306 | 306 | if ($string) { |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | protected static function combinePaths(string ...$paths): string |
| 328 | 328 | { |
| 329 | 329 | $last_key = \count($paths) - 1; |
| 330 | - array_walk($paths, function (&$val, $key) use ($last_key) { |
|
| 330 | + array_walk($paths, function(&$val, $key) use ($last_key) { |
|
| 331 | 331 | switch ($key) { |
| 332 | 332 | case 0: |
| 333 | 333 | $val = rtrim($val, '/ '); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $analytics->setProductActionToPurchase(); |
| 54 | 54 | $analytics->sendEvent(); |
| 55 | 55 | |
| 56 | - Craft::info(Craft::t('instant-analytics', 'orderComplete for `Commerce` - `Purchase` - `{number}` - `{price}`', [ 'number' => $order->number, 'price' => $order->totalPrice ]), __METHOD__); |
|
| 56 | + Craft::info(Craft::t('instant-analytics', 'orderComplete for `Commerce` - `Purchase` - `{number}` - `{price}`', ['number' => $order->number, 'price' => $order->totalPrice]), __METHOD__); |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $analytics->setProductActionToAdd(); |
| 78 | 78 | $analytics->sendEvent(); |
| 79 | 79 | |
| 80 | - Craft::info(Craft::t('instant-analytics', 'addToCart for `Commerce` - `Add to Cart` - `{title}` - `{quantity}`', [ 'title' => $title, 'quantity' => $quantity ]), __METHOD__); |
|
| 80 | + Craft::info(Craft::t('instant-analytics', 'addToCart for `Commerce` - `Add to Cart` - `{title}` - `{quantity}`', ['title' => $title, 'quantity' => $quantity]), __METHOD__); |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $analytics->setProductActionToRemove(); |
| 100 | 100 | $analytics->sendEvent(); |
| 101 | 101 | |
| 102 | - Craft::info(Craft::t('instant-analytics', 'removeFromCart for `Commerce` - `Remove to Cart` - `{title}` - `{quantity}`', [ 'title' => $title, 'quantity' => $quantity ]), __METHOD__); |
|
| 102 | + Craft::info(Craft::t('instant-analytics', 'removeFromCart for `Commerce` - `Remove to Cart` - `{title}` - `{quantity}`', ['title' => $title, 'quantity' => $quantity]), __METHOD__); |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | //Add the product to the hit to be sent |
| 224 | 224 | $analytics->addProductImpression($productData, $listIndex); |
| 225 | 225 | |
| 226 | - Craft::info(Craft::t('instant-analytics', "addCommerceProductImpression for `{sku}` - `{name}` - `{name}` - `{index}`", [ 'sku' => $productData['sku'], 'name' => $productData['name'], 'index' => $index ]), __METHOD__); |
|
| 226 | + Craft::info(Craft::t('instant-analytics', "addCommerceProductImpression for `{sku}` - `{name}` - `{name}` - `{index}`", ['sku' => $productData['sku'], 'name' => $productData['name'], 'index' => $index]), __METHOD__); |
|
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | //Add the product to the hit to be sent |
| 244 | 244 | $analytics->addProduct($productData); |
| 245 | 245 | |
| 246 | - Craft::info(Craft::t('instant-analytics', "addCommerceProductDetailView for `{sku}` - `{name} - `{name}`", [ 'sku' => $productData['sku'], 'name' => $productData['name'] ]), __METHOD__); |
|
| 246 | + Craft::info(Craft::t('instant-analytics', "addCommerceProductDetailView for `{sku}` - `{name} - `{name}`", ['sku' => $productData['sku'], 'name' => $productData['name']]), __METHOD__); |
|
| 247 | 247 | } |
| 248 | 248 | } |
| 249 | 249 | |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | // Don't forget to set the product action, in this case to CHECKOUT |
| 276 | 276 | $analytics->setProductActionToCheckout(); |
| 277 | 277 | |
| 278 | - Craft::info(Craft::t('instant-analytics', "addCommerceCheckoutStep step: `{step}` with option: `{option}`", [ 'step' => $step, 'option' => $option ]), __METHOD__); |
|
| 278 | + Craft::info(Craft::t('instant-analytics', "addCommerceCheckoutStep step: `{step}` with option: `{option}`", ['step' => $step, 'option' => $option]), __METHOD__); |
|
| 279 | 279 | } |
| 280 | 280 | } |
| 281 | 281 | |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | $name = $cat->getTitle(); |
| 422 | 422 | |
| 423 | 423 | while ($cat = $cat->getParent()) { |
| 424 | - $name = $cat->getTitle() . "/" . $name; |
|
| 424 | + $name = $cat->getTitle()."/".$name; |
|
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | $cats[] = $name; |