Passed
Pull Request — v1 (#46)
by
unknown
06:59
created
src/helpers/Field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/helpers/Manifest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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, '/ ');
Please login to merge, or discard this patch.
src/variables/ManifestVariable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/services/IA.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/helpers/IAnalytics.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
src/InstantAnalytics.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.