From 580cfe8c0a110a5643961e2cd15fbb9a6b7f6d65 Mon Sep 17 00:00:00 2001 From: "ondrej@mirtes.cz" Date: Wed, 4 Nov 2026 17:51:15 +0000 Subject: [PATCH] PHPStan Pro: send the rule level of each analysis The level shown in PHPStan Pro came from initialData, sent once at the start, so it stayed the same when the level in the config changed. fixer:worker reads the config again for every analysis and now sends its level in analysisStart. Amp-Thread-ID: https://ampcode.com/threads/T-01a1a5ee-28c1-7051-9236-6fdf45b6f7c0 --- src/Command/FixerWorkerRunner.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Command/FixerWorkerRunner.php b/src/Command/FixerWorkerRunner.php index ff6af16786a..163efa9bff0 100644 --- a/src/Command/FixerWorkerRunner.php +++ b/src/Command/FixerWorkerRunner.php @@ -58,6 +58,8 @@ final class FixerWorkerRunner public function __construct( #[AutowiredParameter] private array $allConfigFiles, + #[AutowiredParameter] + private string $usedLevel, private IgnoredErrorHelper $ignoredErrorHelper, private ResultCacheManagerFactory $resultCacheManagerFactory, private AnalyserResultFinalizer $analyserResultFinalizer, @@ -131,6 +133,8 @@ public function run( 'action' => 'analysisStart', 'result' => [ 'analysedFiles' => $inceptionFiles, + // the level of the config read for this analysis, it may have changed since PHPStan Pro started + 'ruleLevel' => $this->usedLevel, ], ]);