includes: - utils/phpstan-extensions/config/phpstan-extensions.neon - utils/phpstan-extensions/config/rector-rules.neon # allows symplify error formatter - vendor/symplify/phpstan-extensions/config/config.neon # see https://github.com/symplify/coding-standard # - vendor/symplify/phpstan-rules/config/configurable-rules.neon - vendor/symplify/phpstan-rules/config/static-rules.neon - vendor/symplify/phpstan-rules/config/services/services.neon - vendor/symplify/phpstan-rules/packages/cognitive-complexity/config/cognitive-complexity-services.neon - vendor/symplify/phpstan-rules/config/array-rules.neon - vendor/symplify/phpstan-rules/config/code-complexity-rules.neon - vendor/symplify/phpstan-rules/config/doctrine-rules.neon - vendor/symplify/phpstan-rules/config/naming-rules.neon - vendor/symplify/phpstan-rules/config/regex-rules.neon - vendor/symplify/phpstan-rules/config/services-rules.neon - vendor/symplify/phpstan-rules/config/size-rules.neon - vendor/symplify/phpstan-rules/config/forbidden-static-rules.neon - vendor/symplify/phpstan-rules/config/string-to-constant-rules.neon - vendor/symplify/phpstan-rules/config/symfony-rules.neon - vendor/symplify/phpstan-rules/config/test-rules.neon parameters: level: max paths: - ecs.php - rector.php - bin - src - rules - packages - tests - utils # this cannot be put it, because it wipes PHPStan cache on each run :( - must run in separate #- config # to allow installing with various phsptan versions without reporting old errors here bootstrapFiles: - vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php scanDirectories: - stubs reportUnmatchedIgnoredErrors: false checkGenericClassInNonGenericObjectType: false excludes_analyse: - */config.php - packages/*/config/* - tests/debug_functions.php # broken in PHPStan https://github.com/rectorphp/rector/runs/1305002460#step:5:56 - packages/better-php-doc-parser/src/ValueObject/PhpDocNode/AbstractTagValueNode.php - packages/testing/src/PHPUnit/*.php - packages/node-type-resolver/tests/NodeVisitor/FunctionMethodAndClassNodeVisitor/FunctionMethodAndClassNodeVisitorTest.php - rules/downgrade-php70/src/Rector/FunctionLike/AbstractDowngradeParamDeclarationRector.php # phsptan bug - packages/rector-generator/templates/* # this invalidates whole cache everytime - 'packages/symfony-php-config/*' - 'packages/simple-php-doc-parser' # generated files - 'packages/doctrine-annotation-generated/src/ConstantPreservingDocParser.php' - 'packages/doctrine-annotation-generated/src/ConstantPreservingAnnotationReader.php' - "*/Expected/*" # complex printer - '*tests/Rector/MethodCall/RenameMethodRector/**/SomeClass.php' # tests files - '*tests/*/Fixture/*' - '*tests/*/Source/*' - '*tests/Source/*' # part of composer - '*/tests/Rector/Psr4/MultipleClassFileToPsr4ClassesRector/Expected/Just*ExceptionWithoutNamespace.php' - packages/better-php-doc-parser/tests/PhpDocParser/TagValueNodeReprint/Fixture/SymfonyRoute/RouteName.php # tests - tests/DependencyInjection/config ignoreErrors: - '#Parameter \#1 \$children of class PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocNode constructor expects array, array given#' # PHP 7.4 1_000 support - '#Property PhpParser\\Node\\Scalar\\DNumber\:\:\$value \(float\) does not accept string#' # mixed - '#Offset int\|string\|null does not exist on array\|null#' - '#class-string\|T of object#' - '#Method Rector\\Php80\\Rector\\NotIdentical\\StrContainsRector\:\:matchNotIdenticalToFalse\(\) should return PhpParser\\Node\\Expr\\FuncCall\|null but returns PhpParser\\Node\\Expr#' # broken - '#Parameter \#2 \$name of method Rector\\NodeNameResolver\\NodeNameResolver\:\:isName\(\) expects string, string\|null given#' # mostly strings in tests - '#Method Rector\\Naming\\Naming\\PropertyNaming\:\:resolveShortClassName\(\) should return string but returns string\|null#' - message: "#in iterable type Iterator#" paths: - *Test.php - message: "#^Cognitive complexity for \"Rector\\\\BetterPhpDocParser\\\\Printer\\\\WhitespaceDetector\\:\\:detectOldWhitespaces\\(\\)\" is 18, keep it under 9$#" count: 1 path: packages/better-php-doc-parser/src/Printer/WhitespaceDetector.php - '#Parameter \#1 \$node of method Rector\\PostRector\\Collector\\NodesToAddCollector\:\:wrapToExpression\(\) expects PhpParser\\Node\\Expr\|PhpParser\\Node\\Stmt, PhpParser\\Node given#' - '#Access to an undefined property PhpParser\\Node\\Expr\:\:\$class#' - '#Property PhpParser\\Node\\Stmt\\Namespace_\:\:\$stmts \(array\) does not accept array#' - '#Cognitive complexity for "Rector\\Php80\\NodeResolver\\SwitchExprsResolver\:\:resolve\(\)" is \d+, keep it under 9#' - message: "#^Cognitive complexity for \"Rector\\\\PhpSpecToPHPUnit\\\\Rector\\\\MethodCall\\\\PhpSpecPromisesToPHPUnitAssertRector\\:\\:refactor\\(\\)\" is 13, keep it under 9$#" path: rules/php-spec-to-phpunit/src/Rector/MethodCall/PhpSpecPromisesToPHPUnitAssertRector.php - message: '#Class cognitive complexity is \d+, keep it under \d+#' paths: - rules/php70/src/EregToPcreTransformer.php - packages/node-collector/src/NodeCollector/NodeRepository.php - packages/node-type-resolver/src/NodeTypeResolver.php - rules/code-quality-strict/src/Rector/Variable/MoveVariableDeclarationNearReferenceRector.php - rules/php80/src/Rector/If_/NullsafeOperatorRector.php - "#^Cognitive complexity for \"Rector\\\\Php70\\\\EregToPcreTransformer\\:\\:(.*?)\" is (.*?), keep it under 9$#" - '#Cognitive complexity for "Rector\\CodeQuality\\Rector\\If_\\SimplifyIfIssetToNullCoalescingRector\:\:shouldSkip\(\)" is 10, keep it under 9#' - '#Cognitive complexity for "Rector\\TypeDeclaration\\PHPStan\\Type\\ObjectTypeSpecifier\:\:matchShortenedObjectType\(\)" is 10, keep it under 9#' - '#Cognitive complexity for "Rector\\Core\\PhpParser\\Node\\Value\\ValueResolver\:\:getValue\(\)" is \d+, keep it under 9#' - '#Cognitive complexity for "Rector\\NetteKdyby\\ContributeEventClassResolver\:\:resolveGetterMethodByEventClassAndParam\(\)" is \d+, keep it under 9#' - '#Cognitive complexity for "Rector\\DeadCode\\NodeManipulator\\LivingCodeManipulator\:\:keepLivingCodeFromExpr\(\)" is \d+, keep it under 9#' - message: '#Class cognitive complexity is \d+, keep it under 50#' paths: - packages/node-name-resolver/src/NodeNameResolver.php - '#Parameter \#1 \$type of method PhpParser\\Builder\\FunctionLike\:\:setReturnType\(\) expects PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|string, PhpParser\\Node\\Identifier\|PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|PhpParser\\Node\\UnionType given#' - '#Parameter \#1 \$type of class PhpParser\\Node\\NullableType constructor expects PhpParser\\Node\\Identifier\|PhpParser\\Node\\Name\|string, PhpParser\\Node\\Identifier\|PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|PhpParser\\Node\\UnionType given#' - '#Parameter \#1 \$objectType of method Rector\\Naming\\Naming\\PropertyNaming\:\:fqnToVariableName\(\) expects PHPStan\\Type\\ObjectType\|string, PHPStan\\Type\\Type given#' # known value - '#Property PhpParser\\Node\\Stmt\\Foreach_\:\:\$valueVar \(PhpParser\\Node\\Expr\) does not accept PhpParser\\Node\\Expr\|null#' - '#Access to an undefined property PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagValueNode\:\:\$type#' # only local use - message: '#Class "Rector\\RectorGenerator\\Rector\\Closure\\AddNewServiceToSymfonyPhpConfigRector" is missing @see annotation with test case class reference#' path: 'packages/rector-generator/src/Rector/Closure/AddNewServiceToSymfonyPhpConfigRector.php' - '#Parameter \#1 \$variable of class Rector\\Php70\\ValueObject\\VariableAssignPair constructor expects PhpParser\\Node\\Expr\\ArrayDimFetch\|PhpParser\\Node\\Expr\\PropertyFetch\|PhpParser\\Node\\Expr\\StaticPropertyFetch\|PhpParser\\Node\\Expr\\Variable, PhpParser\\Node\\Expr given#' # is nested expr - '#Access to an undefined property PhpParser\\Node\\Expr\:\:\$expr#' - '#Parameter \#1 \$files of method Symplify\\SmartFileSystem\\Finder\\FinderSanitizer\:\:sanitize\(\) expects \(iterable&Nette\\Utils\\Finder\)\|Symfony\\Component\\Finder\\Finder, array given#' # wtf - message: '#Else branch is unreachable because ternary operator condition is always true#' path: 'rules/psr4/src/Composer/PSR4NamespaceMatcher.php' - message: '#Class "Rector\\RectorGenerator\\ValueObject\\RectorRecipe" has invalid namespace category "ValueObject"\. Pick one of\: ""#' path: packages/rector-generator/src/ValueObject/RectorRecipe.php - '#Parameter \#2 \$currentNode of method Rector\\CodingStyle\\Rector\\Assign\\ManualJsonStringToJsonEncodeArrayRector\:\:matchNextExprAssignConcatToSameVariable\(\) expects PhpParser\\Node\\Expr\\Assign\|PhpParser\\Node\\Expr\\AssignOp\\Concat, PhpParser\\Node given#' - message: '#Array (with keys|destruct) is not allowed\. Use value object to pass data instead#' paths: # working with cvs file # 3rd party package - rules/php70/src/EregToPcreTransformer.php # template variables - packages/rector-generator/src/TemplateVariablesFactory.php # output format to json - rules/doctrine/src/Collector/UuidMigrationDataCollector.php - message: '#Use explicit return value over magic &reference#' paths: # 3rd party code - rules/php70/src/EregToPcreTransformer.php # symfony/console - message: '#Use explicit return value over magic &reference#' path: 'rules/dead-code/src/Rector/BinaryOp/RemoveDuplicatedInstanceOfRector.php' - message: '#Use value object over return of values#' path: 'rules/phpunit/src/Composer/ComposerAutoloadedDirectoryProvider.php' - message: '#Use value object over return of values#' path: 'rules/php70/src/EregToPcreTransformer.php' - message: '#Nested foreach with empty statement is not allowed#' path: packages/better-php-doc-parser/tests/PhpDocParser/TagValueNodeReprint/TagValueNodeReprintTest.php - message: '#Function "dump\(\)" cannot be used/left in the code#' path: tests/debug_functions.php - '#Method Rector\\NetteKdyby\\NodeFactory\\EventValueObjectClassFactory\:\:wrapClassToNamespace\(\) should return PhpParser\\Node\\Stmt\\Namespace_ but returns PhpParser\\Node#' - '#Parameter \#1 \$node of method Rector\\DeadCode\\Rector\\Plus\\RemoveDeadZeroAndOneOperationRector\:\:refactor\(\) expects PhpParser\\Node\\Expr\\AssignOp\\Div\|PhpParser\\Node\\Expr\\AssignOp\\Minus\|PhpParser\\Node\\Expr\\AssignOp\\Mul\|PhpParser\\Node\\Expr\\AssignOp\\Plus\|PhpParser\\Node\\Expr\\BinaryOp\\Div\|PhpParser\\Node\\Expr\\BinaryOp\\Minus\|PhpParser\\Node\\Expr\\BinaryOp\\Mul\|PhpParser\\Node\\Expr\\BinaryOp\\Plus, PhpParser\\Node\\Expr\\AssignOp\|PhpParser\\Node\\Expr\\BinaryOp given#' - message: '#Do not use trait#' paths: - packages/better-php-doc-parser/src/**/*Trait.php # 7 - message: '#Do not use scalar or array as constructor parameter\. Use "Symplify\\PackageBuilder\\Parameter\\ParameterProvider" service instead#' paths: # value objects - packages/attribute-aware-php-doc/src/Ast/* - packages/better-php-doc-parser/src/PhpDocInfo/PhpDocInfo.php # 108 - rules/coding-style/src/Rector/ClassMethod/YieldClassMethodToArrayClassMethodRector.php # 47 - rules/php70/src/EregToPcreTransformer.php # 66 # trait in trait call - '#Parameter \#1 \$expr of class PhpParser\\Node\\Stmt\\Expression constructor expects PhpParser\\Node\\Expr, PhpParser\\Node\\Expr\|PhpParser\\Node\\Stmt given#' # symplify 9 - '#Use decoupled factory service to create "(.*?)" object#' - '#Use another value object over array with string\-keys and objects, array#' - '#Do not use factory/method call in constructor\. Put factory in config and get service with dependency injection#' - '#Constant string value need to only have small letters, _, \-, \. and numbers#' - message: '#Use explicit names over dynamic ones#' paths: - packages/doctrine-annotation-generated/src/PhpDocNode/ConstantReferenceIdentifierRestorer.php # 61 - '#Method Rector\\BetterPhpDocParser\\Tests\\PhpDocInfo\\PhpDocInfo\\PhpDocInfoTest\:\:createPhpDocInfoFromFile\(\) should return Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo but returns Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo\|null#' - message: '#"(getComments|getDocComment|setDocComment)\(\)" call on "PhpParser\\Node" type is not allowed#' paths: # merging comments - packages/better-php-doc-parser/tests/PhpDocInfo/PhpDocInfo/PhpDocInfoTest.php - src/PhpParser/NodeTransformer.php - src/Rector/AbstractRector.php # playing around with doc block format - packages/comments/src/CommentRemover.php - rules/coding-style/src/Rector/Assign/PHPStormVarAnnotationRector.php - rules/code-quality/src/Rector/Return_/SimplifyUselessVariableRector.php - rules/dead-code/src/Rector/Expression/RemoveDeadStmtRector.php - rules/dead-doc-block/src/Rector/Node/RemoveNonExistingVarAnnotationRector.php - rules/php-spec-to-phpunit/src/Rector/MethodCall/PhpSpecMocksToPHPUnitMocksRector.php - packages/better-php-doc-parser/src/Comment/CommentsMerger.php - rules/coding-style/src/Node/DocAliasResolver.php - packages/comments/src/NodeDocBlock/DocBlockUpdater.php - packages/better-php-doc-parser/src/PhpDocInfo/PhpDocInfoFactory.php - packages/better-php-doc-parser/tests/PhpDocInfo/PhpDocInfoPrinter/AbstractPhpDocInfoPrinterTest.php # false positives checked in another method - message: '#If condition is always false#' paths: - rules/renaming/src/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php - rules/code-quality/src/Rector/Concat/JoinStringConcatRector.php - rules/php80/src/Rector/Switch_/ChangeSwitchToMatchRector.php - packages/node-nesting-scope/src/NodeFinder/ScopeAwareNodeFinder.php # internal generating Rector - message: '#Class "Rector\\Utils\\DoctrineAnnotationParserSyncer\\Rector\\(.*?)" is missing @see annotation with test case class reference#' paths: - utils/doctrine-annotation-parser-syncer/src/Rector/* - message: '#Do not use setter on a service#' paths: - packages/rector-generator/src/Rector/Closure/AddNewServiceToSymfonyPhpConfigRector.php - src/Configuration/Configuration.php # prevent circular dependnecy - packages/static-type-mapper/src/Naming/NameScopeFactory.php # class-string vs string - '#Parameter \#1 \$expected of method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) expects class\-string, string given#' - message: '#Cannot cast array\|bool\|string\|null to string#' paths: - src/Configuration/Configuration.php - src/Console/Command/ProcessCommand.php - '#Method (.*?) should return array but returns array#' - '#Parameter \#1 (.*?) expects Symfony\\Component\\DependencyInjection\\ContainerBuilder, Symfony\\Component\\DependencyInjection\\ContainerInterface given#' # intersection - '#Property Rector\\TypeDeclaration\\TypeInferer\\ReturnTypeInferer\:\:\$returnTypeInferers \(array\) does not accept array#' - '#Property Rector\\TypeDeclaration\\TypeInferer\\PropertyTypeInferer\:\:\$propertyTypeInferers \(array\) does not accept array#' - '#Access to an undefined property PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Expr\\Variable\:\:\$name#' # @todo loop magic, resolve later - message: '#Access to an undefined property PhpParser\\Node\:\:\$expr#' paths: - rules/php80/src/Rector/If_/NullsafeOperatorRector.php ################################################### - '#Method "evaluateBinaryToVersionCompareCondition\(\)" returns bool type, so the name should start with is/has/was#' # soo many false positive naming - fix later with Recto rule - '#Method "(.*?)\(\)" returns bool type, so the name should start with is/has/was#' - message: '#Comparison operation "<" between 0 and 2 is always true#' paths: - rules/php70/src/Rector/FuncCall/MultiDirnameRector.php - '#PHPDoc tag @param for parameter \$node with type float is incompatible with native type PhpParser\\Node#' # intersection mess - '#Parameter \#1 \$phpDocTagNodes of method Rector\\PHPUnit\\NodeFactory\\ExpectExceptionMethodCallFactory\:\:createFromTagValueNodes\(\) expects array, array given#' # false postives - '#Parameter \#2 \$right of class PhpParser\\Node\\Expr\\BinaryOp\\Spaceship constructor expects PhpParser\\Node\\Expr, PhpParser\\Node\\Expr\|null given#' - '#Parameter \#1 \$stmts of class Rector\\Core\\PhpParser\\Node\\CustomNode\\FileWithoutNamespace constructor expects array, array given#' - message: '#Call to function is_string\(\) with float will always evaluate to false#' path: src/PhpParser/Printer/BetterStandardPrinter.php # known values from other methods - message: '#Negated boolean expression is always true#' path: rules/php-spec-to-phpunit/src/NodeFactory/AssertMethodCallFactory.php - message: '#Call to function in_array\(\) with arguments string, array\(\) and true will always evaluate to false#' path: rules/php56/src/Rector/FunctionLike/AddDefaultValueForUndefinedVariableRector.php - message: '#Parameter \#1 \$left of class PhpParser\\Node\\Expr\\BinaryOp\\Spaceship constructor expects PhpParser\\Node\\Expr, PhpParser\\Node\\Expr\|null given#' path: rules/php70/src/Rector/If_/IfToSpaceshipRector.php - '#PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Expr\\Variable given#' # unable to test, because the method is final - '#Class "Rector\\Nette\\Rector\\Class_\\MoveFinalGetUserToCheckRequirementsClassMethodRector" is missing @see annotation with test case class reference#' # type juggling - '#AttributeAwareNodeInterface#' - message: '#Use `\$class\-\>namespaceName` instead of `\$class\-\>name` that only returns short class name#' paths: - rules/coding-style/src/Naming/NameRenamer.php - packages/node-name-resolver/src/NodeNameResolver/ClassNameResolver.php - message: '#Property with protected modifier is not allowed\. Use interface contract method instead#' paths: - rules/defluent/src/ValueObject/* - src/Rector/AbstractRector.php - '#Parameter \#1 \$keyName of method Rector\\AttributeAwarePhpDoc\\Ast\\Type\\AttributeAwareArrayShapeItemNode\:\:createKeyWithSpacePattern\(\) expects PHPStan\\PhpDocParser\\Ast\\ConstExpr\\ConstExprIntegerNode\|PHPStan\\PhpDocParser\\Ast\\Type\\IdentifierTypeNode\|null, PHPStan\\PhpDocParser\\Ast\\ConstExpr\\ConstExprIntegerNode\|PHPStan\\PhpDocParser\\Ast\\ConstExpr\\ConstExprStringNode\|PHPStan\\PhpDocParser\\Ast\\Type\\IdentifierTypeNode\|null given#' - '#AttributeAwarePhpDocNode#' - '#Method Rector\\CodeQuality\\Rector\\Foreach_\\SimplifyForeachToCoalescingRector\:\:matchReturnOrAssignNode\(\) should return PhpParser\\Node\\Expr\\Assign\|PhpParser\\Node\\Stmt\\Return_\|null but returns PhpParser\\Node\|null#' - '#Instanceof between PhpParser\\Node\\Stmt and Rector\\Core\\PhpParser\\Node\\CustomNode\\FileWithoutNamespace will always evaluate to false#' - message: '#Use value object over multi array assign#' paths: - packages/node-collector/src/NodeCollector/ParsedClassConstFetchNodeCollector.php # @todo improvate later - '#Access to an undefined property PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagValueNode\:\:\$description#' - message: '#Unreachable statement \- code above always terminates#' paths: - bin/rector.php - rules/php70/src/Rector/FuncCall/MultiDirnameRector.php # @todo fix later - message: '#Property with protected modifier is not allowed\. Use interface contract method instead#' paths: - rules/naming/src/Guard/PropertyConflictingNameGuard/AbstractPropertyConflictingNameGuard.php - rules/naming/src/PropertyRenamer/AbstractPropertyRenamer.php - message: '#There should be no empty class#' paths: - packages/static-type-mapper/src/ValueObject/Type/ParentStaticType.php #9 - packages/static-type-mapper/src/ValueObject/Type/SelfObjectType.php #9 - rules/symfony/tests/Rector/MethodCall/AbstractToConstructorInjectionRectorSource/SomeEntityManager.php #7 - rules/symfony/tests/Rector/MethodCall/AbstractToConstructorInjectionRectorSource/SomeNonKernelClass.php #7 # generics nullable bugs - '#Method (.*?) should return T of PhpParser\\Node\|null but returns PhpParser\\Node\|null#' - '#Method (.*?) should return T of PhpParser\\Node\|null but returns PhpParser\\Node#' - '#Method (.*?) should return (.*?)\|null but returns PhpParser\\Node\|null#' - '#Method (.*?) should return array but returns array#' - '#Parameter \#1 \$nodes of method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:findFirst\(\) expects array\|PhpParser\\Node, array\|null given#' - '#Parameter \#2 \$type of method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:findInstanceOfName\(\) expects class\-string, string given#' - '#Method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:findVariableOfName\(\) should return PhpParser\\Node\\Expr\\Variable\|null but returns T of PhpParser\\Node\|null#' # fixed in php-parser master - '#Method Rector\\SymfonyCodeQuality\\NodeFactory\\RouteNameClassFactory\:\:create\(\) should return PhpParser\\Node\\Stmt\\Namespace_ but returns PhpParser\\Node#' - '#Parameter \#4 \$classWithConstants of class Rector\\Privatization\\ValueObject\\ReplaceStringWithClassConstant constructor expects class\-string, string given#' - '#Method Rector\\BetterPhpDocParser\\Tests\\PhpDocParser\\AbstractPhpDocInfoTest\:\:parseFileAndGetFirstNodeOfType\(\) should return T of PhpParser\\Node but returns PhpParser\\Node#' - message: '#new is limited to 3 "new \(new \)\)" nesting to each other\.#' paths: - config/set/* - '#Class with base "FileNode" name is already used in "PHPStan\\Node\\FileNode", "Rector\\Core\\PhpParser\\Node\\CustomNode\\FileNode"\. Use unique name to make classes easy to recognize#' - message: '#Class Rector\\RemovingStatic\\Tests\\Rector\\Property\\DesiredPropertyClassMethodTypeToDynamicRector\\Fixture\\StaticProperty not found#' paths: - rules/removing-static/tests/Rector/Property/DesiredPropertyClassMethodTypeToDynamicRector/config/some_config.php # buggy phpstan clas-string - '#Method (.*?) should return class\-string but returns string#' - message: '#\$this as argument is not allowed\. Refactor method to service composition#' paths: - src/Rector/AbstractRector.php # setter to avoid circular dependency in nested collector - rules/nette-code-quality/src/NodeResolver/MethodNamesByInputNamesResolver.php - packages/static-type-mapper/src/StaticTypeMapper.php - packages/better-php-doc-parser/src/Attributes/Ast/AttributeAwareNodeFactory.php - packages/phpstan-static-type-mapper/src/PHPStanStaticTypeMapper.php # refactor later - packages/better-php-doc-parser/src/PhpDocParser/BetterPhpDocParser.php - '#Class Rector\\NodeTypeResolver\\Tests\\PerNodeTypeResolver\\PropertyFetchTypeResolver\\Source\\IDontExist not found\.#' - '#Class A\\B\\C\\IDontExist not found\.#' - message: '#Use non\-dynamic property on static call#' path: packages/better-php-doc-parser/src/AnnotationReader/AnnotationReaderFactory.php #56 - '#Method Rector\\BetterPhpDocParser\\PhpDocNodeFactory\\MultiPhpDocNodeFactory\:\:getTagValueNodeClassesToAnnotationClasses\(\) should return array, class\-string\> but returns array#' - message: '#Use value object over return of values#' path: packages/better-php-doc-parser/src/PhpDocNodeFactory/MultiPhpDocNodeFactory.php - message: '#Use defined constant Symplify\\ComposerJsonManipulator\\ValueObject\\ComposerJsonSection\:\:REQUIRE over string require#' paths: # is "require" in PHP - src/Php/ReservedKeywordAnalyzer.php - '#Class Acme\\Bar\\DoNotUpdateExistingTargetNamespace not found#' - '#Class Acme\\Foo\\DoNotUpdateExistingTargetNamespace not found#' - '#Method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:findParentType\(\) should return T of PhpParser\\Node\|null but returns class\-string\|T of PhpParser\\Node#' - message: '#Namespace "Rector\\Composer\\Tests\\Rector" is only reserved for "Rector"\. Move the class somewhere else#' path: rules/composer/tests/Rector/AbstractComposerRectorTestCase.php - '#Class with base "SetList" name is already used in "Symplify\\EasyCodingStandard\\ValueObject\\Set\\SetList", "Rector\\Set\\ValueObject\\SetList"\. Use unique name to make classes easy to recognize#' - '#Class with base "PhpVersion" name is already used in "PHPStan\\Php\\PhpVersion", "Rector\\Core\\ValueObject\\PhpVersion"\. Use unique name to make classes easy to recognize#' - message: '#For complex configuration use value object over array#' paths: - '*/config/configured_rule.php' - message: '#Use local named constant instead of inline string for regex to explain meaning by constant name#' paths: - packages/better-php-doc-parser/src/Printer/ArrayPartPhpDocTagPrinter.php - message: '#Do not use static property#' paths: - packages/doctrine-annotation-generated/src/DataCollector/ResolvedConstantStaticCollector.php # tracy::$maxDepth - tests/bootstrap.php # known values - '#Method Rector\\Testing\\Finder\\RectorsFinder\:\:findClassesInDirectoriesByName\(\) should return array but returns array#' - '#Property PhpParser\\Node\\Param\:\:\$type \(PhpParser\\Node\\Identifier\|PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|PhpParser\\Node\\UnionType\|null\) does not accept PhpParser\\Node#' - message: '#"%s" in sprintf\(\) format must be quoted#' paths: - packages/attribute-aware-php-doc/src/Ast/PhpDoc/AttributeAwareParamTagValueNode.php - '#Property Rector\\Core\\PhpParser\\Node\\AssignAndBinaryMap\:\:\$binaryOpToAssignClasses \(array, class\-string\>\) does not accept array#' - '#Content of method "configure\(\)" is duplicated with method "configure\(\)" in "Rector\\RemovingStatic\\Rector\\Class_\\PassFactoryToUniqueObjectRector" class\. Use unique content or abstract service instead#' - message: '#Function "class_exists\(\)" cannot be used/left in the code#' paths: - packages/testing/src/Finder/RectorsFinder.php - packages/better-php-doc-parser/src/AnnotationReader/AnnotationReaderFactory.php - message: '#Function "property_exists\(\)" cannot be used/left in the code#' paths: # on PhpParser Nodes - src/NodeManipulator/ClassMethodAssignManipulator.php - rules/php80/src/Rector/If_/NullsafeOperatorRector.php - packages/node-type-resolver/src/NodeVisitor/FunctionMethodAndClassNodeVisitor.php - packages/node-name-resolver/src/NodeNameResolver.php - packages/node-type-resolver/src/PHPStan/Scope/PHPStanNodeScopeResolver.php - packages/node-name-resolver/src/NodeNameResolver/ClassNameResolver.php - packages/node-type-resolver/src/NodeVisitor/StatementNodeVisitor.php - packages/better-php-doc-parser/src/Printer/PhpDocInfoPrinter.php - packages/better-php-doc-parser/src/Printer/MultilineSpaceFormatPreserver.php - message: '#Function "class_implements\(\)" cannot be used/left in the code#' paths: - rules/symfony/src/ValueObject/ServiceMap/ServiceMap.php - message: '#Instead of "ReflectionClass" class/interface use "PHPStan\\Reflection\\ClassReflection"#' paths: # own classes - packages/rector-generator/src/Provider/SetsListProvider.php - packages/testing/src/Finder/RectorsFinder.php - packages/static-type-mapper/src/TypeFactory/UnionTypeFactory.php - packages/set/src/RectorSetProvider.php - packages/rector-generator/src/Provider/NodeTypesProvider.php - '#Method Rector\\TypeDeclaration\\PhpParserTypeAnalyzer\:\:unwrapNullableAndToString\(\) should return string but returns string\|null#' - '#Cognitive complexity for "Rector\\DeadCode\\UnusedNodeResolver\\ClassUnusedPrivateClassMethodResolver\:\:filterOutParentAbstractMethods\(\)" is 10, keep it under 9#' # known types - '#Call to an undefined method PHPStan\\Type\\ConstantType\:\:getValue\(\)#' - '#Method Rector\\BetterPhpDocParser\\AnnotationReader\\NodeAnnotationReader\:\:getNativePropertyReflection\(\) should return ReflectionProperty\|null but return statement is missing#' - '#Parameter \#1 \$node of method Rector\\NetteKdyby\\Naming\\VariableNaming\:\:resolveFromMethodCall\(\) expects PhpParser\\Node\\Expr\\MethodCall\|PhpParser\\Node\\Expr\\NullsafeMethodCall\|PhpParser\\Node\\Expr\\StaticCall, PhpParser\\Node given#' - '#Parameter \#1 \$stmts of method Rector\\EarlyReturn\\Rector\\Return_\\PreparedValueToEarlyReturnRector\:\:collectIfs\(\) expects array, array given#' - '#Access to an undefined property PhpParser\\Node\\FunctionLike\|PhpParser\\Node\\Stmt\\If_\:\:\$stmts#' - '#Method Rector\\NetteKdyby\\DataProvider\\EventAndListenerTreeProvider\:\:getListeningClassMethodsInEventSubscriberByClass\(\) should return array\> but returns array\>#' - message: '#Function "get_declared_classes\(\)" cannot be used/left in the code#' paths: - rules/restoration/src/ClassMap/ExistingClassesProvider.php - message: '#Parameter \#1 \$types of method Rector\\Defluent\\NodeAnalyzer\\FluentCallStaticTypeResolver\:\:filterOutAlreadyPresentParentClasses\(\) expects array, array given#' paths: - rules/defluent/src/NodeAnalyzer/FluentCallStaticTypeResolver.php - '#Cognitive complexity for "Rector\\CodeQuality\\Rector\\Isset_\\IssetOnPropertyObjectToPropertyExistsRector\:\:refactor\(\)" is \d+, keep it under 9#' # needed for native reflection parameter reference - message: '#Instead of "ReflectionFunction" class/interface use "PHPStan\\Reflection\\FunctionReflection"#' paths: - packages/read-write/src/Guard/VariableToConstantGuard.php - '#Cognitive complexity for "Rector\\NetteCodeQuality\\FormControlTypeResolver\\MagicNetteFactoryInterfaceFormControlTypeResolver\:\:resolve\(\)" is 12, keep it under 9#' - '#Content of method "matchAssignExprToPropertyName\(\)" is duplicated with method "matchAssignExprToPropertyName\(\)" in "Rector\\TypeDeclaration\\AlreadyAssignDetector\\ConstructorAssignDetector" class\. Use unique content or abstract service instead#' # make more tolerand, e.g. at least 2-3 lines - '#Content of method "isConflicting\(\)" is duplicated with method "isConflicting\(\)" in "Rector\\Naming\\Guard\\PropertyConflictingNameGuard\\UnderscoreCamelCaseConflictingNameGuard" class\. Use unique content or abstract service instead#' - message: '#Offset 0 does not exist on array\|null#' paths: - rules/naming/src/Naming/PropertyNaming.php - message: '#Parameter \#1 \$value of function count expects array\|Countable, array\|null given#' paths: - rules/naming/src/Naming/PropertyNaming.php - message: '#Use quoted string in constructor "new PHPStan\\Type\\ObjectType\(\)" argument on position 0 instead of "\:\:class\. It prevent scoping of the class in building prefixed package#' paths: - packages/node-type-resolver/tests - '#Content of method "configure\(\)" is duplicated with method "configure\(\)" in "Rector\\Composer\\Rector\\AddPackageToRequireComposerRector" class\. Use unique content or service instead#' - '#Content of method "getFunctionLikePhpDocInfo\(\)" is duplicated with method "getFunctionLikePhpDocInfo\(\)" in "Rector\\TypeDeclaration\\TypeInferer\\ParamTypeInferer\\PHPUnitDataProviderParamTypeInferer" class\. Use unique content or service instead#' - '#PHPDoc tag @return with type PhpParser\\Node\\Stmt\\ClassMethod\|PhpParser\\Node\\Stmt\\Function_\|Rector\\Naming\\Matcher\\Closure\|null is not subtype of native type PhpParser\\Node\\FunctionLike\|null#' - message: '#Do not use "array_filter" function with complex content, make it more readable with extracted method or single\-line statement#' paths: - src/Application/ActiveRectorsProvider.php - '#Content of method "getIfNextReturn\(\)" is duplicated with method "getIfNextReturn\(\)" in "Rector\\EarlyReturn\\NodeFactory\\InvertedIfFactory" class\. Use unique content or service instead#' - '#Content of method "matchReturnMethodCall\(\)" is duplicated with method "matchReturnMethodCall\(\)" in "Rector\\Defluent\\Rector\\Return_\\ReturnFluentChainMethodCallToNormalMethodCallRector" class\. Use unique content or service instead#' - '#Content of method "matchReturnMethodCall\(\)" is duplicated with method "matchReturnMethodCall\(\)" in "Rector\\Defluent\\Rector\\Return_\\ReturnNewFluentChainMethodCallToNonFluentRector" class\. Use unique content or service instead#' - '#Content of method "decoratePropertyWithDocBlock\(\)" is duplicated with method "decoratePropertyWithDocBlock\(\)" in "Rector\\DowngradePhp74\\Rector\\Property\\DowngradeTypedPropertyRector" class\. Use unique content or service instead#' - message: '#Argument and options "debug" got confused#' paths: - src/Console/Command/ProcessCommand.php - message: '#Class cognitive complexity is 31, keep it under 30#' paths: - src/Rector/AbstractRector.php