Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
typeDeclarations: true,
typeDeclarationDocblocks: true,
privatization: true,
naming: true,
instanceOf: true,
earlyReturn: true,
rectorPreset: true,
Expand Down
5 changes: 5 additions & 0 deletions src/Configuration/RectorConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ public function withPhp74Sets(): self
// as we already use PHP 8.0 and should go with withPhpSets() instead

/**
* @param bool $naming @deprecated The naming set often causes conflicting variable and param names; use a coding standard tool instead
* @param bool $instanceOf @deprecated Use $codeQuality instead, as most instanceof rules were moved there
* @param bool $if @deprecated Use $codeQuality and $codingStyle instead, as the if rules were moved there or deprecated
* @param bool $earlyReturn @deprecated Use $codeQuality instead, as all early return rules were moved there
Expand Down Expand Up @@ -668,6 +669,10 @@ public function withPreparedSets(
): self {
Notifier::notifyNotSuitableMethodForPHP74(__METHOD__);

if ($naming) {
Notifier::notifyDeprecatedNamingSet();
}

$setMap = [
SetList::DEAD_CODE => $deadCode,
SetList::CODE_QUALITY => $codeQuality,
Expand Down
9 changes: 9 additions & 0 deletions src/Console/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ public static function notifyDeprecatedPhpSet(string $set): void
$symfonyStyle->warning($message);
}

public static function notifyDeprecatedNamingSet(): void
{
$message = 'The "naming" prepared set is deprecated, as it often causes conflicting variable and param names and removes context. '
. 'Renaming to match types belongs to a coding standard tool rather than Rector.';

$symfonyStyle = new SymfonyStyle(new ArgvInput(), new ConsoleOutput());
$symfonyStyle->warning($message);
}

public static function errorWithPhpSetsNotSuitableForPHP74AndLower(): void
{
if (PHP_VERSION_ID >= 80000) {
Expand Down
Loading