diff --git a/src/Psalm/Internal/Analyzer/IssueData.php b/src/Psalm/Internal/Analyzer/IssueData.php index 9b2be54fa..6d377e3e1 100644 --- a/src/Psalm/Internal/Analyzer/IssueData.php +++ b/src/Psalm/Internal/Analyzer/IssueData.php @@ -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; } diff --git a/src/Psalm/Report/ConsoleReport.php b/src/Psalm/Report/ConsoleReport.php index 2656a5ef6..00faf44e4 100644 --- a/src/Psalm/Report/ConsoleReport.php +++ b/src/Psalm/Report/ConsoleReport.php @@ -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 diff --git a/src/Psalm/Report/PhpStormReport.php b/src/Psalm/Report/PhpStormReport.php index 4ef4c5d9e..cb7694dff 100644 --- a/src/Psalm/Report/PhpStormReport.php +++ b/src/Psalm/Report/PhpStormReport.php @@ -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