From 7af14fbfc027b15e3342ac95be783bd3fa1df413 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Tue, 4 Jun 2024 15:20:46 +0200 Subject: [PATCH] Pass current rule level to PHPStan Pro --- conf/config.neon | 1 + src/Command/FixerApplication.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/conf/config.neon b/conf/config.neon index b35118a943..b2e0b4c394 100644 --- a/conf/config.neon +++ b/conf/config.neon @@ -586,6 +586,7 @@ services: cliAutoloadFile: %cliAutoloadFile% bootstrapFiles: %bootstrapFiles% editorUrl: %editorUrl% + usedLevel: %usedLevel% - class: PHPStan\Dependency\DependencyResolver diff --git a/src/Command/FixerApplication.php b/src/Command/FixerApplication.php index 17896dcf9b..dc806d1db4 100644 --- a/src/Command/FixerApplication.php +++ b/src/Command/FixerApplication.php @@ -88,6 +88,7 @@ public function __construct( private ?string $cliAutoloadFile, private array $bootstrapFiles, private ?string $editorUrl, + private string $usedLevel, ) { } @@ -121,6 +122,7 @@ public function run( 'filesCount' => $filesCount, 'phpstanVersion' => ComposerHelper::getPhpStanVersion(), 'editorUrl' => $this->editorUrl, + 'ruleLevel' => $this->usedLevel, ]]); $decoder->on('data', function (array $data) use ( $output,