Skip to content

Commit 4515af7

Browse files
[depre] Add deprecation notice about strict booleans to inform users (#7526)
* [depre] Add deprecation notice about strict booleans to inform users * [ci-review] Rector Rectify --------- Co-authored-by: GitHub Action <actions@github.com>
1 parent b52ae95 commit 4515af7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Configuration/RectorConfigBuilder.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
use Rector\Symfony\Set\SymfonySetList;
3737
use Rector\ValueObject\Configuration\LevelOverflow;
3838
use Rector\ValueObject\PhpVersion;
39+
use Symfony\Component\Console\Input\ArgvInput;
40+
use Symfony\Component\Console\Output\ConsoleOutput;
41+
use Symfony\Component\Console\Style\SymfonyStyle;
3942
use Symfony\Component\Finder\Finder;
4043
use Webmozart\Assert\Assert;
4144

@@ -771,6 +774,13 @@ public function withPreparedSets(
771774
): self {
772775
Notifier::notifyNotSuitableMethodForPHP74(__METHOD__);
773776

777+
if ($strictBooleans) {
778+
$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.';
779+
780+
$symfonyStyle = new SymfonyStyle(new ArgvInput(), new ConsoleOutput());
781+
$symfonyStyle->warning($message);
782+
}
783+
774784
$setMap = [
775785
SetList::DEAD_CODE => $deadCode,
776786
SetList::CODE_QUALITY => $codeQuality,

0 commit comments

Comments
 (0)