Skip to content

Commit

Permalink
Fix psalm inspections
Browse files Browse the repository at this point in the history
  • Loading branch information
mpkorstanje committed Mar 17, 2024
1 parent 5d8eb96 commit ad666ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion php/src/TokenFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ public function formatToken(Token $token): string
return 'EOF';
}

$keyword = $token->match?->keyword;
return sprintf(
"(%s:%s)%s:%s/%s/%s",
$token->getLocation()->line,
$token->getLocation()->column,
$token->match?->tokenType->name ?? '',
$token->match?->keyword !== null ? $this->formatKeyword($token) : '',
$keyword !== null && $keyword !== '' ? $this->formatKeyword($token) : '',
$token->match?->text ?? '',
$token->match === null ? ''
: join(',', array_map(fn ($linespan) => $linespan->column . ':' . $linespan->text, $token->match->items)),
Expand Down

0 comments on commit ad666ba

Please sign in to comment.