diff --git a/config/set/mysql-to-mysqli.php b/config/set/mysql-to-mysqli.php deleted file mode 100644 index 3fd8604f1fa..00000000000 --- a/config/set/mysql-to-mysqli.php +++ /dev/null @@ -1,9 +0,0 @@ -singleton($rectorClass); - $this->tagRectorService($rectorClass); + $this->tag($rectorClass, RectorInterface::class); $this->afterResolving($rectorClass, function (ConfigurableRectorInterface $configurableRector) use ( $rectorClass @@ -200,7 +199,7 @@ public function rule(string $rectorClass): void Assert::isAOf($rectorClass, RectorInterface::class); $this->singleton($rectorClass); - $this->tagRectorService($rectorClass); + $this->tag($rectorClass, RectorInterface::class); if (is_a($rectorClass, AbstractScopeAwareRector::class, true)) { $this->extend( @@ -389,23 +388,6 @@ private function resolveDuplicatedValues(array $values): array return array_unique($duplicates); } - /** - * @param class-string $rectorClass - */ - private function tagRectorService(string $rectorClass): void - { - $this->tag($rectorClass, RectorInterface::class); - - if (is_a($rectorClass, NonPhpRectorInterface::class, true)) { - trigger_error(sprintf( - 'The "%s" interface of "%s" rule is deprecated. Rector will process only PHP code, as designed to with AST. For another file format, use custom tooling.', - NonPhpRectorInterface::class, - $rectorClass, - )); - exit(); - } - } - /** * @param string[] $rectorClasses */ diff --git a/packages/Set/ValueObject/SetList.php b/packages/Set/ValueObject/SetList.php index 12a4188d163..554fa3cefb4 100644 --- a/packages/Set/ValueObject/SetList.php +++ b/packages/Set/ValueObject/SetList.php @@ -36,12 +36,6 @@ final class SetList implements SetListInterface */ public const GMAGICK_TO_IMAGICK = __DIR__ . '/../../../config/set/gmagick-to-imagick.php'; - /** - * @deprecated Handle manually with explicit refactoring instead. - * @var string - */ - public const MYSQL_TO_MYSQLI = __DIR__ . '/../../../config/set/mysql-to-mysqli.php'; - /** * @var string */ diff --git a/phpstan.neon b/phpstan.neon index f39ec55eb37..8a9d77391a4 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -576,8 +576,6 @@ parameters: message: '#Public method "Rector\\Core\\DependencyInjection\\RectorContainerFactory\:\:createFromBootstrapConfigs\(\)" is never used#' path: src/DependencyInjection/RectorContainerFactory.php - - '#Class "Rector\\Renaming\\Rector\\FileWithoutNamespace\\PseudoNamespaceToNamespaceRector" is missing @see annotation with test case class reference#' - # chicken/egg - message: '#Function "(d|dd)\(\)" cannot be used/left in the code#' @@ -592,11 +590,6 @@ parameters: message: '#Do not name "d", shorter than 2 chars#' path: tests/debug_functions.php - # deprecated - - - message: '#Fetching class constant class of deprecated class Rector\\Core\\Contract\\Rector\\NonPhpRectorInterface#' - path: packages/Config/* - # method signature kept for symmetry of hasParentClassMethod() with getParentClassMethod() - message: '#Parameters should use "PhpParser\\Node\\Stmt\\ClassMethod" types as the only types passed to this method#' diff --git a/rules/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php b/rules/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php deleted file mode 100644 index f192a77c67c..00000000000 --- a/rules/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php +++ /dev/null @@ -1,73 +0,0 @@ -> - */ - public function getNodeTypes(): array - { - // property, method - return [FileWithoutNamespace::class, Namespace_::class]; - } - - /** - * @param Namespace_|FileWithoutNamespace $node - */ - public function refactor(Node $node): ?Node - { - $errorMessage = sprintf( - 'Rule "%s" is deprecated, as unreliable and too dynamic. Use more robuts RenameClassRector instead.', - self::class - ); - trigger_error($errorMessage, E_USER_WARNING); - sleep(3); - - return null; - } - - /** - * @param mixed[] $configuration - */ - public function configure(array $configuration): void - { - // for BC - } -} diff --git a/rules/Renaming/ValueObject/PseudoNamespaceToNamespace.php b/rules/Renaming/ValueObject/PseudoNamespaceToNamespace.php deleted file mode 100644 index d1fa6305b96..00000000000 --- a/rules/Renaming/ValueObject/PseudoNamespaceToNamespace.php +++ /dev/null @@ -1,33 +0,0 @@ -namespacePrefix; - } - - /** - * @return string[] - */ - public function getExcludedClasses(): array - { - return $this->excludedClasses; - } -} diff --git a/src/Contract/Rector/NonPhpRectorInterface.php b/src/Contract/Rector/NonPhpRectorInterface.php deleted file mode 100644 index 0c468b762bc..00000000000 --- a/src/Contract/Rector/NonPhpRectorInterface.php +++ /dev/null @@ -1,13 +0,0 @@ -createPHPStanServices($rectorConfig); - // @todo add base node visitors $rectorConfig->when(PhpDocNodeMapper::class) ->needs('$phpDocNodeVisitors') ->giveTagged(BasePhpDocNodeVisitorInterface::class); diff --git a/src/NodeManipulator/IfManipulator.php b/src/NodeManipulator/IfManipulator.php index 050aa2cc9fb..6acd18e5380 100644 --- a/src/NodeManipulator/IfManipulator.php +++ b/src/NodeManipulator/IfManipulator.php @@ -186,16 +186,6 @@ public function isIfWithoutElseAndElseIfs(If_ $if): bool return $if->elseifs === []; } - /** - * @deprecated Create If_ directly, this is simple new with no added value - */ - public function createIfStmt(Expr $condExpr, Stmt $stmt): If_ - { - return new If_($condExpr, [ - 'stmts' => [$stmt], - ]); - } - private function matchComparedAndReturnedNode(NotIdentical $notIdentical, Return_ $return): ?Expr { if ($this->nodeComparator->areNodesEqual(