diff --git a/phpstan.neon b/phpstan.neon index 4f70a86cf5f..78c2471c135 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -436,6 +436,7 @@ parameters: # 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#' + - '#Class "Rector\\CodingStyle\\Rector\\String_\\SymplifyQuoteEscapeRector" is missing @see annotation with test case class reference#' - '#Access to constant on deprecated class Rector\\Php81\\Rector\\Array_\\FirstClassCallableRector#' - message: '#Only abstract classes can be extended#' diff --git a/rules/CodingStyle/Rector/String_/SymplifyQuoteEscapeRector.php b/rules/CodingStyle/Rector/String_/SymplifyQuoteEscapeRector.php new file mode 100644 index 00000000000..36a7c021ae4 --- /dev/null +++ b/rules/CodingStyle/Rector/String_/SymplifyQuoteEscapeRector.php @@ -0,0 +1,71 @@ +> + */ + 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 + )); + } +}