@@ -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( |
@@ -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 |
@@ -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); |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | |
293 | 293 | // Check to make sure Order::EVENT_AFTER_REMOVE_LINE_ITEM is defined |
294 | 294 | if (defined('Order::EVENT_AFTER_REMOVE_LINE_ITEM')) { |
295 | - Event::on(Order::class, Order::EVENT_AFTER_REMOVE_LINE_ITEM, function (LineItemEvent $e) { |
|
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); |