1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +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 GitHub
parent 7c837addf5
commit 1901ea56de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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