@@ -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( |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | { |
98 | 98 | if (InstantAnalytics::$commercePlugin) { |
99 | 99 | if ($productVariant) { |
100 | - InstantAnalytics::$plugin->commerce->addCommerceProductDetailView($this, $productVariant); |
|
100 | + InstantAnalytics::$plugin->commerce->addCommerceProductDetailView($this, $productVariant); |
|
101 | 101 | } |
102 | 102 | } else { |
103 | 103 | Craft::warning( |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | { |
122 | 122 | if (InstantAnalytics::$commercePlugin) { |
123 | 123 | if ($orderModel) { |
124 | - InstantAnalytics::$plugin->commerce->addCommerceCheckoutStep($this, $orderModel, $step, $option); |
|
124 | + InstantAnalytics::$plugin->commerce->addCommerceCheckoutStep($this, $orderModel, $step, $option); |
|
125 | 125 | } |
126 | 126 | } else { |
127 | 127 | Craft::warning( |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | Event::on( |
193 | 193 | CraftVariable::class, |
194 | 194 | CraftVariable::EVENT_INIT, |
195 | - function (Event $event) { |
|
195 | + function(Event $event) { |
|
196 | 196 | /** @var CraftVariable $variable */ |
197 | 197 | $variable = $event->sender; |
198 | 198 | $variable->set('instantAnalytics', InstantAnalyticsVariable::class); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | Event::on( |
210 | 210 | Plugins::class, |
211 | 211 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
212 | - function (PluginEvent $event) { |
|
212 | + function(PluginEvent $event) { |
|
213 | 213 | if ($event->plugin === $this) { |
214 | 214 | $request = Craft::$app->getRequest(); |
215 | 215 | if ($request->isCpRequest) { |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | Event::on( |
239 | 239 | UrlManager::class, |
240 | 240 | UrlManager::EVENT_REGISTER_SITE_URL_RULES, |
241 | - function (RegisterUrlRulesEvent $event) { |
|
241 | + function(RegisterUrlRulesEvent $event) { |
|
242 | 242 | Craft::debug( |
243 | 243 | 'UrlManager::EVENT_REGISTER_SITE_URL_RULES', |
244 | 244 | __METHOD__ |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | Event::on( |
255 | 255 | View::class, |
256 | 256 | View::EVENT_BEFORE_RENDER_PAGE_TEMPLATE, |
257 | - function (TemplateEvent $event) { |
|
257 | + function(TemplateEvent $event) { |
|
258 | 258 | self::$currentTemplate = $event->template; |
259 | 259 | } |
260 | 260 | ); |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | Event::on( |
263 | 263 | View::class, |
264 | 264 | View::EVENT_AFTER_RENDER_PAGE_TEMPLATE, |
265 | - function (TemplateEvent $event) { |
|
265 | + function(TemplateEvent $event) { |
|
266 | 266 | if (self::$settings->autoSendPageView) { |
267 | 267 | $this->sendPageView(); |
268 | 268 | } |
@@ -270,14 +270,14 @@ discard block |
||
270 | 270 | ); |
271 | 271 | // Commerce-specific hooks |
272 | 272 | if (self::$commercePlugin) { |
273 | - Event::on(Order::class, Order::EVENT_AFTER_COMPLETE_ORDER, function (Event $e) { |
|
273 | + Event::on(Order::class, Order::EVENT_AFTER_COMPLETE_ORDER, function(Event $e) { |
|
274 | 274 | $order = $e->sender; |
275 | 275 | if (self::$settings->autoSendPurchaseComplete) { |
276 | 276 | $this->commerce->orderComplete($order); |
277 | 277 | } |
278 | 278 | }); |
279 | 279 | |
280 | - Event::on(Order::class, Order::EVENT_AFTER_ADD_LINE_ITEM, function (LineItemEvent $e) { |
|
280 | + Event::on(Order::class, Order::EVENT_AFTER_ADD_LINE_ITEM, function(LineItemEvent $e) { |
|
281 | 281 | $lineItem = $e->lineItem; |
282 | 282 | if (self::$settings->autoSendAddToCart) { |
283 | 283 | $this->commerce->addToCart($lineItem->order, $lineItem); |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | |
287 | 287 | // Check to make sure Order::EVENT_AFTER_REMOVE_LINE_ITEM is defined |
288 | 288 | if (\defined('Order::EVENT_AFTER_REMOVE_LINE_ITEM')) { |
289 | - Event::on(Order::class, Order::EVENT_AFTER_REMOVE_LINE_ITEM, function (LineItemEvent $e) { |
|
289 | + Event::on(Order::class, Order::EVENT_AFTER_REMOVE_LINE_ITEM, function(LineItemEvent $e) { |
|
290 | 290 | $lineItem = $e->lineItem; |
291 | 291 | if (self::$settings->autoSendRemoveFromCart) { |
292 | 292 | $this->commerce->removeFromCart($lineItem->order, $lineItem); |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $cache = Craft::$app->getCache(); |
404 | 404 | $file = $cache->getOrSet( |
405 | 405 | self::CACHE_KEY.$path, |
406 | - function () use ($path, $callback) { |
|
406 | + function() use ($path, $callback) { |
|
407 | 407 | $result = null; |
408 | 408 | $contents = @file_get_contents($path); |
409 | 409 | if ($contents) { |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | protected static function combinePaths(string ...$paths): string |
434 | 434 | { |
435 | 435 | $last_key = \count($paths) - 1; |
436 | - array_walk($paths, function (&$val, $key) use ($last_key) { |
|
436 | + array_walk($paths, function(&$val, $key) use ($last_key) { |
|
437 | 437 | switch ($key) { |
438 | 438 | case 0: |
439 | 439 | $val = rtrim($val, '/ '); |
@@ -51,7 +51,7 @@ |
||
51 | 51 | self::$config['server']['publicPath'] = $baseAssetsUrl; |
52 | 52 | $useDevServer = getenv('NYS_PLUGIN_DEVSERVER'); |
53 | 53 | if ($useDevServer !== false) { |
54 | - self::$config['useDevServer'] = (bool)$useDevServer; |
|
54 | + self::$config['useDevServer'] = (bool) $useDevServer; |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 |