1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 12:24:49 +01:00

Don't add link if the issue doesn't have a shortcode (#4786)

This commit is contained in:
orklah 2020-12-06 17:29:05 +01:00 committed by Daniil Gentili
parent 7a217a060d
commit 37f0cd6263
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
3 changed files with 3 additions and 3 deletions

View File

@ -162,7 +162,7 @@ class IssueData
$this->column_to = $column_to;
$this->shortcode = $shortcode;
$this->error_level = $error_level;
$this->link = 'https://psalm.dev/' . \str_pad((string) $shortcode, 3, "0", \STR_PAD_LEFT);
$this->link = $shortcode ? 'https://psalm.dev/' . \str_pad((string) $shortcode, 3, "0", \STR_PAD_LEFT) : '';
$this->taint_trace = $taint_trace;
$this->dupe_key = $dupe_key;
}

View File

@ -30,7 +30,7 @@ class ConsoleReport extends Report
$issue_string .= 'INFO';
}
$issue_reference = ' (see ' . $issue_data->link . ')';
$issue_reference = $issue_data->link ? ' (see ' . $issue_data->link . ')' : '';
$issue_string .= ': ' . $issue_data->type
. ' - ' . $issue_data->file_name . ':' . $issue_data->line_from . ':' . $issue_data->column_from

View File

@ -30,7 +30,7 @@ class PhpStormReport extends Report
$issue_string .= 'INFO';
}
$issue_reference = ' (see ' . $issue_data->link . ')';
$issue_reference = $issue_data->link ? ' (see ' . $issue_data->link . ')' : '';
$issue_string .= ': ' . $issue_data->type
. "\nat " . $issue_data->file_path . ':' . $issue_data->line_from . ':' . $issue_data->column_from