diff --git a/phpstan.neon b/phpstan.neon index 59b80e31808..0fb815c1ea8 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -393,16 +393,11 @@ parameters: - identifier: public.method.unused paths: - - rules/Transform/ValueObject/ClassMethodReference.php - rules/CodeQuality/ValueObject/KeyAndExpr.php - - - identifier: symplify.forbiddenExtendOfNonAbstractClass - path: rules/Php81/Rector/Array_/FirstClassCallableRector.php - identifier: public.classConstant.unused paths: - - rules/TypeDeclaration/Rector/StmtsAwareInterface/IncreaseDeclareStrictTypesRector.php - rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php - rules/Php81/Enum/AttributeName.php @@ -412,11 +407,8 @@ parameters: - tests/PhpParser/NodeTraverser/StopTraverseOnTypeChange/Class_ # deprecated rule - - '#Rule Rector\\Php81\\Rector\\Array_\\FirstClassCallableRector must implements Rector\\VersionBonding\\Contract\\MinPhpVersionInterface#' - - '#Register "Rector\\Php81\\Rector\\Array_\\FirstClassCallableRector" service to "php81\.php" config set#' - '#Register "Rector\\Php81\\Rector\\ClassMethod\\NewInInitializerRector" service to "php81\.php" config set#' - '#Register "Rector\\Php70\\Rector\\StaticCall\\StaticCallOnNonStaticToInstanceCallRector" service to "php70\.php" config set#' - - '#Class "Rector\\CodingStyle\\Rector\\String_\\SymplifyQuoteEscapeRector" is missing @see annotation with test case class reference#' - '#Class "Rector\\Php81\\Rector\\ClassMethod\\NewInInitializerRector" is missing @see annotation with test case class reference#' - '#Class "Rector\\Php70\\Rector\\StaticCall\\StaticCallOnNonStaticToInstanceCallRector" is missing @see annotation with test case class reference#' - '#Class "Rector\\TypeDeclaration\\Rector\\ClassMethod\\StrictStringParamConcatRector" is missing @see annotation with test case class reference#' diff --git a/rules/CodeQuality/Rector/FuncCall/SortNamedParamRector.php b/rules/CodeQuality/Rector/FuncCall/SortNamedParamRector.php deleted file mode 100644 index f6d8c7e2f3b..00000000000 --- a/rules/CodeQuality/Rector/FuncCall/SortNamedParamRector.php +++ /dev/null @@ -1,64 +0,0 @@ -> - */ - public function getNodeTypes(): array - { - return [MethodCall::class, StaticCall::class, New_::class, FuncCall::class]; - } - - /** - * @param MethodCall|StaticCall|New_|FuncCall $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '%s is deprecated as renamed to "%s".', - self::class, - SortCallLikeNamedArgsRector::class - )); - } -} diff --git a/rules/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector.php b/rules/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector.php deleted file mode 100644 index b54925dbbfd..00000000000 --- a/rules/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector.php +++ /dev/null @@ -1,69 +0,0 @@ -> - */ - public function getNodeTypes(): array - { - return [String_::class]; - } - - /** - * @param String_ $node - */ - public function refactor(Node $node): ?String_ - { - throw new ShouldNotHappenException(sprintf( - '%s is deprecated and renamed to "%s". Use it instead.', - self::class, - SimplifyQuoteEscapeRector::class - )); - } -} diff --git a/rules/Php74/Rector/LNumber/AddLiteralSeparatorToNumberRector.php b/rules/Php74/Rector/LNumber/AddLiteralSeparatorToNumberRector.php deleted file mode 100644 index 48261170523..00000000000 --- a/rules/Php74/Rector/LNumber/AddLiteralSeparatorToNumberRector.php +++ /dev/null @@ -1,98 +0,0 @@ - $configuration - */ - public function configure(array $configuration): void - { - } - - public function getRuleDefinition(): RuleDefinition - { - return new RuleDefinition( - 'Add "_" as thousands separator in numbers for higher or equals to limitValue config', - [ - new ConfiguredCodeSample( - <<<'CODE_SAMPLE' -class SomeClass -{ - public function run() - { - $int = 500000; - $float = 1000500.001; - } -} -CODE_SAMPLE - , - <<<'CODE_SAMPLE' -class SomeClass -{ - public function run() - { - $int = 500_000; - $float = 1_000_500.001; - } -} -CODE_SAMPLE - , - [ - self::LIMIT_VALUE => 1_000_000, - ] - ), - ] - ); - } - - /** - * @return array> - */ - public function getNodeTypes(): array - { - return [Int_::class, Float_::class]; - } - - /** - * @param Int_|Float_ $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '"%s" is deprecated as opinionated and group size depends on context. Cannot be automated. Use manually where needed instead', - self::class - )); - } - - public function provideMinPhpVersion(): int - { - return PhpVersionFeature::LITERAL_SEPARATOR; - } -} diff --git a/rules/Php81/Rector/Array_/FirstClassCallableRector.php b/rules/Php81/Rector/Array_/FirstClassCallableRector.php deleted file mode 100644 index 146d510fd32..00000000000 --- a/rules/Php81/Rector/Array_/FirstClassCallableRector.php +++ /dev/null @@ -1,28 +0,0 @@ -> - */ - public function getNodeTypes(): array - { - return [Class_::class, Interface_::class]; - } - - /** - * @param Class_|Interface_ $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - 'Rule "%s" is deprecated as not used in any set, and discourages from type coverage and leads to worse code. Use type declaration set instead, to actually increase type coverage.', - self::class - )); - } - - /** - * @param mixed[] $configuration - */ - public function configure(array $configuration): void - { - } - - public function provideMinPhpVersion(): int - { - return PhpVersionFeature::RETURN_TYPE_WILL_CHANGE_ATTRIBUTE; - } -} diff --git a/rules/Transform/ValueObject/ClassMethodReference.php b/rules/Transform/ValueObject/ClassMethodReference.php deleted file mode 100644 index 3bbf1b63b61..00000000000 --- a/rules/Transform/ValueObject/ClassMethodReference.php +++ /dev/null @@ -1,31 +0,0 @@ -class; - } - - public function getMethod(): string - { - return $this->method; - } -} diff --git a/rules/TypeDeclaration/Rector/StmtsAwareInterface/IncreaseDeclareStrictTypesRector.php b/rules/TypeDeclaration/Rector/StmtsAwareInterface/IncreaseDeclareStrictTypesRector.php deleted file mode 100644 index ff5a37f5401..00000000000 --- a/rules/TypeDeclaration/Rector/StmtsAwareInterface/IncreaseDeclareStrictTypesRector.php +++ /dev/null @@ -1,77 +0,0 @@ - 10, - ], - ), - ] - ); - } - - /** - * @return array> - */ - public function getNodeTypes(): array - { - return NodeGroup::STMTS_AWARE; - } - - /** - * @param StmtsAware $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '"%s" is deprecated as changes strict types randomly on each run. Use "%s" Rector on specific paths instead.', - self::class, - DeclareStrictTypesRector::class - )); - } - - /** - * @param array $configuration - */ - public function configure(array $configuration): void - { - } -}