@@ -10,7 +10,7 @@ parameters:
1010
1111 # see https://phpstan.org/writing-php-code/phpdoc-types#global-type-aliases
1212 typeAliases :
13- StmtsAware : \PhpParser\Node\Stmt\Block | \PhpParser\Node\Expr\Closure | \PhpParser\Node\Stmt\Case_ | \PhpParser\Node\Stmt\Catch_ | \PhpParser\Node\Stmt\ClassMethod | \PhpParser\Node\Stmt\Do_ | \PhpParser\Node\Stmt\Else_ | \PhpParser\Node\Stmt\ElseIf_ | \PhpParser\Node\Stmt\Finally_ | \PhpParser\Node\Stmt\For_ | \PhpParser\Node\Stmt\Foreach_ | \PhpParser\Node\Stmt\Function_ | \PhpParser\Node\Stmt\If_ | \PhpParser\Node\Stmt\Namespace_ | \PhpParser\Node\Stmt\TryCatch | \PhpParser\Node\Stmt\While_ | \Rector\PhpParser\Node\CustomNode\FileWithoutNamespace
13+ StmtsAware : \PhpParser\Node\Stmt\Block | \PhpParser\Node\Expr\Closure | \PhpParser\Node\Stmt\Case_ | \PhpParser\Node\Stmt\Catch_ | \PhpParser\Node\Stmt\ClassMethod | \PhpParser\Node\Stmt\Do_ | \PhpParser\Node\Stmt\Else_ | \PhpParser\Node\Stmt\ElseIf_ | \PhpParser\Node\Stmt\Finally_ | \PhpParser\Node\Stmt\For_ | \PhpParser\Node\Stmt\Foreach_ | \PhpParser\Node\Stmt\Function_ | \PhpParser\Node\Stmt\If_ | \PhpParser\Node\Stmt\Namespace_ | \PhpParser\Node\Stmt\TryCatch | \PhpParser\Node\Stmt\While_ | \Rector\PhpParser\Node\FileNode
1414
1515 # requires exact closure types
1616 checkMissingCallableSignature : true
@@ -160,6 +160,8 @@ parameters:
160160 - src/Validation/RectorConfigValidator.php
161161 # for phpunit version check
162162 - src/Testing/PHPUnit/AbstractLazyTestCase.php
163+ # future node class exists check
164+ - src/Reporting/DeprecatedRulesReporter.php
163165
164166 # use of internal phpstan classes
165167 -
@@ -187,8 +189,10 @@ parameters:
187189 message : ' #Method Rector\\Util\\ArrayParametersMerger\:\:mergeLeftToRightWithCallable\(\) has parameter \$mergeCallback with no signature specified for callable#'
188190 path : src/Util/ArrayParametersMerger.php
189191
190- # fixture class
191- - ' #Class "Rector\\Tests\\Issues\\ScopeNotAvailable\\Variable\\ArrayItemForeachValueRector" is missing @see annotation with test case class reference #'
192+ # fixture Rector rules
193+ -
194+ identifier : symplify.seeAnnotationToTest
195+ path : tests/Issues/
192196
193197 # classes are part of *.php.inc fixture
194198 -
@@ -284,7 +288,6 @@ parameters:
284288 - src/Configuration/RectorConfigBuilder.php
285289 - src/Reporting/DeprecatedRulesReporter.php
286290 identifier : classConstant.deprecatedInterface
287- - ' #Class Rector\\PhpParser\\Node\\CustomNode\\FileWithoutNamespace implements deprecated interface Rector\\Contract\\PhpParser\\Node\\StmtsAwareInterface #'
288291
289292 # allowed internally only
290293 -
@@ -324,6 +327,11 @@ parameters:
324327 - ' #expects array<PhpParser\\Node\\Stmt> , array<PhpParser\\Node> given #'
325328 - ' #should return non\-empty\-string but returns string #'
326329
330+ # known non-empty class method
331+ -
332+ message : ' #Offset 0 might not exist on array<PhpParser\\Node\\Stmt>\|null#'
333+ path : rules/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector.php
334+
327335 # false positive, can accept non-class string
328336 - '#Parameter \#1 \$name of method PHPStan\\BetterReflection\\Reflection\\Adapter\\ReflectionClass\:\:getAttributes\ (\ ) expects class\-string\|null , string given #'
329337
@@ -391,12 +399,6 @@ parameters:
391399 paths :
392400 - rules/Php70/Rector/If_/IfToSpaceshipRector.php
393401
394- # handles full file
395- -
396- paths :
397- - rules/TypeDeclaration/Rector/StmtsAwareInterface/IncreaseDeclareStrictTypesRector.php
398- identifier : rector.noOnlyNullReturnInRefactor
399-
400402 -
401403 identifier : rector.noIntegerRefactorReturn
402404 paths :
@@ -409,22 +411,22 @@ parameters:
409411 # condition check, just to be sure
410412 - '#Method Rector\\Rector\\AbstractRector\:\:enterNode\ (\ ) never returns 3 so it can be removed from the return type #'
411413
412- # special case, working on a file-level
413- -
414- identifier : rector.noOnlyNullReturnInRefactor
415- path : rules/TypeDeclaration/Rector/StmtsAwareInterface/DeclareStrictTypesRector.php
416-
417- # handle next with FileNode
418- -
419- identifier : method.parentMethodFinalByPhpDoc
420- path : rules/TypeDeclaration/Rector/StmtsAwareInterface/DeclareStrictTypesRector.php
421-
422414 # deprecated
423415 -
424416 identifier : public.method.unused
425417 paths :
426418 - rules/Transform/ValueObject/ClassMethodReference.php
427419 - rules/CodeQuality/ValueObject/KeyAndExpr.php
420+ -
421+ identifier : symplify.forbiddenExtendOfNonAbstractClass
422+ path : src/PhpParser/Node/FileNode.php
423+ -
424+ identifier : method.deprecatedClass
425+ path : src/PhpParser/Node/FileNode.php
426+
427+ -
428+ identifier : class.extendsDeprecatedClass
429+ path : src/PhpParser/Node/FileNode.php
428430
429431 -
430432 identifier : public.classConstant.unused
@@ -433,13 +435,32 @@ parameters:
433435 - rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php
434436 - rules/Php81/Enum/AttributeName.php
435437
438+ -
439+ identifier : symplify.seeAnnotationToTest
440+ paths :
441+ - tests/PhpParser/NodeTraverser/StopTraverseOnTypeChange/Class_
442+
436443 # deprecated rule
437444 - ' #Rule Rector\\Php81\\Rector\\Array_\\FirstClassCallableRector must implements Rector\\VersionBonding\\Contract\\MinPhpVersionInterface #'
438445 - ' #Register "Rector\\Php81\\Rector\\Array_\\FirstClassCallableRector" service to "php81\.php" config set #'
439446 - ' #Class "Rector\\CodingStyle\\Rector\\String_\\SymplifyQuoteEscapeRector" is missing @see annotation with test case class reference #'
440447 - ' #Access to constant on deprecated class Rector\\Php81\\Rector\\Array_\\FirstClassCallableRector #'
448+
449+ # BC layer for FileWithoutNamespace node
450+ - message : ' #Use @see \\Rector\\PhpParser\\Node\\FileNode instead#'
451+ - ' #BC layer for FileNode and FileWithoutNamespace compat , use FileNode instead #'
452+ -
453+ path : src/PhpParser/Node/CustomNode/FileWithoutNamespace.php
454+ identifier : symplify.forbiddenExtendOfNonAbstractClass
441455 -
442456 message : ' #Only abstract classes can be extended#'
443457 path : rules/Php81/Rector/Array_/FirstClassCallableRector.php
444458
459+ - '#Method Rector\\Tests\\Issues\\FileWithoutNamespaceCompat\\Rector\\SubscribedToFileWithoutNamespaceRector\:\:refactor\ (\ ) should return Rector\\PhpParser\\Node\\FileNode but returns Rector\\PhpParser\\Node\\CustomNode\\FileWithoutNamespace #'
445460
461+ # BC layer for FileWithoutNamespace node
462+ - message : ' #Use @see \\Rector\\PhpParser\\Node\\FileNode instead#'
463+ - ' #Class Rector\\PhpParser\\Node\\CustomNode\\FileWithoutNamespace extends final class Rector\\PhpParser\\Node\\FileNode #'
464+ -
465+ path : src/PhpParser/Node/CustomNode/FileWithoutNamespace.php
466+ identifier : symplify.forbiddenExtendOfNonAbstractClass
0 commit comments