@@ -232,7 +232,7 @@ discard block |
||
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 |
||
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 |
||
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 | try |
300 | 300 | { |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | } |
309 | 309 | else |
310 | 310 | { |
311 | - $binding = (string)$value; |
|
311 | + $binding = (string) $value; |
|
312 | 312 | } |
313 | 313 | } |
314 | 314 | catch (\Exception $e) |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | */ |
335 | 335 | protected function getRouteName() |
336 | 336 | { |
337 | - if ( ! $this->router) |
|
337 | + if (!$this->router) |
|
338 | 338 | { |
339 | 339 | return null; |
340 | 340 | } |
@@ -349,16 +349,16 @@ discard block |
||
349 | 349 | */ |
350 | 350 | protected function getUrl() |
351 | 351 | { |
352 | - if ( ! $this->request) |
|
352 | + if (!$this->request) |
|
353 | 353 | { |
354 | 354 | return null; |
355 | 355 | } |
356 | 356 | |
357 | 357 | $url = $this->request->path(); |
358 | 358 | |
359 | - if ( ! starts_with($url, '/')) |
|
359 | + if (!starts_with($url, '/')) |
|
360 | 360 | { |
361 | - $url = '/' . $url; |
|
361 | + $url = '/'.$url; |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | return $url; |
@@ -371,19 +371,19 @@ discard block |
||
371 | 371 | { |
372 | 372 | $enabled = $this->app['config']->get('understand-laravel.query_string_enabled'); |
373 | 373 | |
374 | - if ( ! $enabled) |
|
374 | + if (!$enabled) |
|
375 | 375 | { |
376 | 376 | return null; |
377 | 377 | } |
378 | 378 | |
379 | - if ( ! $this->request->query instanceof \IteratorAggregate) |
|
379 | + if (!$this->request->query instanceof \IteratorAggregate) |
|
380 | 380 | { |
381 | 381 | return null; |
382 | 382 | } |
383 | 383 | |
384 | 384 | $queryString = []; |
385 | 385 | |
386 | - foreach($this->request->query as $key => $value) |
|
386 | + foreach ($this->request->query as $key => $value) |
|
387 | 387 | { |
388 | 388 | try |
389 | 389 | { |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | { |
406 | 406 | $enabled = $this->app['config']->get('understand-laravel.post_data_enabled'); |
407 | 407 | |
408 | - if ( ! $enabled) |
|
408 | + if (!$enabled) |
|
409 | 409 | { |
410 | 410 | return null; |
411 | 411 | } |
@@ -432,14 +432,14 @@ discard block |
||
432 | 432 | return; |
433 | 433 | } |
434 | 434 | |
435 | - if ( ! $source) |
|
435 | + if (!$source) |
|
436 | 436 | { |
437 | 437 | return; |
438 | 438 | } |
439 | 439 | |
440 | 440 | $postData = []; |
441 | 441 | |
442 | - foreach($source as $key => $value) |
|
442 | + foreach ($source as $key => $value) |
|
443 | 443 | { |
444 | 444 | try |
445 | 445 | { |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | return get_class($value); |
484 | 484 | } |
485 | 485 | |
486 | - return (string)$value; |
|
486 | + return (string) $value; |
|
487 | 487 | } |
488 | 488 | |
489 | 489 | /** |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | */ |
494 | 494 | protected function getRequestMethod() |
495 | 495 | { |
496 | - if ( ! $this->request) |
|
496 | + if (!$this->request) |
|
497 | 497 | { |
498 | 498 | return null; |
499 | 499 | } |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | */ |
509 | 509 | protected function getServerIp() |
510 | 510 | { |
511 | - if ( ! $this->request) |
|
511 | + if (!$this->request) |
|
512 | 512 | { |
513 | 513 | return null; |
514 | 514 | } |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | */ |
524 | 524 | protected function getClientIp() |
525 | 525 | { |
526 | - if ( ! $this->request) |
|
526 | + if (!$this->request) |
|
527 | 527 | { |
528 | 528 | return null; |
529 | 529 | } |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | */ |
539 | 539 | protected function getClientUserAgent() |
540 | 540 | { |
541 | - if ( ! $this->request) |
|
541 | + if (!$this->request) |
|
542 | 542 | { |
543 | 543 | return null; |
544 | 544 | } |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | */ |
565 | 565 | protected function getFromSession($key) |
566 | 566 | { |
567 | - if ( ! $this->session) |
|
567 | + if (!$this->session) |
|
568 | 568 | { |
569 | 569 | return null; |
570 | 570 | } |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | { |
583 | 583 | $parts = []; |
584 | 584 | |
585 | - foreach(['class', 'file', 'line', 'code'] as $field) |
|
585 | + foreach (['class', 'file', 'line', 'code'] as $field) |
|
586 | 586 | { |
587 | 587 | // only include `code` if it's not null value |
588 | 588 | // the `code` attribute of the exception object is useful to differentiate SQL and other exceptions |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | continue; |
596 | 596 | } |
597 | 597 | |
598 | - $parts[] = isset($log[$field]) ? (string)$log[$field] : null; |
|
598 | + $parts[] = isset($log[$field]) ? (string) $log[$field] : null; |
|
599 | 599 | } |
600 | 600 | |
601 | 601 | return sha1(implode('#', $parts)); |
@@ -301,17 +301,14 @@ discard block |
||
301 | 301 | if ($value instanceof \DateTimeInterface) |
302 | 302 | { |
303 | 303 | $binding = $value->format('Y-m-d H:i:s'); |
304 | - } |
|
305 | - elseif (is_bool($value)) |
|
304 | + } elseif (is_bool($value)) |
|
306 | 305 | { |
307 | 306 | $binding = (int) $value; |
308 | - } |
|
309 | - else |
|
307 | + } else |
|
310 | 308 | { |
311 | 309 | $binding = (string)$value; |
312 | 310 | } |
313 | - } |
|
314 | - catch (\Exception $e) |
|
311 | + } catch (\Exception $e) |
|
315 | 312 | { |
316 | 313 | $binding = '[handler error]'; |
317 | 314 | } |
@@ -388,8 +385,7 @@ discard block |
||
388 | 385 | try |
389 | 386 | { |
390 | 387 | $queryString[$key] = $this->parseRequestFieldValue($key, $value); |
391 | - } |
|
392 | - catch (\Exception $e) |
|
388 | + } catch (\Exception $e) |
|
393 | 389 | { |
394 | 390 | $queryString[$key] = '[handler error]'; |
395 | 391 | } |
@@ -422,12 +418,10 @@ discard block |
||
422 | 418 | if (method_exists($this->request, 'json') && method_exists($this->request, 'isJson') && $this->request->isJson()) |
423 | 419 | { |
424 | 420 | $source = $this->request->json(); |
425 | - } |
|
426 | - else if ($this->request->request instanceof \IteratorAggregate) |
|
421 | + } else if ($this->request->request instanceof \IteratorAggregate) |
|
427 | 422 | { |
428 | 423 | $source = $this->request->request; |
429 | - } |
|
430 | - else |
|
424 | + } else |
|
431 | 425 | { |
432 | 426 | return; |
433 | 427 | } |
@@ -444,8 +438,7 @@ discard block |
||
444 | 438 | try |
445 | 439 | { |
446 | 440 | $postData[$key] = $this->parseRequestFieldValue($key, $value); |
447 | - } |
|
448 | - catch (\Exception $e) |
|
441 | + } catch (\Exception $e) |
|
449 | 442 | { |
450 | 443 | $postData[$key] = '[handler error]'; |
451 | 444 | } |
@@ -614,10 +607,8 @@ discard block |
||
614 | 607 | { |
615 | 608 | return $userId; |
616 | 609 | } |
617 | - } |
|
618 | - catch (\Throwable $e) |
|
619 | - {} |
|
620 | - catch (\Exception $e) |
|
610 | + } catch (\Throwable $e) |
|
611 | + {} catch (\Exception $e) |
|
621 | 612 | {} |
622 | 613 | |
623 | 614 | try |
@@ -626,10 +617,8 @@ discard block |
||
626 | 617 | { |
627 | 618 | return $user->id; |
628 | 619 | } |
629 | - } |
|
630 | - catch (\Throwable $e) |
|
631 | - {} |
|
632 | - catch (\Exception $e) |
|
620 | + } catch (\Throwable $e) |
|
621 | + {} catch (\Exception $e) |
|
633 | 622 | {} |
634 | 623 | |
635 | 624 | try |
@@ -638,10 +627,8 @@ discard block |
||
638 | 627 | { |
639 | 628 | return $user->id; |
640 | 629 | } |
641 | - } |
|
642 | - catch (\Throwable $e) |
|
643 | - {} |
|
644 | - catch (\Exception $e) |
|
630 | + } catch (\Throwable $e) |
|
631 | + {} catch (\Exception $e) |
|
645 | 632 | {} |
646 | 633 | } |
647 | 634 |