Skip to content

Commit

Permalink
Fix phpstan test
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarreyes3 authored Apr 12, 2024
1 parent a37aa92 commit 4c10b64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Monolog/Formatter/LineFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ private function formatException(\Throwable $e): string

$file = $e->getFile();
if ($this->basePath !== '') {
$file = preg_replace('{^'.preg_quote($this->basePath).'}', '', $e->getFile());
$file = preg_replace('{^'.preg_quote($this->basePath).'}', '', $file);
}

$str .= '): ' . $e->getMessage() . ' at ' . $file . ':' . $e->getLine() . ')';
Expand All @@ -294,7 +294,7 @@ private function stacktracesParser(\Throwable $e): string
$trace = $e->getTraceAsString();

if ($this->basePath !== '') {
$trace = preg_replace('{^(#\d+ )' . preg_quote($this->basePath) . '}m', '$1', $trace);
$trace = preg_replace('{^(#\d+ )' . preg_quote($this->basePath) . '}m', '$1', $trace) ?: $trace;

Check failure on line 297 in src/Monolog/Formatter/LineFormatter.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1)

Short ternary operator is not allowed. Use null coalesce operator if applicable or consider using long ternary.
}

if ($this->stacktracesParser !== null) {
Expand Down

0 comments on commit 4c10b64

Please sign in to comment.