2018-12-09 21:47:20 +01:00
|
|
|
<?php
|
2019-06-09 18:37:28 +02:00
|
|
|
namespace Psalm\Report;
|
2018-12-09 21:47:20 +01:00
|
|
|
|
|
|
|
use Psalm\Config;
|
2019-06-09 18:37:28 +02:00
|
|
|
use Psalm\Report;
|
2019-06-26 22:52:29 +02:00
|
|
|
use function sprintf;
|
2018-12-09 21:47:20 +01:00
|
|
|
|
2019-06-09 18:37:28 +02:00
|
|
|
class EmacsReport extends Report
|
2018-12-09 21:47:20 +01:00
|
|
|
{
|
|
|
|
/**
|
2019-07-05 22:24:00 +02:00
|
|
|
* {@inheritdoc}
|
2018-12-09 21:47:20 +01:00
|
|
|
*/
|
|
|
|
public function create(): string
|
|
|
|
{
|
|
|
|
$output = '';
|
|
|
|
foreach ($this->issues_data as $issue_data) {
|
|
|
|
$output .= sprintf(
|
|
|
|
'%s:%s:%s:%s - %s',
|
2020-02-17 00:24:40 +01:00
|
|
|
$issue_data->file_path,
|
|
|
|
$issue_data->line_from,
|
|
|
|
$issue_data->column_from,
|
|
|
|
($issue_data->severity === Config::REPORT_ERROR ? 'error' : 'warning'),
|
|
|
|
$issue_data->message
|
2018-12-09 21:47:20 +01:00
|
|
|
) . "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
return $output;
|
|
|
|
}
|
|
|
|
}
|