PHP code example of tuchsoft / issue-reporter

1. Go to this page and download the library: Download tuchsoft/issue-reporter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tuchsoft / issue-reporter example snippets


use Tuchsoft\IssueReporter\Report;
use Tuchsoft\IssueReporter\Reporter;

// Build a report programmatically…
$report = (new Report('My lint run', '/path/to/project'))->start();
$report->error('E101', 'Something broke', 'src/A.php', 10, 5);
$report->warning('W201', 'Be careful', 'src/B.php', 3);
$report->tip('T301', 'Could be nicer', 'src/B.php', 8);
$report->complete();

// …then render it in any supported format.
Reporter::printReport($report, 'infomd', 'report.md');

use Tuchsoft\IssueReporter\Factory;

$report = Factory::create(Factory::FORMAT, 'phpcs')->parse(file_get_contents('phpcs.json'));
Reporter::printReport($report, 'sarif', 'merged.sarif');

use Tuchsoft\IssueReporter\Factory;

Factory::register(Factory::FORMAT, My\Format::class);
Factory::register(Factory::TRANSFORMER, My\Transformer::class);
// or a whole PSR-4 namespace:
Factory::register(Factory::FORMAT, 'My\\Formats\\');