matheusab/rector-html-output-formatter

HTML Output Formatter for the Rector PHP Library.

0.3 2024-01-20 21:10 UTC

This package is auto-updated.

Last update: 2024-05-20 21:52:08 UTC


README

Configure it in your rector.php, where the exportedFilePathPrefix argument is the path to the exported report. Example:

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->singleton(HtmlOutputFormatter::class, HtmlOutputFormatter::class);
    $rectorConfig->tag(HtmlOutputFormatter::class, OutputFormatterInterface::class);
    $rectorConfig->when(HtmlOutputFormatter::class)
        ->needs('$exportedFilePathPrefix')
        ->give(__DIR__ . '/rector-report');

After configuring it, you can generate it with Rector's process command by setting --output-format=html.

Example:

vendor/bin/rector process --dry-run --output-format=html

Generated report screenshots

image image