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
5 changes: 0 additions & 5 deletions src/Configuration/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,6 @@ final class Option
*/
public const string SKIPPED_NON_RECTOR_CLASSES = 'skipped_non_rector_classes';

/**
* @internal For reporting deprecated withPhp53Sets() ... withPhp74Sets() methods
*/
public const string DEPRECATED_PHP_SETS_METHODS = 'deprecated_php_sets_methods';

/**
* @internal For reporting deprecated withAttributesSets() arguments
*/
Expand Down
1 change: 0 additions & 1 deletion src/Configuration/Parameter/SimpleParameterProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ final class SimpleParameterProvider
Option::SKIPPED_RECTOR_RULES,
Option::SKIPPED_NON_RECTOR_CLASSES,
Option::SKIPPED_START_WITH_SHORT_OPEN_TAG_FILES,
Option::DEPRECATED_PHP_SETS_METHODS,
Option::DEPRECATED_ATTRIBUTES_SETS_ARGS,
Option::DEPRECATED_COMPOSER_BASED_ARGS,
Option::LEVEL_OVERFLOWS,
Expand Down
62 changes: 0 additions & 62 deletions src/Configuration/RectorConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Rector\Configuration;

use Deprecated;
use DrupalRector\Set\DrupalSetList;
use Nette\Utils\Strings;
use PhpParser\NodeVisitor;
Expand Down Expand Up @@ -583,60 +582,6 @@ public function withPhpSets(
return $this->addPhpLevelSets($pickedPhpVersions[0]);
}

#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
public function withPhp53Sets(): self
{
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
}

#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
public function withPhp54Sets(): self
{
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
}

#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
public function withPhp55Sets(): self
{
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
}

#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
public function withPhp56Sets(): self
{
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
}

#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
public function withPhp70Sets(): self
{
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
}

#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
public function withPhp71Sets(): self
{
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
}

#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
public function withPhp72Sets(): self
{
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
}

#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
public function withPhp73Sets(): self
{
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
}

#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
public function withPhp74Sets(): self
{
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
}

// there is no withPhp80Sets() and above,
// as we already use PHP 8.0 and should go with withPhpSets() instead

Expand Down Expand Up @@ -1165,13 +1110,6 @@ private function addPhpLevelSets(int $phpVersion): self
return $this;
}

private function reportDeprecatedPhpSetsMethod(string $methodName): self
{
SimpleParameterProvider::addParameter(Option::DEPRECATED_PHP_SETS_METHODS, $methodName);

return $this;
}

/**
* @param array<class-string<RectorInterface>> $availableRules
*/
Expand Down
1 change: 0 additions & 1 deletion src/Console/Command/ProcessCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
// 4. Deprecations reporter
$this->deprecatedRulesReporter->reportDeprecatedRules();
$this->deprecatedRulesReporter->reportDeprecatedSkippedRules();
$this->deprecatedRulesReporter->reportDeprecatedPhpSetsMethods();
$this->deprecatedRulesReporter->reportDeprecatedAttributesSetsArgs();
$this->deprecatedRulesReporter->reportDeprecatedComposerBasedArgs();

Expand Down
1 change: 0 additions & 1 deletion src/Console/Command/ValidateConfigCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$issueCount += $this->deprecatedRulesReporter->reportDeprecatedRules();
$issueCount += $this->deprecatedRulesReporter->reportDeprecatedSkippedRules();
$issueCount += $this->deprecatedRulesReporter->reportDeprecatedPhpSetsMethods();
$issueCount += $this->deprecatedRulesReporter->reportDeprecatedAttributesSetsArgs();
$issueCount += $this->deprecatedRulesReporter->reportDeprecatedComposerBasedArgs();

Expand Down
19 changes: 0 additions & 19 deletions src/Reporting/DeprecatedRulesReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,6 @@ public function reportDeprecatedSkippedRules(): int
return $reportedCount;
}

public function reportDeprecatedPhpSetsMethods(): int
{
/** @var string[] $deprecatedPhpSetsMethods */
$deprecatedPhpSetsMethods = SimpleParameterProvider::provideArrayParameter(
Option::DEPRECATED_PHP_SETS_METHODS
);

$reportedCount = 0;
foreach (array_unique($deprecatedPhpSetsMethods) as $deprecatedPhpSetsMethod) {
$this->symfonyStyle->warning(sprintf(
'The "->%s()" method is deprecated and no longer applied. Use "->withPhpLevel()" instead, to raise PHP level one rule at a time.',
$deprecatedPhpSetsMethod
));
++$reportedCount;
}

return $reportedCount;
}

public function reportDeprecatedAttributesSetsArgs(): int
{
/** @var string[] $deprecatedAttributesSetsArgs */
Expand Down
1 change: 0 additions & 1 deletion tests/Console/Command/ValidateConfigCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ protected function setUp(): void
Option::SKIPPED_NON_RECTOR_CLASSES,
Option::SKIPPED_RECTOR_RULES,
Option::SKIPPED_START_WITH_SHORT_OPEN_TAG_FILES,
Option::DEPRECATED_PHP_SETS_METHODS,
Option::DEPRECATED_ATTRIBUTES_SETS_ARGS,
Option::DEPRECATED_COMPOSER_BASED_ARGS,
Option::ROOT_STANDALONE_REGISTERED_RULES,
Expand Down
Loading