1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-08 14:08:43 +01:00
psalm/src/Psalm/Report/TextReport.php

31 lines
699 B
PHP
Raw Normal View History

<?php
namespace Psalm\Report;
use Psalm\Config;
use Psalm\Report;
use function sprintf;
class TextReport extends Report
{
/**
2019-07-05 22:24:00 +02:00
* {@inheritdoc}
*/
public function create(): string
{
2018-12-18 23:47:28 +01:00
$output = '';
foreach ($this->issues_data as $issue_data) {
$output .= sprintf(
'%s:%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->type,
$issue_data->message
) . "\n";
}
return $output;
}
}