diff --git a/phpstan.neon b/phpstan.neon index 182522df8d4..0741d929a8e 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -458,9 +458,7 @@ parameters: - tests/PhpParser/NodeTraverser/StopTraverseOnTypeChange/Class_ # deprecated rule - - '#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\\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#' - '#Class "Rector\\CodingStyle\\Rector\\Enum_\\EnumCaseToPascalCaseRector" is missing @see annotation with test case class reference#' diff --git a/rules/Php81/Rector/ClassMethod/NewInInitializerRector.php b/rules/Php81/Rector/ClassMethod/NewInInitializerRector.php deleted file mode 100644 index fe1e4178e7c..00000000000 --- a/rules/Php81/Rector/ClassMethod/NewInInitializerRector.php +++ /dev/null @@ -1,73 +0,0 @@ -logger = $logger ?? new NullLogger; - } -} -CODE_SAMPLE - - , - <<<'CODE_SAMPLE' -class SomeClass -{ - public function __construct( - private ?Logger $logger = new NullLogger, - ) { - } -} -CODE_SAMPLE - ), - ]); - } - - /** - * @return array> - */ - public function getNodeTypes(): array - { - return [Class_::class]; - } - - /** - * @param Class_ $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '"%s" is deprecated as depends on context. Cannot be automated. Use manually or custom rule where needed instead', - self::class - )); - } - - public function provideMinPhpVersion(): int - { - return PhpVersionFeature::NEW_INITIALIZERS; - } -}