Skip to content

Commit f12d089

Browse files
committed
remove deprecated withPhp53Sets() ... withPhp74Sets() methods
1 parent 792291c commit f12d089

7 files changed

Lines changed: 0 additions & 89 deletions

File tree

‎src/Configuration/Option.php‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,6 @@ final class Option
240240
*/
241241
public const string SKIPPED_NON_RECTOR_CLASSES = 'skipped_non_rector_classes';
242242

243-
/**
244-
* @internal For reporting deprecated withPhp53Sets() ... withPhp74Sets() methods
245-
*/
246-
public const string DEPRECATED_PHP_SETS_METHODS = 'deprecated_php_sets_methods';
247-
248243
/**
249244
* @internal For reporting deprecated withAttributesSets() arguments
250245
*/

‎src/Configuration/Parameter/SimpleParameterProvider.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ final class SimpleParameterProvider
4040
Option::SKIPPED_RECTOR_RULES,
4141
Option::SKIPPED_NON_RECTOR_CLASSES,
4242
Option::SKIPPED_START_WITH_SHORT_OPEN_TAG_FILES,
43-
Option::DEPRECATED_PHP_SETS_METHODS,
4443
Option::DEPRECATED_ATTRIBUTES_SETS_ARGS,
4544
Option::DEPRECATED_COMPOSER_BASED_ARGS,
4645
Option::LEVEL_OVERFLOWS,

‎src/Configuration/RectorConfigBuilder.php‎

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -583,60 +583,6 @@ public function withPhpSets(
583583
return $this->addPhpLevelSets($pickedPhpVersions[0]);
584584
}
585585

586-
#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
587-
public function withPhp53Sets(): self
588-
{
589-
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
590-
}
591-
592-
#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
593-
public function withPhp54Sets(): self
594-
{
595-
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
596-
}
597-
598-
#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
599-
public function withPhp55Sets(): self
600-
{
601-
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
602-
}
603-
604-
#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
605-
public function withPhp56Sets(): self
606-
{
607-
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
608-
}
609-
610-
#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
611-
public function withPhp70Sets(): self
612-
{
613-
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
614-
}
615-
616-
#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
617-
public function withPhp71Sets(): self
618-
{
619-
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
620-
}
621-
622-
#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
623-
public function withPhp72Sets(): self
624-
{
625-
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
626-
}
627-
628-
#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
629-
public function withPhp73Sets(): self
630-
{
631-
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
632-
}
633-
634-
#[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')]
635-
public function withPhp74Sets(): self
636-
{
637-
return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__);
638-
}
639-
640586
// there is no withPhp80Sets() and above,
641587
// as we already use PHP 8.0 and should go with withPhpSets() instead
642588

@@ -1165,13 +1111,6 @@ private function addPhpLevelSets(int $phpVersion): self
11651111
return $this;
11661112
}
11671113

1168-
private function reportDeprecatedPhpSetsMethod(string $methodName): self
1169-
{
1170-
SimpleParameterProvider::addParameter(Option::DEPRECATED_PHP_SETS_METHODS, $methodName);
1171-
1172-
return $this;
1173-
}
1174-
11751114
/**
11761115
* @param array<class-string<RectorInterface>> $availableRules
11771116
*/

‎src/Console/Command/ProcessCommand.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
195195
// 4. Deprecations reporter
196196
$this->deprecatedRulesReporter->reportDeprecatedRules();
197197
$this->deprecatedRulesReporter->reportDeprecatedSkippedRules();
198-
$this->deprecatedRulesReporter->reportDeprecatedPhpSetsMethods();
199198
$this->deprecatedRulesReporter->reportDeprecatedAttributesSetsArgs();
200199
$this->deprecatedRulesReporter->reportDeprecatedComposerBasedArgs();
201200

‎src/Console/Command/ValidateConfigCommand.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5959

6060
$issueCount += $this->deprecatedRulesReporter->reportDeprecatedRules();
6161
$issueCount += $this->deprecatedRulesReporter->reportDeprecatedSkippedRules();
62-
$issueCount += $this->deprecatedRulesReporter->reportDeprecatedPhpSetsMethods();
6362
$issueCount += $this->deprecatedRulesReporter->reportDeprecatedAttributesSetsArgs();
6463
$issueCount += $this->deprecatedRulesReporter->reportDeprecatedComposerBasedArgs();
6564

‎src/Reporting/DeprecatedRulesReporter.php‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,6 @@ public function reportDeprecatedSkippedRules(): int
5757
return $reportedCount;
5858
}
5959

60-
public function reportDeprecatedPhpSetsMethods(): int
61-
{
62-
/** @var string[] $deprecatedPhpSetsMethods */
63-
$deprecatedPhpSetsMethods = SimpleParameterProvider::provideArrayParameter(
64-
Option::DEPRECATED_PHP_SETS_METHODS
65-
);
66-
67-
$reportedCount = 0;
68-
foreach (array_unique($deprecatedPhpSetsMethods) as $deprecatedPhpSetsMethod) {
69-
$this->symfonyStyle->warning(sprintf(
70-
'The "->%s()" method is deprecated and no longer applied. Use "->withPhpLevel()" instead, to raise PHP level one rule at a time.',
71-
$deprecatedPhpSetsMethod
72-
));
73-
++$reportedCount;
74-
}
75-
76-
return $reportedCount;
77-
}
78-
7960
public function reportDeprecatedAttributesSetsArgs(): int
8061
{
8162
/** @var string[] $deprecatedAttributesSetsArgs */

‎tests/Console/Command/ValidateConfigCommandTest.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ protected function setUp(): void
3636
Option::SKIPPED_NON_RECTOR_CLASSES,
3737
Option::SKIPPED_RECTOR_RULES,
3838
Option::SKIPPED_START_WITH_SHORT_OPEN_TAG_FILES,
39-
Option::DEPRECATED_PHP_SETS_METHODS,
4039
Option::DEPRECATED_ATTRIBUTES_SETS_ARGS,
4140
Option::DEPRECATED_COMPOSER_BASED_ARGS,
4241
Option::ROOT_STANDALONE_REGISTERED_RULES,

0 commit comments

Comments
 (0)