1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-14 18:36:58 +01:00
psalm/src/Psalm/Output/Emacs.php
Jon Ursenbach c6a8b53a4d Refactoring output formats and creating a new "compact" format.
The new compact format generates your report within a table
structure that is similar to PHPCS.

Resolves #967
2018-12-09 17:34:47 -05:00

29 lines
645 B
PHP

<?php
namespace Psalm\Output;
use Psalm\Config;
use Psalm\Output;
class Emacs extends Output
{
/**
* {{@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;
}
}