@@ -90,8 +90,7 @@ |
||
| 90 | 90 | ]; |
| 91 | 91 | |
| 92 | 92 | $log = $this->encoder->setCurrentStackTrace($log); |
| 93 | - } |
|
| 94 | - else |
|
| 93 | + } else |
|
| 95 | 94 | { |
| 96 | 95 | $log = (array)$message; |
| 97 | 96 | $log = $this->encoder->setCurrentStackTrace($log); |
@@ -45,8 +45,7 @@ |
||
| 45 | 45 | $log = [ |
| 46 | 46 | 'message' => $message |
| 47 | 47 | ]; |
| 48 | - } |
|
| 49 | - else |
|
| 48 | + } else |
|
| 50 | 49 | { |
| 51 | 50 | $log = (array)$message; |
| 52 | 51 | } |
@@ -152,12 +152,10 @@ |
||
| 152 | 152 | try |
| 153 | 153 | { |
| 154 | 154 | return $this->handler->handle($event); |
| 155 | - } |
|
| 156 | - catch (\Throwable $e) |
|
| 155 | + } catch (\Throwable $e) |
|
| 157 | 156 | { |
| 158 | 157 | return false; |
| 159 | - } |
|
| 160 | - catch (\Exception $ex) |
|
| 158 | + } catch (\Exception $ex) |
|
| 161 | 159 | { |
| 162 | 160 | return false; |
| 163 | 161 | } |
@@ -120,8 +120,7 @@ discard block |
||
| 120 | 120 | if (strpos($trace['file'], $this->projectRoot . 'vendor' . DIRECTORY_SEPARATOR) === 0) |
| 121 | 121 | { |
| 122 | 122 | unset($stackTrace[$index]); |
| 123 | - } |
|
| 124 | - else |
|
| 123 | + } else |
|
| 125 | 124 | { |
| 126 | 125 | $vendorExcluded = true; |
| 127 | 126 | } |
@@ -215,10 +214,8 @@ discard block |
||
| 215 | 214 | } |
| 216 | 215 | |
| 217 | 216 | return $codeLines; |
| 218 | - } |
|
| 219 | - catch (\Throwable $e) |
|
| 220 | - {} |
|
| 221 | - catch (\Exception $e) |
|
| 217 | + } catch (\Throwable $e) |
|
| 218 | + {} catch (\Exception $e) |
|
| 222 | 219 | {} |
| 223 | 220 | } |
| 224 | 221 | |
@@ -294,32 +291,25 @@ discard block |
||
| 294 | 291 | if (is_array($arg)) |
| 295 | 292 | { |
| 296 | 293 | $params[] = 'array(' . count($arg) . ')'; |
| 297 | - } |
|
| 298 | - else if (is_object($arg)) |
|
| 294 | + } else if (is_object($arg)) |
|
| 299 | 295 | { |
| 300 | 296 | $params[] = get_class($arg); |
| 301 | - } |
|
| 302 | - else if (is_string($arg)) |
|
| 297 | + } else if (is_string($arg)) |
|
| 303 | 298 | { |
| 304 | 299 | $params[] = 'string(' . $arg . ')'; |
| 305 | - } |
|
| 306 | - else if (is_int($arg)) |
|
| 300 | + } else if (is_int($arg)) |
|
| 307 | 301 | { |
| 308 | 302 | $params[] = 'int(' . $arg . ')'; |
| 309 | - } |
|
| 310 | - else if (is_float($arg)) |
|
| 303 | + } else if (is_float($arg)) |
|
| 311 | 304 | { |
| 312 | 305 | $params[] = 'float(' . $arg . ')'; |
| 313 | - } |
|
| 314 | - else if (is_bool($arg)) |
|
| 306 | + } else if (is_bool($arg)) |
|
| 315 | 307 | { |
| 316 | 308 | $params[] = 'bool(' . ($arg ? 'true' : 'false') . ')'; |
| 317 | - } |
|
| 318 | - else if ($arg instanceof \__PHP_Incomplete_Class) |
|
| 309 | + } else if ($arg instanceof \__PHP_Incomplete_Class) |
|
| 319 | 310 | { |
| 320 | 311 | $params[] = 'object(__PHP_Incomplete_Class)'; |
| 321 | - } |
|
| 322 | - else |
|
| 312 | + } else |
|
| 323 | 313 | { |
| 324 | 314 | $params[] = gettype($arg); |
| 325 | 315 | } |
@@ -237,8 +237,7 @@ discard block |
||
| 237 | 237 | { |
| 238 | 238 | $this->handleEvent($level, $message, $context); |
| 239 | 239 | }); |
| 240 | - } |
|
| 241 | - else |
|
| 240 | + } else |
|
| 242 | 241 | { |
| 243 | 242 | // starting from L5.4 MessageLogged event class was introduced |
| 244 | 243 | // https://github.com/laravel/framework/commit/57c82d095c356a0fe0f9381536afec768cdcc072 |
@@ -266,8 +265,7 @@ discard block |
||
| 266 | 265 | $this->app['understand.tokenProvider']->generate(); |
| 267 | 266 | $this->app['understand.dataCollector']->reset(); |
| 268 | 267 | }); |
| 269 | - } |
|
| 270 | - else |
|
| 268 | + } else |
|
| 271 | 269 | { |
| 272 | 270 | $this->app['events']->listen('Illuminate\Queue\Events\JobProcessing', function() |
| 273 | 271 | { |
@@ -297,8 +295,7 @@ discard block |
||
| 297 | 295 | 'time' => $time, |
| 298 | 296 | ]); |
| 299 | 297 | }); |
| 300 | - } |
|
| 301 | - else |
|
| 298 | + } else |
|
| 302 | 299 | { |
| 303 | 300 | // https://laravel.com/api/5.3/Illuminate/Database/Events/QueryExecuted.html |
| 304 | 301 | $this->app['events']->listen('Illuminate\Database\Events\QueryExecuted', function($event) |
@@ -340,8 +337,7 @@ discard block |
||
| 340 | 337 | unset($context['exception']); |
| 341 | 338 | |
| 342 | 339 | $this->app['understand.exceptionLogger']->logError($level, $exception, $context); |
| 343 | - } |
|
| 344 | - else |
|
| 340 | + } else |
|
| 345 | 341 | { |
| 346 | 342 | $this->app['understand.exceptionLogger']->logError($level, $message, $context); |
| 347 | 343 | } |
@@ -266,8 +266,7 @@ discard block |
||
| 266 | 266 | { |
| 267 | 267 | // Laravel |
| 268 | 268 | return Application::VERSION; |
| 269 | - } |
|
| 270 | - else |
|
| 269 | + } else |
|
| 271 | 270 | { |
| 272 | 271 | $re = '/Lumen \((.*)\) \(.*\)/m'; |
| 273 | 272 | |
@@ -327,17 +326,14 @@ discard block |
||
| 327 | 326 | if ($value instanceof \DateTimeInterface) |
| 328 | 327 | { |
| 329 | 328 | $binding = $value->format('Y-m-d H:i:s'); |
| 330 | - } |
|
| 331 | - elseif (is_bool($value)) |
|
| 329 | + } elseif (is_bool($value)) |
|
| 332 | 330 | { |
| 333 | 331 | $binding = (int) $value; |
| 334 | - } |
|
| 335 | - else |
|
| 332 | + } else |
|
| 336 | 333 | { |
| 337 | 334 | $binding = (string)$value; |
| 338 | 335 | } |
| 339 | - } |
|
| 340 | - catch (\Exception $e) |
|
| 336 | + } catch (\Exception $e) |
|
| 341 | 337 | { |
| 342 | 338 | $binding = '[handler error]'; |
| 343 | 339 | } |
@@ -414,8 +410,7 @@ discard block |
||
| 414 | 410 | try |
| 415 | 411 | { |
| 416 | 412 | $queryString[$key] = $this->parseRequestFieldValue($key, $value); |
| 417 | - } |
|
| 418 | - catch (\Exception $e) |
|
| 413 | + } catch (\Exception $e) |
|
| 419 | 414 | { |
| 420 | 415 | $queryString[$key] = '[handler error]'; |
| 421 | 416 | } |
@@ -448,12 +443,10 @@ discard block |
||
| 448 | 443 | if (method_exists($this->request, 'json') && method_exists($this->request, 'isJson') && $this->request->isJson()) |
| 449 | 444 | { |
| 450 | 445 | $source = $this->request->json(); |
| 451 | - } |
|
| 452 | - else if ($this->request->request instanceof \IteratorAggregate) |
|
| 446 | + } else if ($this->request->request instanceof \IteratorAggregate) |
|
| 453 | 447 | { |
| 454 | 448 | $source = $this->request->request; |
| 455 | - } |
|
| 456 | - else |
|
| 449 | + } else |
|
| 457 | 450 | { |
| 458 | 451 | return; |
| 459 | 452 | } |
@@ -470,8 +463,7 @@ discard block |
||
| 470 | 463 | try |
| 471 | 464 | { |
| 472 | 465 | $postData[$key] = $this->parseRequestFieldValue($key, $value); |
| 473 | - } |
|
| 474 | - catch (\Exception $e) |
|
| 466 | + } catch (\Exception $e) |
|
| 475 | 467 | { |
| 476 | 468 | $postData[$key] = '[handler error]'; |
| 477 | 469 | } |
@@ -640,10 +632,8 @@ discard block |
||
| 640 | 632 | { |
| 641 | 633 | return $userId; |
| 642 | 634 | } |
| 643 | - } |
|
| 644 | - catch (\Throwable $e) |
|
| 645 | - {} |
|
| 646 | - catch (\Exception $e) |
|
| 635 | + } catch (\Throwable $e) |
|
| 636 | + {} catch (\Exception $e) |
|
| 647 | 637 | {} |
| 648 | 638 | |
| 649 | 639 | try |
@@ -652,10 +642,8 @@ discard block |
||
| 652 | 642 | { |
| 653 | 643 | return $user->id; |
| 654 | 644 | } |
| 655 | - } |
|
| 656 | - catch (\Throwable $e) |
|
| 657 | - {} |
|
| 658 | - catch (\Exception $e) |
|
| 645 | + } catch (\Throwable $e) |
|
| 646 | + {} catch (\Exception $e) |
|
| 659 | 647 | {} |
| 660 | 648 | |
| 661 | 649 | try |
@@ -664,10 +652,8 @@ discard block |
||
| 664 | 652 | { |
| 665 | 653 | return $user->id; |
| 666 | 654 | } |
| 667 | - } |
|
| 668 | - catch (\Throwable $e) |
|
| 669 | - {} |
|
| 670 | - catch (\Exception $e) |
|
| 655 | + } catch (\Throwable $e) |
|
| 656 | + {} catch (\Exception $e) |
|
| 671 | 657 | {} |
| 672 | 658 | } |
| 673 | 659 | |
@@ -161,8 +161,7 @@ discard block |
||
| 161 | 161 | { |
| 162 | 162 | $this->handleEvent($log['level'], $log['message'], $log['context']); |
| 163 | 163 | }); |
| 164 | - } |
|
| 165 | - else |
|
| 164 | + } else |
|
| 166 | 165 | { |
| 167 | 166 | // starting from Lumen 5.6 MessageLogged event class was introduced |
| 168 | 167 | $this->app['events']->listen('Illuminate\Log\Events\MessageLogged', function ($log) |
@@ -211,8 +210,7 @@ discard block |
||
| 211 | 210 | 'time' => $time, |
| 212 | 211 | ]); |
| 213 | 212 | }); |
| 214 | - } |
|
| 215 | - else |
|
| 213 | + } else |
|
| 216 | 214 | { |
| 217 | 215 | // https://laravel.com/api/5.3/Illuminate/Database/Events/QueryExecuted.html |
| 218 | 216 | $this->app['events']->listen('Illuminate\Database\Events\QueryExecuted', function($event) |
@@ -253,8 +251,7 @@ discard block |
||
| 253 | 251 | unset($context['exception']); |
| 254 | 252 | |
| 255 | 253 | $this->app['understand.exceptionLogger']->logError($level, $exception, $context); |
| 256 | - } |
|
| 257 | - else |
|
| 254 | + } else |
|
| 258 | 255 | { |
| 259 | 256 | $this->app['understand.exceptionLogger']->logError($level, $message, $context); |
| 260 | 257 | } |