2020-01-23 13:14:48 +01:00
|
|
|
<?php
|
|
|
|
namespace Psalm\Report;
|
|
|
|
|
|
|
|
use Psalm\Config;
|
|
|
|
use Psalm\Report;
|
|
|
|
use function sprintf;
|
|
|
|
|
|
|
|
class GithubActionsReport extends Report
|
|
|
|
{
|
|
|
|
public function create(): string
|
|
|
|
{
|
|
|
|
$output = '';
|
|
|
|
foreach ($this->issues_data as $issue_data) {
|
|
|
|
$output .= sprintf(
|
|
|
|
'::%s file=%s,line=%s,col=%s::%s',
|
2020-02-17 00:24:40 +01:00
|
|
|
($issue_data->severity === Config::REPORT_ERROR ? 'error' : 'warning'),
|
|
|
|
$issue_data->file_name,
|
|
|
|
$issue_data->line_from,
|
|
|
|
$issue_data->column_from,
|
|
|
|
$issue_data->message
|
2020-01-23 13:14:48 +01:00
|
|
|
) . "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
return $output;
|
|
|
|
}
|
|
|
|
}
|