diff --git a/rules/CodingStyle/Rector/ArrowFunction/StaticArrowFunctionRector.php b/rules/CodingStyle/Rector/ArrowFunction/StaticArrowFunctionRector.php deleted file mode 100644 index 878ba298788..00000000000 --- a/rules/CodingStyle/Rector/ArrowFunction/StaticArrowFunctionRector.php +++ /dev/null @@ -1,56 +0,0 @@ - 'test'; -CODE_SAMPLE - , - <<<'CODE_SAMPLE' -static fn (): string => 'test'; -CODE_SAMPLE - ), - ] - ); - } - - /** - * @return array> - */ - public function getNodeTypes(): array - { - return [ArrowFunction::class]; - } - - /** - * @param ArrowFunction $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '"%s" is deprecated as noisy change with little value. Use manually or custom rule where needed instead', - self::class - )); - } -} diff --git a/rules/CodingStyle/Rector/Assign/NestedTernaryToMatchRector.php b/rules/CodingStyle/Rector/Assign/NestedTernaryToMatchRector.php deleted file mode 100644 index 4506f6ee325..00000000000 --- a/rules/CodingStyle/Rector/Assign/NestedTernaryToMatchRector.php +++ /dev/null @@ -1,70 +0,0 @@ - 100 ? 'more than 100' : ($input > 5 ? 'more than 5' : 'less'); - } -} -CODE_SAMPLE - , - <<<'CODE_SAMPLE' -class SomeClass -{ - public function getValue($input) - { - return match (true) { - $input > 100 => 'more than 100', - $input > 5 => 'more than 5', - default => 'less', - }; - } -} -CODE_SAMPLE - ), - - ]); - } - - /** - * @return array> - */ - public function getNodeTypes(): array - { - return [Assign::class]; - } - - /** - * @param Assign $node - */ - public function refactor(Node $node): ?Assign - { - throw new ShouldNotHappenException(sprintf( - '"%s" is deprecated, as match(true) with nested conditions is often less readable than the original ternary', - self::class - )); - } -} diff --git a/rules/CodingStyle/Rector/ClassMethod/BinaryOpStandaloneAssignsToDirectRector.php b/rules/CodingStyle/Rector/ClassMethod/BinaryOpStandaloneAssignsToDirectRector.php deleted file mode 100644 index 9ffb9e21ff2..00000000000 --- a/rules/CodingStyle/Rector/ClassMethod/BinaryOpStandaloneAssignsToDirectRector.php +++ /dev/null @@ -1,65 +0,0 @@ - 200; -} -CODE_SAMPLE - - , - <<<'CODE_SAMPLE' -function run() -{ - return 100 <=> 200; -} -CODE_SAMPLE - ), - ]); - } - - /** - * @return array> - */ - public function getNodeTypes(): array - { - return [ClassMethod::class, Function_::class, Closure::class]; - } - - /** - * @param ClassMethod|Function_|Closure $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '"%s" rule is deprecated, as it covers a very specific shape of code with unclear purpose', - self::class - )); - } -} diff --git a/rules/CodingStyle/Rector/Closure/StaticClosureRector.php b/rules/CodingStyle/Rector/Closure/StaticClosureRector.php deleted file mode 100644 index 805f1ee2297..00000000000 --- a/rules/CodingStyle/Rector/Closure/StaticClosureRector.php +++ /dev/null @@ -1,68 +0,0 @@ -> - */ - public function getNodeTypes(): array - { - return [Closure::class]; - } - - /** - * @param Closure $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '"%s" is deprecated as noisy change with little value. Use manually or custom rule where needed instead', - self::class - )); - } -} diff --git a/rules/CodingStyle/Rector/Encapsed/EncapsedStringsToSprintfRector.php b/rules/CodingStyle/Rector/Encapsed/EncapsedStringsToSprintfRector.php deleted file mode 100644 index 43dcf9e6450..00000000000 --- a/rules/CodingStyle/Rector/Encapsed/EncapsedStringsToSprintfRector.php +++ /dev/null @@ -1,74 +0,0 @@ - $configuration - */ - public function configure(array $configuration): void - { - } - - public function getRuleDefinition(): RuleDefinition - { - return new RuleDefinition( - 'Convert enscaped {$string} to more readable sprintf or concat, if no mask is used', - [ - new ConfiguredCodeSample( - <<<'CODE_SAMPLE' -echo "Unsupported format {$format} - use another"; - -echo "Try {$allowed}"; -CODE_SAMPLE - , - <<<'CODE_SAMPLE' -echo sprintf('Unsupported format %s - use another', $format); - -echo 'Try ' . $allowed; -CODE_SAMPLE - , - [ - self::ALWAYS => false, - ] - ), - ] - ); - } - - /** - * @return array> - */ - public function getNodeTypes(): array - { - return [InterpolatedString::class]; - } - - /** - * @param InterpolatedString $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '"%s" is deprecated, as converting string interpolation to sprintf() is a personal preference that can worsen readability', - self::class - )); - } -} diff --git a/rules/CodingStyle/Rector/Encapsed/WrapEncapsedVariableInCurlyBracesRector.php b/rules/CodingStyle/Rector/Encapsed/WrapEncapsedVariableInCurlyBracesRector.php deleted file mode 100644 index fd96568e79e..00000000000 --- a/rules/CodingStyle/Rector/Encapsed/WrapEncapsedVariableInCurlyBracesRector.php +++ /dev/null @@ -1,59 +0,0 @@ -> - */ - public function getNodeTypes(): array - { - return [InterpolatedString::class]; - } - - /** - * @param InterpolatedString $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '"%s" rule is deprecated, as it is a coding standard preference with no real value', - self::class - )); - } -} diff --git a/rules/CodingStyle/Rector/Enum_/EnumCaseToPascalCaseRector.php b/rules/CodingStyle/Rector/Enum_/EnumCaseToPascalCaseRector.php deleted file mode 100644 index b33f6122257..00000000000 --- a/rules/CodingStyle/Rector/Enum_/EnumCaseToPascalCaseRector.php +++ /dev/null @@ -1,66 +0,0 @@ -> - */ - public function getNodeTypes(): array - { - return [FuncCall::class]; - } - - /** - * @param FuncCall $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '"%s" rule is deprecated, as it is a personal preference that makes array merges harder to read', - self::class - )); - } -} diff --git a/rules/CodingStyle/Rector/FuncCall/CountArrayToEmptyArrayComparisonRector.php b/rules/CodingStyle/Rector/FuncCall/CountArrayToEmptyArrayComparisonRector.php deleted file mode 100644 index 82c66e84920..00000000000 --- a/rules/CodingStyle/Rector/FuncCall/CountArrayToEmptyArrayComparisonRector.php +++ /dev/null @@ -1,60 +0,0 @@ - 0; -! count($array); -CODE_SAMPLE - , - <<<'CODE_SAMPLE' -$array === []; -$array !== []; -$array === []; -CODE_SAMPLE - ), - ] - ); - } - - /** - * @return array> - */ - public function getNodeTypes(): array - { - return [Identical::class]; - } - - /** - * @param Identical $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '"%s" rule is deprecated, as it is a coding standard preference with no real value', - self::class - )); - } -} diff --git a/rules/CodingStyle/Rector/If_/NullableCompareToNullRector.php b/rules/CodingStyle/Rector/If_/NullableCompareToNullRector.php deleted file mode 100644 index 8af5c4ffa9a..00000000000 --- a/rules/CodingStyle/Rector/If_/NullableCompareToNullRector.php +++ /dev/null @@ -1,66 +0,0 @@ -> - */ - public function getNodeTypes(): array - { - return [If_::class]; - } - - /** - * @param If_ $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '"%s" is deprecated, as null compare is ambiguous and weak; use an "instanceof" check instead', - self::class - )); - } -}