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
|
|
|
{
|
|
|
|
/**
|
|
|
|
* {{@inheritdoc}}
|
|
|
|
*/
|
|
|
|
public function create(): string
|
|
|
|
{
|
|
|
|
$output = '';
|
|
|
|
foreach ($this->issues_data as $issue_data) {
|
|
|
|
$output .= sprintf(
|
|
|
|
'%s:%s:%s:%s - %s',
|
|
|
|
$issue_data['file_path'],
|
|
|
|
$issue_data['line_from'],
|
|
|
|
$issue_data['column_from'],
|
|
|
|
($issue_data['severity'] === Config::REPORT_ERROR ? 'error' : 'warning'),
|
|
|
|
$issue_data['message']
|
|
|
|
) . "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
return $output;
|
|
|
|
}
|
|
|
|
}
|