Completed
Pull Request — master (#33)
by Aivis
01:38
created
src/config/understand-laravel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     /**
24 24
      * Project root folder
25 25
      */
26
-    'project_root' => base_path() . DIRECTORY_SEPARATOR,
26
+    'project_root' => base_path().DIRECTORY_SEPARATOR,
27 27
 
28 28
     /**
29 29
      * Collect SQL queries
Please login to merge, or discard this patch.
src/Understand/UnderstandLaravel5/FieldProvider.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
      */
233 233
     protected function getSessionId()
234 234
     {
235
-        if ( ! $this->session)
235
+        if (!$this->session)
236 236
         {
237 237
             return null;
238 238
         }
@@ -258,21 +258,21 @@  discard block
 block discarded – undo
258 258
      */
259 259
     protected function getSqlQueries()
260 260
     {
261
-        if ( ! $this->dataCollector)
261
+        if (!$this->dataCollector)
262 262
         {
263 263
             return [];
264 264
         }
265 265
 
266 266
         $queries = $this->dataCollector->getByKey('sql_queries');
267 267
 
268
-        if ( ! $queries)
268
+        if (!$queries)
269 269
         {
270 270
             return null;
271 271
         }
272 272
 
273 273
         $bindingsEnabled = $this->app['config']->get('understand-laravel.sql_bindings');
274 274
 
275
-        foreach($queries as $key => $queryArray)
275
+        foreach ($queries as $key => $queryArray)
276 276
         {
277 277
             if ($bindingsEnabled)
278 278
             {
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
         $sqlQuery = $queryArray['query'];
295 295
         $placeholder = '?';
296 296
 
297
-        foreach($queryArray['bindings'] as $key => $value)
297
+        foreach ($queryArray['bindings'] as $key => $value)
298 298
         {
299 299
             if ($value instanceof \DateTimeInterface)
300 300
             {
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
      */
328 328
     protected function getRouteName()
329 329
     {
330
-        if ( ! $this->router)
330
+        if (!$this->router)
331 331
         {
332 332
             return null;
333 333
         }
@@ -342,16 +342,16 @@  discard block
 block discarded – undo
342 342
      */
343 343
     protected function getUrl()
344 344
     {
345
-        if ( ! $this->request)
345
+        if (!$this->request)
346 346
         {
347 347
             return null;
348 348
         }
349 349
 
350 350
         $url = $this->request->path();
351 351
 
352
-        if ( ! starts_with($url, '/'))
352
+        if (!starts_with($url, '/'))
353 353
         {
354
-            $url = '/' . $url;
354
+            $url = '/'.$url;
355 355
         }
356 356
 
357 357
         return $url;
@@ -364,19 +364,19 @@  discard block
 block discarded – undo
364 364
     {
365 365
         $enabled = $this->app['config']->get('understand-laravel.query_string_enabled');
366 366
 
367
-        if ( ! $enabled)
367
+        if (!$enabled)
368 368
         {
369 369
             return null;
370 370
         }
371 371
 
372
-        if ( ! $this->request->query instanceof \IteratorAggregate)
372
+        if (!$this->request->query instanceof \IteratorAggregate)
373 373
         {
374 374
             return null;
375 375
         }
376 376
 
377 377
         $queryString = [];
378 378
 
379
-        foreach($this->request->query as $key => $value)
379
+        foreach ($this->request->query as $key => $value)
380 380
         {
381 381
             try
382 382
             {
@@ -398,19 +398,19 @@  discard block
 block discarded – undo
398 398
     {
399 399
         $enabled = $this->app['config']->get('understand-laravel.post_data_enabled');
400 400
 
401
-        if ( ! $enabled)
401
+        if (!$enabled)
402 402
         {
403 403
             return null;
404 404
         }
405 405
 
406
-        if ( ! $this->request->request instanceof \IteratorAggregate)
406
+        if (!$this->request->request instanceof \IteratorAggregate)
407 407
         {
408 408
             return null;
409 409
         }
410 410
 
411 411
         $postData = [];
412 412
 
413
-        foreach($this->request->request as $key => $value)
413
+        foreach ($this->request->request as $key => $value)
414 414
         {
415 415
             try
416 416
             {
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
             return get_class($value);
455 455
         }
456 456
 
457
-        return (string)$value;
457
+        return (string) $value;
458 458
     }
459 459
 
460 460
     /**
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
      */
465 465
     protected function getRequestMethod()
466 466
     {
467
-        if ( ! $this->request)
467
+        if (!$this->request)
468 468
         {
469 469
             return null;
470 470
         }
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
      */
480 480
     protected function getServerIp()
481 481
     {
482
-        if ( ! $this->request)
482
+        if (!$this->request)
483 483
         {
484 484
             return null;
485 485
         }
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
      */
495 495
     protected function getClientIp()
496 496
     {
497
-        if ( ! $this->request)
497
+        if (!$this->request)
498 498
         {
499 499
             return null;
500 500
         }
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
      */
510 510
     protected function getClientUserAgent()
511 511
     {
512
-        if ( ! $this->request)
512
+        if (!$this->request)
513 513
         {
514 514
             return null;
515 515
         }
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
      */
536 536
     protected function getFromSession($key)
537 537
     {
538
-        if ( ! $this->session)
538
+        if (!$this->session)
539 539
         {
540 540
             return null;
541 541
         }
@@ -553,9 +553,9 @@  discard block
 block discarded – undo
553 553
     {
554 554
         $parts = [];
555 555
 
556
-        foreach(['class', 'file', 'line'] as $field)
556
+        foreach (['class', 'file', 'line'] as $field)
557 557
         {
558
-            $parts[] = isset($log[$field]) ? (string)$log[$field] : null;
558
+            $parts[] = isset($log[$field]) ? (string) $log[$field] : null;
559 559
         }
560 560
 
561 561
         return sha1(implode('#', $parts));
Please login to merge, or discard this patch.
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -299,12 +299,10 @@  discard block
 block discarded – undo
299 299
             if ($value instanceof \DateTimeInterface)
300 300
             {
301 301
                 $binding = $value->format('Y-m-d H:i:s');
302
-            }
303
-            elseif (is_bool($value))
302
+            } elseif (is_bool($value))
304 303
             {
305 304
                 $binding = (int) $value;
306
-            }
307
-            else
305
+            } else
308 306
             {
309 307
                 $binding = $value;
310 308
             }
@@ -381,8 +379,7 @@  discard block
 block discarded – undo
381 379
             try
382 380
             {
383 381
                 $queryString[$key] = $this->parseRequestFieldValue($key, $value);
384
-            }
385
-            catch (\Exception $e)
382
+            } catch (\Exception $e)
386 383
             {
387 384
                 $queryString[$key] = '[handler error]';
388 385
             }
@@ -415,8 +412,7 @@  discard block
 block discarded – undo
415 412
             try
416 413
             {
417 414
                 $postData[$key] = $this->parseRequestFieldValue($key, $value);
418
-            }
419
-            catch (\Exception $e)
415
+            } catch (\Exception $e)
420 416
             {
421 417
                 $postData[$key] = '[handler error]';
422 418
             }
@@ -574,10 +570,8 @@  discard block
 block discarded – undo
574 570
             {
575 571
                 return $userId;
576 572
             }
577
-        }
578
-        catch (\Throwable $e)
579
-        {}
580
-        catch (\Exception $e)
573
+        } catch (\Throwable $e)
574
+        {} catch (\Exception $e)
581 575
         {}
582 576
 
583 577
         try
@@ -586,10 +580,8 @@  discard block
 block discarded – undo
586 580
             {
587 581
                 return $user->id;
588 582
             }
589
-        }
590
-        catch (\Throwable $e)
591
-        {}
592
-        catch (\Exception $e)
583
+        } catch (\Throwable $e)
584
+        {} catch (\Exception $e)
593 585
         {}
594 586
 
595 587
         try
@@ -598,10 +590,8 @@  discard block
 block discarded – undo
598 590
             {
599 591
                 return $user->id;
600 592
             }
601
-        }
602
-        catch (\Throwable $e)
603
-        {}
604
-        catch (\Exception $e)
593
+        } catch (\Throwable $e)
594
+        {} catch (\Exception $e)
605 595
         {}
606 596
     }
607 597
 
Please login to merge, or discard this patch.