From 020935369db65c9fa05b097a0a5df835f4c475de Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 21 Oct 2025 15:39:34 +0200 Subject: [PATCH 1/2] [depre] Add deprecation notice about strict booleans to inform users --- src/Configuration/RectorConfigBuilder.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Configuration/RectorConfigBuilder.php b/src/Configuration/RectorConfigBuilder.php index 5a8daf6bef7..175a82250d8 100644 --- a/src/Configuration/RectorConfigBuilder.php +++ b/src/Configuration/RectorConfigBuilder.php @@ -36,6 +36,9 @@ use Rector\Symfony\Set\SymfonySetList; use Rector\ValueObject\Configuration\LevelOverflow; use Rector\ValueObject\PhpVersion; +use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Console\Output\ConsoleOutput; +use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Finder\Finder; use Webmozart\Assert\Assert; @@ -771,6 +774,15 @@ public function withPreparedSets( ): self { Notifier::notifyNotSuitableMethodForPHP74(__METHOD__); + if ($strictBooleans === true) { + $message = sprintf( + 'The "strictBooleans" set is deprecated as mostly risky and not practical. Remove it from withPreparedSets() method and use "codeQuality" and "codingStyle" sets instead. They already contain more granular and stable rules on same note.', + ); + + $symfonyStyle = new SymfonyStyle(new ArgvInput(), new ConsoleOutput()); + $symfonyStyle->warning($message); + } + $setMap = [ SetList::DEAD_CODE => $deadCode, SetList::CODE_QUALITY => $codeQuality, From 5f5c85187e9f1a638014437095c35305776fd590 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 21 Oct 2025 13:51:34 +0000 Subject: [PATCH 2/2] [ci-review] Rector Rectify --- src/Configuration/RectorConfigBuilder.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Configuration/RectorConfigBuilder.php b/src/Configuration/RectorConfigBuilder.php index 175a82250d8..974356973ec 100644 --- a/src/Configuration/RectorConfigBuilder.php +++ b/src/Configuration/RectorConfigBuilder.php @@ -774,10 +774,8 @@ public function withPreparedSets( ): self { Notifier::notifyNotSuitableMethodForPHP74(__METHOD__); - if ($strictBooleans === true) { - $message = sprintf( - 'The "strictBooleans" set is deprecated as mostly risky and not practical. Remove it from withPreparedSets() method and use "codeQuality" and "codingStyle" sets instead. They already contain more granular and stable rules on same note.', - ); + if ($strictBooleans) { + $message = 'The "strictBooleans" set is deprecated as mostly risky and not practical. Remove it from withPreparedSets() method and use "codeQuality" and "codingStyle" sets instead. They already contain more granular and stable rules on same note.'; $symfonyStyle = new SymfonyStyle(new ArgvInput(), new ConsoleOutput()); $symfonyStyle->warning($message);