| @@ -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 | 
| @@ -119,7 +119,7 @@ discard block | ||
| 119 | 119 | ->setEventCategory($eventCategory) | 
| 120 | 120 | ->setEventAction($eventAction) | 
| 121 | 121 | ->setEventLabel($eventLabel) | 
| 122 | - ->setEventValue((int)$eventValue); | |
| 122 | + ->setEventValue((int) $eventValue); | |
| 123 | 123 | $result = $analytics; | 
| 124 | 124 | Craft::info( | 
| 125 | 125 | Craft::t( | 
| @@ -519,7 +519,7 @@ discard block | ||
| 519 | 519 | $cid = $_COOKIE['_ia']; | 
| 520 | 520 |          } else { | 
| 521 | 521 | // Only generate our own unique clientId if `requireGaCookieClientId` isn't true | 
| 522 | -            if (!InstantAnalytics::$settings->requireGaCookieClientId)  { | |
| 522 | +            if (!InstantAnalytics::$settings->requireGaCookieClientId) { | |
| 523 | 523 | $cid = $this->gaGenUUID(); | 
| 524 | 524 | } | 
| 525 | 525 | } | 
| @@ -146,7 +146,7 @@ discard block | ||
| 146 | 146 |              if ($this->getClientId() !== null || $this->getUserId() !== null) { | 
| 147 | 147 |                  try { | 
| 148 | 148 | Craft::info( | 
| 149 | - 'Send hit for IAnalytics object: ' . print_r($this, true), | |
| 149 | + 'Send hit for IAnalytics object: '.print_r($this, true), | |
| 150 | 150 | __METHOD__ | 
| 151 | 151 | ); | 
| 152 | 152 | |
| @@ -154,14 +154,14 @@ discard block | ||
| 154 | 154 |                  } catch (\Exception $e) { | 
| 155 | 155 |                      if (InstantAnalytics::$settings->logExcludedAnalytics) { | 
| 156 | 156 | Craft::info( | 
| 157 | - '*** sendHit(): error sending analytics: ' . $e->getMessage(), | |
| 157 | + '*** sendHit(): error sending analytics: '.$e->getMessage(), | |
| 158 | 158 | __METHOD__ | 
| 159 | 159 | ); | 
| 160 | 160 | } | 
| 161 | 161 | } | 
| 162 | 162 |              } elseif (InstantAnalytics::$settings->logExcludedAnalytics) { | 
| 163 | 163 | Craft::info( | 
| 164 | - '*** sendHit(): analytics not sent for '.$requestIp. ' because no clientId or userId is set', | |
| 164 | + '*** sendHit(): analytics not sent for '.$requestIp.' because no clientId or userId is set', | |
| 165 | 165 | __METHOD__ | 
| 166 | 166 | ); | 
| 167 | 167 | } | 
| @@ -209,7 +209,7 @@ discard block | ||
| 209 | 209 | Event::on( | 
| 210 | 210 | CraftVariable::class, | 
| 211 | 211 | CraftVariable::EVENT_INIT, | 
| 212 | -            function (Event $event) { | |
| 212 | +            function(Event $event) { | |
| 213 | 213 | /** @var CraftVariable $variable */ | 
| 214 | 214 | $variable = $event->sender; | 
| 215 | 215 |                  $variable->set('instantAnalytics', [ | 
| @@ -229,7 +229,7 @@ discard block | ||
| 229 | 229 | Event::on( | 
| 230 | 230 | Plugins::class, | 
| 231 | 231 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, | 
| 232 | -            function (PluginEvent $event) { | |
| 232 | +            function(PluginEvent $event) { | |
| 233 | 233 |                  if ($event->plugin === $this) { | 
| 234 | 234 | $request = Craft::$app->getRequest(); | 
| 235 | 235 |                      if ($request->isCpRequest) { | 
| @@ -258,7 +258,7 @@ discard block | ||
| 258 | 258 | Event::on( | 
| 259 | 259 | UrlManager::class, | 
| 260 | 260 | UrlManager::EVENT_REGISTER_SITE_URL_RULES, | 
| 261 | -            function (RegisterUrlRulesEvent $event) { | |
| 261 | +            function(RegisterUrlRulesEvent $event) { | |
| 262 | 262 | Craft::debug( | 
| 263 | 263 | 'UrlManager::EVENT_REGISTER_SITE_URL_RULES', | 
| 264 | 264 | __METHOD__ | 
| @@ -274,7 +274,7 @@ discard block | ||
| 274 | 274 | Event::on( | 
| 275 | 275 | View::class, | 
| 276 | 276 | View::EVENT_BEFORE_RENDER_PAGE_TEMPLATE, | 
| 277 | -            function (TemplateEvent $event) { | |
| 277 | +            function(TemplateEvent $event) { | |
| 278 | 278 | self::$currentTemplate = $event->template; | 
| 279 | 279 | } | 
| 280 | 280 | ); | 
| @@ -282,7 +282,7 @@ discard block | ||
| 282 | 282 | Event::on( | 
| 283 | 283 | View::class, | 
| 284 | 284 | View::EVENT_AFTER_RENDER_PAGE_TEMPLATE, | 
| 285 | -            function (TemplateEvent $event) { | |
| 285 | +            function(TemplateEvent $event) { | |
| 286 | 286 |                  if (self::$settings->autoSendPageView) { | 
| 287 | 287 | $this->sendPageView(); | 
| 288 | 288 | } | 
| @@ -290,14 +290,14 @@ discard block | ||
| 290 | 290 | ); | 
| 291 | 291 | // Commerce-specific hooks | 
| 292 | 292 |          if (self::$commercePlugin) { | 
| 293 | -            Event::on(Order::class, Order::EVENT_AFTER_COMPLETE_ORDER, function (Event $e) { | |
| 293 | +            Event::on(Order::class, Order::EVENT_AFTER_COMPLETE_ORDER, function(Event $e) { | |
| 294 | 294 | $order = $e->sender; | 
| 295 | 295 |                  if (self::$settings->autoSendPurchaseComplete) { | 
| 296 | 296 | $this->commerce->orderComplete($order); | 
| 297 | 297 | } | 
| 298 | 298 | }); | 
| 299 | 299 | |
| 300 | -            Event::on(Order::class, Order::EVENT_AFTER_ADD_LINE_ITEM, function (LineItemEvent $e) { | |
| 300 | +            Event::on(Order::class, Order::EVENT_AFTER_ADD_LINE_ITEM, function(LineItemEvent $e) { | |
| 301 | 301 | $lineItem = $e->lineItem; | 
| 302 | 302 |                  if (self::$settings->autoSendAddToCart) { | 
| 303 | 303 | $this->commerce->addToCart($lineItem->order, $lineItem); | 
| @@ -305,8 +305,8 @@ discard block | ||
| 305 | 305 | }); | 
| 306 | 306 | |
| 307 | 307 | // Check to make sure Order::EVENT_AFTER_REMOVE_LINE_ITEM is defined | 
| 308 | -            if (defined(Order::class . '::EVENT_AFTER_REMOVE_LINE_ITEM')) { | |
| 309 | -                Event::on(Order::class, Order::EVENT_AFTER_REMOVE_LINE_ITEM, function (LineItemEvent $e) { | |
| 308 | +            if (defined(Order::class.'::EVENT_AFTER_REMOVE_LINE_ITEM')) { | |
| 309 | +                Event::on(Order::class, Order::EVENT_AFTER_REMOVE_LINE_ITEM, function(LineItemEvent $e) { | |
| 310 | 310 | $lineItem = $e->lineItem; | 
| 311 | 311 |                      if (self::$settings->autoSendRemoveFromCart) { | 
| 312 | 312 | $this->commerce->removeFromCart($lineItem->order, $lineItem); |