@@ -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 | } |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | Event::on( |
| 199 | 199 | CraftVariable::class, |
| 200 | 200 | CraftVariable::EVENT_INIT, |
| 201 | - function (Event $event) { |
|
| 201 | + function(Event $event) { |
|
| 202 | 202 | /** @var CraftVariable $variable */ |
| 203 | 203 | $variable = $event->sender; |
| 204 | 204 | $variable->set('instantAnalytics', InstantAnalyticsVariable::class); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | Event::on( |
| 216 | 216 | Plugins::class, |
| 217 | 217 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
| 218 | - function (PluginEvent $event) { |
|
| 218 | + function(PluginEvent $event) { |
|
| 219 | 219 | if ($event->plugin === $this) { |
| 220 | 220 | $request = Craft::$app->getRequest(); |
| 221 | 221 | if ($request->isCpRequest) { |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | Event::on( |
| 245 | 245 | UrlManager::class, |
| 246 | 246 | UrlManager::EVENT_REGISTER_SITE_URL_RULES, |
| 247 | - function (RegisterUrlRulesEvent $event) { |
|
| 247 | + function(RegisterUrlRulesEvent $event) { |
|
| 248 | 248 | Craft::debug( |
| 249 | 249 | 'UrlManager::EVENT_REGISTER_SITE_URL_RULES', |
| 250 | 250 | __METHOD__ |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | Event::on( |
| 261 | 261 | View::class, |
| 262 | 262 | View::EVENT_BEFORE_RENDER_PAGE_TEMPLATE, |
| 263 | - function (TemplateEvent $event) { |
|
| 263 | + function(TemplateEvent $event) { |
|
| 264 | 264 | self::$currentTemplate = $event->template; |
| 265 | 265 | } |
| 266 | 266 | ); |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | Event::on( |
| 269 | 269 | View::class, |
| 270 | 270 | View::EVENT_AFTER_RENDER_PAGE_TEMPLATE, |
| 271 | - function (TemplateEvent $event) { |
|
| 271 | + function(TemplateEvent $event) { |
|
| 272 | 272 | if (self::$settings->autoSendPageView) { |
| 273 | 273 | $this->sendPageView(); |
| 274 | 274 | } |
@@ -276,14 +276,14 @@ discard block |
||
| 276 | 276 | ); |
| 277 | 277 | // Commerce-specific hooks |
| 278 | 278 | if (self::$commercePlugin) { |
| 279 | - Event::on(Order::class, Order::EVENT_AFTER_COMPLETE_ORDER, function (Event $e) { |
|
| 279 | + Event::on(Order::class, Order::EVENT_AFTER_COMPLETE_ORDER, function(Event $e) { |
|
| 280 | 280 | $order = $e->sender; |
| 281 | 281 | if (self::$settings->autoSendPurchaseComplete) { |
| 282 | 282 | $this->commerce->orderComplete($order); |
| 283 | 283 | } |
| 284 | 284 | }); |
| 285 | 285 | |
| 286 | - Event::on(Order::class, Order::EVENT_AFTER_ADD_LINE_ITEM, function (LineItemEvent $e) { |
|
| 286 | + Event::on(Order::class, Order::EVENT_AFTER_ADD_LINE_ITEM, function(LineItemEvent $e) { |
|
| 287 | 287 | $lineItem = $e->lineItem; |
| 288 | 288 | if (self::$settings->autoSendAddToCart) { |
| 289 | 289 | $this->commerce->addToCart($lineItem->order, $lineItem); |
@@ -291,8 +291,8 @@ discard block |
||
| 291 | 291 | }); |
| 292 | 292 | |
| 293 | 293 | // Check to make sure Order::EVENT_AFTER_REMOVE_LINE_ITEM is defined |
| 294 | - if (defined(Order::class . '::EVENT_AFTER_REMOVE_LINE_ITEM')) { |
|
| 295 | - Event::on(Order::class, Order::EVENT_AFTER_REMOVE_LINE_ITEM, function (LineItemEvent $e) { |
|
| 294 | + if (defined(Order::class.'::EVENT_AFTER_REMOVE_LINE_ITEM')) { |
|
| 295 | + Event::on(Order::class, Order::EVENT_AFTER_REMOVE_LINE_ITEM, function(LineItemEvent $e) { |
|
| 296 | 296 | $lineItem = $e->lineItem; |
| 297 | 297 | if (self::$settings->autoSendRemoveFromCart) { |
| 298 | 298 | $this->commerce->removeFromCart($lineItem->order, $lineItem); |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | const ASSET_CLASS = InstantAnalyticsAsset::class; |
| 36 | 36 | |
| 37 | - const CACHE_KEY = 'twigpack-' . self::ASSET_CLASS; |
|
| 38 | - const CACHE_TAG = 'twigpack-' . self::ASSET_CLASS; |
|
| 37 | + const CACHE_KEY = 'twigpack-'.self::ASSET_CLASS; |
|
| 38 | + const CACHE_TAG = 'twigpack-'.self::ASSET_CLASS; |
|
| 39 | 39 | |
| 40 | 40 | const DEVMODE_CACHE_DURATION = 1; |
| 41 | 41 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | self::$config['server']['publicPath'] = $baseAssetsUrl; |
| 103 | 103 | $useDevServer = getenv('NYS_PLUGIN_DEVSERVER'); |
| 104 | 104 | if ($useDevServer !== false) { |
| 105 | - self::$config['useDevServer'] = (bool)$useDevServer; |
|
| 105 | + self::$config['useDevServer'] = (bool) $useDevServer; |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | public static function registerJsModules(array $modules) |
| 117 | 117 | { |
| 118 | 118 | $view = Craft::$app->getView(); |
| 119 | - foreach($modules as $module) { |
|
| 119 | + foreach ($modules as $module) { |
|
| 120 | 120 | $jsModule = self::getModule(self::$config, $module, 'modern'); |
| 121 | 121 | if ($jsModule) { |
| 122 | 122 | $view->registerJsFile($jsModule, [ |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | public static function registerCssModules(array $modules) |
| 137 | 137 | { |
| 138 | 138 | $view = Craft::$app->getView(); |
| 139 | - foreach($modules as $module) { |
|
| 139 | + foreach ($modules as $module) { |
|
| 140 | 140 | $cssModule = self::getModule(self::$config, $module, 'legacy'); |
| 141 | 141 | if ($cssModule) { |
| 142 | 142 | $view->registerCssFile($cssModule, [ |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | // Resolve any aliases |
| 306 | 306 | $alias = Craft::getAlias($path, false); |
| 307 | 307 | if ($alias) { |
| 308 | - $path = (string)$alias; |
|
| 308 | + $path = (string) $alias; |
|
| 309 | 309 | } |
| 310 | 310 | // Make sure it's a full URL |
| 311 | 311 | if (!UrlHelper::isAbsoluteUrl($path) && !is_file($path)) { |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | $cache = Craft::$app->getCache(); |
| 349 | 349 | $file = $cache->getOrSet( |
| 350 | 350 | self::CACHE_KEY.$path, |
| 351 | - function () use ($path, $callback) { |
|
| 351 | + function() use ($path, $callback) { |
|
| 352 | 352 | $result = null; |
| 353 | 353 | $contents = @file_get_contents($path); |
| 354 | 354 | if ($contents) { |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | protected static function combinePaths(string ...$paths): string |
| 379 | 379 | { |
| 380 | 380 | $last_key = count($paths) - 1; |
| 381 | - array_walk($paths, function (&$val, $key) use ($last_key) { |
|
| 381 | + array_walk($paths, function(&$val, $key) use ($last_key) { |
|
| 382 | 382 | switch ($key) { |
| 383 | 383 | case 0: |
| 384 | 384 | $val = rtrim($val, '/ '); |