1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-07 13:42:11 +01:00
psalm/src/Psalm/Report/TextReport.php
2020-02-16 18:24:40 -05:00

31 lines
699 B
PHP

<?php
namespace Psalm\Report;
use Psalm\Config;
use Psalm\Report;
use function sprintf;
class TextReport extends Report
{
/**
* {@inheritdoc}
*/
public function create(): string
{
$output = '';
foreach ($this->issues_data as $issue_data) {
$output .= sprintf(
'%s:%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->type,
$issue_data->message
) . "\n";
}
return $output;
}
}