From bec8b26343c048d353fca70fae266005ea2b0f1d Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Sun, 28 Jul 2024 13:16:43 +0000 Subject: [PATCH] fix converters doc --- docs/converter/phpcs.md | 5 ++--- docs/converter/phplint.md | 2 +- docs/converter/phpstan.md | 2 +- docs/converter/twigcs-fixer.md | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/converter/phpcs.md b/docs/converter/phpcs.md index 884b895..a6f517a 100644 --- a/docs/converter/phpcs.md +++ b/docs/converter/phpcs.md @@ -75,9 +75,8 @@ class MyPhpCsReport extends PhpCsReport { public function __construct() { - // enable pretty print flag - parent::__construct(new PhpCsConverter(null, true)); - } + parent::__construct(new PhpCsConverter(['format_output' => true])); + } } ``` diff --git a/docs/converter/phplint.md b/docs/converter/phplint.md index 4538afd..bb5b6ef 100644 --- a/docs/converter/phplint.md +++ b/docs/converter/phplint.md @@ -87,7 +87,7 @@ vendor/bin/phplint --format=checkstyle --output=checkstyle.xml /path/to/source/c **Step 2:** And finally, convert it to SARIF with the **Console Tool** ```shell -report-converter convert phplint --input-format=checkstyle --input-file=examples/phplint/checkstyle.xml -v +php report-converter convert phplint --input-format=checkstyle --input-file=examples/phplint/checkstyle.xml -v ``` > [!TIP] diff --git a/docs/converter/phpstan.md b/docs/converter/phpstan.md index 647267c..157e002 100644 --- a/docs/converter/phpstan.md +++ b/docs/converter/phpstan.md @@ -71,7 +71,7 @@ class MySarifFormatter extends PhpStanFormatter { public function __construct(bool $prettyPrint) { - parent::__construct(new PhpStanConverter(null , $prettyPrint)); + parent::__construct(new PhpStanConverter(['format_output' => $prettyPrint])); } } ``` diff --git a/docs/converter/twigcs-fixer.md b/docs/converter/twigcs-fixer.md index 4c4fd2f..c7541bd 100644 --- a/docs/converter/twigcs-fixer.md +++ b/docs/converter/twigcs-fixer.md @@ -32,7 +32,7 @@ composer require --dev vincentlanglet/twig-cs-fixer bartlett/sarif-php-converter ## Usage ```shell -vendor/bin/twigcs-fixer lint /path/to/source --report sarif --config .twig-cs-fixer.dist.php +vendor/bin/twig-cs-fixer lint /path/to/source --report sarif --config .twig-cs-fixer.dist.php ``` > [!TIP] @@ -85,7 +85,7 @@ class MyTwigCsFixerReporter extends TwigCsFixerReporter **Step 2:** And finally, print the SARIF report ```shell -vendor/bin/twigcs-fixer lint /path/to/source --report sarif --config .twig-cs-fixer.php +vendor/bin/twig-cs-fixer lint /path/to/source --report sarif --config .twig-cs-fixer.php ``` > [!TIP] @@ -99,7 +99,7 @@ If you prefer to convert from a [format supported natively][[twigcs-fixer-custom **Step 1:** Build the checkstyle output report ```shell -vendor/bin/twigcs-fixer lint /path/to/source --report checkstyle +vendor/bin/twig-cs-fixer lint /path/to/source --report checkstyle ``` **Step 2:** And finally, convert it to SARIF with the **Console Tool**