@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | protected function getSessionId() |
| 232 | 232 | { |
| 233 | - if ( ! $this->session) |
|
| 233 | + if (!$this->session) |
|
| 234 | 234 | { |
| 235 | 235 | return null; |
| 236 | 236 | } |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | protected function getSqlQueries() |
| 258 | 258 | { |
| 259 | - if ( ! $this->dataCollector) |
|
| 259 | + if (!$this->dataCollector) |
|
| 260 | 260 | { |
| 261 | 261 | return []; |
| 262 | 262 | } |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | */ |
| 277 | 277 | protected function getRouteName() |
| 278 | 278 | { |
| 279 | - if ( ! $this->router) |
|
| 279 | + if (!$this->router) |
|
| 280 | 280 | { |
| 281 | 281 | return null; |
| 282 | 282 | } |
@@ -291,23 +291,23 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | protected function getUrl() |
| 293 | 293 | { |
| 294 | - if ( ! $this->request) |
|
| 294 | + if (!$this->request) |
|
| 295 | 295 | { |
| 296 | 296 | return null; |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | $url = $this->request->path(); |
| 300 | 300 | |
| 301 | - if ( ! starts_with($url, '/')) |
|
| 301 | + if (!starts_with($url, '/')) |
|
| 302 | 302 | { |
| 303 | - $url = '/' . $url; |
|
| 303 | + $url = '/'.$url; |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | $queryString = $this->request->getQueryString(); |
| 307 | 307 | |
| 308 | 308 | if ($queryString) |
| 309 | 309 | { |
| 310 | - $url .= '?' . $queryString; |
|
| 310 | + $url .= '?'.$queryString; |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | return $url; |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | */ |
| 321 | 321 | protected function getRequestMethod() |
| 322 | 322 | { |
| 323 | - if ( ! $this->request) |
|
| 323 | + if (!$this->request) |
|
| 324 | 324 | { |
| 325 | 325 | return null; |
| 326 | 326 | } |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | */ |
| 336 | 336 | protected function getServerIp() |
| 337 | 337 | { |
| 338 | - if ( ! $this->request) |
|
| 338 | + if (!$this->request) |
|
| 339 | 339 | { |
| 340 | 340 | return null; |
| 341 | 341 | } |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | */ |
| 351 | 351 | protected function getClientIp() |
| 352 | 352 | { |
| 353 | - if ( ! $this->request) |
|
| 353 | + if (!$this->request) |
|
| 354 | 354 | { |
| 355 | 355 | return null; |
| 356 | 356 | } |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | */ |
| 366 | 366 | protected function getClientUserAgent() |
| 367 | 367 | { |
| 368 | - if ( ! $this->request) |
|
| 368 | + if (!$this->request) |
|
| 369 | 369 | { |
| 370 | 370 | return null; |
| 371 | 371 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | */ |
| 392 | 392 | protected function getFromSession($key) |
| 393 | 393 | { |
| 394 | - if ( ! $this->session) |
|
| 394 | + if (!$this->session) |
|
| 395 | 395 | { |
| 396 | 396 | return null; |
| 397 | 397 | } |
@@ -409,9 +409,9 @@ discard block |
||
| 409 | 409 | { |
| 410 | 410 | $parts = []; |
| 411 | 411 | |
| 412 | - foreach(['class', 'file', 'line'] as $field) |
|
| 412 | + foreach (['class', 'file', 'line'] as $field) |
|
| 413 | 413 | { |
| 414 | - $parts[] = isset($log[$field]) ? (string)$log[$field] : null; |
|
| 414 | + $parts[] = isset($log[$field]) ? (string) $log[$field] : null; |
|
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | return sha1(implode('#', $parts)); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function exceptionToArray($exception) |
| 44 | 44 | { |
| 45 | - if ( ! ($exception instanceof Exception || $exception instanceof Throwable)) |
|
| 45 | + if (!($exception instanceof Exception || $exception instanceof Throwable)) |
|
| 46 | 46 | { |
| 47 | 47 | throw new InvalidArgumentException('$exception must be instance of Exception or Throwable'); |
| 48 | 48 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $stackTrace = $this->getCurrentStackTrace($level); |
| 72 | 72 | $firstLineSet = false; |
| 73 | 73 | |
| 74 | - foreach($stackTrace as $trace) |
|
| 74 | + foreach ($stackTrace as $trace) |
|
| 75 | 75 | { |
| 76 | 76 | if ($firstLineSet) |
| 77 | 77 | { |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $stackTrace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, $this->stackTraceLimit); |
| 99 | 99 | $vendorExcluded = false; |
| 100 | 100 | |
| 101 | - foreach($stackTrace as $index => $trace) |
|
| 101 | + foreach ($stackTrace as $index => $trace) |
|
| 102 | 102 | { |
| 103 | 103 | // exclude Understand service provider and helper classes |
| 104 | 104 | if (isset($trace['class']) && strpos($trace['class'], 'Understand\UnderstandLaravel5\\') === 0) |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | unset($stackTrace[$index]); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - if ( ! isset($trace['file'])) |
|
| 109 | + if (!isset($trace['file'])) |
|
| 110 | 110 | { |
| 111 | 111 | $vendorExcluded = true; |
| 112 | 112 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | // exclude `vendor` folder until project path reached |
| 120 | - if (strpos($trace['file'], $this->projectRoot . 'vendor' . DIRECTORY_SEPARATOR) === 0) |
|
| 120 | + if (strpos($trace['file'], $this->projectRoot.'vendor'.DIRECTORY_SEPARATOR) === 0) |
|
| 121 | 121 | { |
| 122 | 122 | unset($stackTrace[$index]); |
| 123 | 123 | } |
@@ -185,12 +185,12 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | public function getCode($relativePath, $line, $linesAround = 6) |
| 187 | 187 | { |
| 188 | - if ( ! $relativePath || ! $line) |
|
| 188 | + if (!$relativePath || !$line) |
|
| 189 | 189 | { |
| 190 | 190 | return; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - $filePath = $this->projectRoot . $relativePath; |
|
| 193 | + $filePath = $this->projectRoot.$relativePath; |
|
| 194 | 194 | |
| 195 | 195 | try |
| 196 | 196 | { |
@@ -200,11 +200,11 @@ discard block |
||
| 200 | 200 | $codeLines = []; |
| 201 | 201 | |
| 202 | 202 | $from = max(0, $line - $linesAround - 2); |
| 203 | - $to = min($line + $linesAround -1, $file->key() + 1); |
|
| 203 | + $to = min($line + $linesAround - 1, $file->key() + 1); |
|
| 204 | 204 | |
| 205 | 205 | $file->seek($from); |
| 206 | 206 | |
| 207 | - while ($file->key() < $to && ! $file->eof()) |
|
| 207 | + while ($file->key() < $to && !$file->eof()) |
|
| 208 | 208 | { |
| 209 | 209 | $file->next(); |
| 210 | 210 | // `key()` returns 0 as the first line |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | protected function stackTraceCallToString(array $trace) |
| 258 | 258 | { |
| 259 | - if (! isset($trace['type'])) |
|
| 259 | + if (!isset($trace['type'])) |
|
| 260 | 260 | { |
| 261 | 261 | return 'function'; |
| 262 | 262 | } |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | { |
| 283 | 283 | $params = []; |
| 284 | 284 | |
| 285 | - if (! isset($trace['args'])) |
|
| 285 | + if (!isset($trace['args'])) |
|
| 286 | 286 | { |
| 287 | 287 | return $params; |
| 288 | 288 | } |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | { |
| 292 | 292 | if (is_array($arg)) |
| 293 | 293 | { |
| 294 | - $params[] = 'array(' . count($arg) . ')'; |
|
| 294 | + $params[] = 'array('.count($arg).')'; |
|
| 295 | 295 | } |
| 296 | 296 | else if (is_object($arg)) |
| 297 | 297 | { |
@@ -299,19 +299,19 @@ discard block |
||
| 299 | 299 | } |
| 300 | 300 | else if (is_string($arg)) |
| 301 | 301 | { |
| 302 | - $params[] = 'string(' . $arg . ')'; |
|
| 302 | + $params[] = 'string('.$arg.')'; |
|
| 303 | 303 | } |
| 304 | 304 | else if (is_int($arg)) |
| 305 | 305 | { |
| 306 | - $params[] = 'int(' . $arg . ')'; |
|
| 306 | + $params[] = 'int('.$arg.')'; |
|
| 307 | 307 | } |
| 308 | 308 | else if (is_float($arg)) |
| 309 | 309 | { |
| 310 | - $params[] = 'float(' . $arg . ')'; |
|
| 310 | + $params[] = 'float('.$arg.')'; |
|
| 311 | 311 | } |
| 312 | 312 | else if (is_bool($arg)) |
| 313 | 313 | { |
| 314 | - $params[] = 'bool(' . ($arg ? 'true' : 'false') . ')'; |
|
| 314 | + $params[] = 'bool('.($arg ? 'true' : 'false').')'; |
|
| 315 | 315 | } |
| 316 | 316 | else if ($arg instanceof \__PHP_Incomplete_Class) |
| 317 | 317 | { |