Skip to content

Commit 0209353

Browse files
committed
[depre] Add deprecation notice about strict booleans to inform users
1 parent b52ae95 commit 0209353

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/Configuration/RectorConfigBuilder.php

Lines changed: 12 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,15 @@ public function withPreparedSets(
771774
): self {
772775
Notifier::notifyNotSuitableMethodForPHP74(__METHOD__);
773776

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

0 commit comments

Comments
 (0)