2018-09-14 18:01:40 +02:00
includes :
2020-04-25 16:42:43 +02:00
- utils/phpstan-extensions/config/phpstan-extensions.neon
2020-12-24 17:31:24 +01:00
- utils/phpstan-extensions/config/rector-rules.neon
2020-12-11 18:25:42 +01:00
# allows symplify error formatter
2020-04-25 16:42:43 +02:00
- vendor/symplify/phpstan-extensions/config/config.neon
2018-09-14 18:01:40 +02:00
2020-11-09 20:14:57 +07:00
# see https://github.com/symplify/coding-standard
2020-11-16 17:50:38 +00:00
# - vendor/symplify/phpstan-rules/config/configurable-rules.neon
- vendor/symplify/phpstan-rules/config/static-rules.neon
2020-11-17 11:22:53 +00:00
- vendor/symplify/phpstan-rules/config/services/services.neon
2020-11-16 17:50:38 +00:00
- vendor/symplify/phpstan-rules/packages/cognitive-complexity/config/cognitive-complexity-services.neon
2020-12-11 18:25:42 +01:00
- 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
2017-11-06 11:40:43 +01:00
parameters :
2019-12-28 11:33:33 +01:00
level : max
2019-12-08 22:00:38 +01:00
2020-02-06 20:15:36 +01:00
paths :
2020-02-11 14:11:47 +01:00
- bin
2020-02-06 20:15:36 +01:00
- src
2020-02-11 14:11:47 +01:00
- rules
2020-02-06 20:15:36 +01:00
- packages
- tests
2020-05-07 01:10:51 +02:00
- utils
2020-08-25 00:26:14 +02:00
# this cannot be put it, because it wipes PHPStan cache on each run :( - must run in separate
2020-09-23 11:16:40 +02:00
#- config
2020-02-06 20:15:36 +01:00
2020-10-02 12:01:53 +02:00
# 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
2018-09-14 18:01:40 +02:00
excludes_analyse :
2020-10-27 16:51:44 +01:00
- */config.php
2020-10-29 22:34:51 +01:00
- packages/*/config/*
- tests/debug_functions.php
2020-10-27 16:51:44 +01:00
2020-10-25 14:56:11 +01:00
# broken in PHPStan https://github.com/rectorphp/rector/runs/1305002460#step:5:56
2020-10-29 23:06:26 +01:00
- packages/better-php-doc-parser/src/ValueObject/PhpDocNode/AbstractTagValueNode.php
2020-10-31 13:59:40 +01:00
- packages/testing/src/PHPUnit/*.php
2020-11-01 16:57:12 +01:00
- packages/node-type-resolver/tests/NodeVisitor/FunctionMethodAndClassNodeVisitor/FunctionMethodAndClassNodeVisitorTest.php
2021-01-20 00:29:52 +01:00
- rules/downgrade-php70/src/Rector/FunctionLike/AbstractDowngradeParamDeclarationRector.php
2020-10-25 14:56:11 +01:00
2020-05-10 23:02:46 +02:00
# phsptan bug
- utils/phpstan-extensions/src/Rule/KeepRectorNamespaceForRectorRule.php
2020-07-29 00:09:47 +02:00
- packages/rector-generator/templates/*
2020-10-11 16:17:43 +02:00
# this invalidates whole cache everytime
- 'packages/symfony-php-config/*'
- 'packages/simple-php-doc-parser'
2020-05-10 23:02:46 +02:00
2020-04-01 03:55:44 +02:00
# generated files
2020-04-03 15:28:29 +02:00
- 'packages/doctrine-annotation-generated/src/ConstantPreservingDocParser.php'
- 'packages/doctrine-annotation-generated/src/ConstantPreservingAnnotationReader.php'
2019-09-15 20:54:06 +02:00
- "*/Expected/*"
2019-02-21 15:36:16 +01:00
# complex printer
2019-03-09 12:55:17 +00:00
- '*tests/Rector/MethodCall/RenameMethodRector/**/SomeClass.php'
2018-09-14 18:01:40 +02:00
# tests files
2019-03-27 17:46:25 +01:00
- '*tests/*/Fixture/*'
- '*tests/*/Source/*'
- '*tests/Source/*'
2018-10-21 21:43:47 +02:00
# part of composer
2019-05-23 08:02:49 +02:00
- '*/tests/Rector/Psr4/MultipleClassFileToPsr4ClassesRector/Expected/Just*ExceptionWithoutNamespace.php'
2021-01-11 21:12:10 +01:00
- packages/better-php-doc-parser/tests/PhpDocParser/TagValueNodeReprint/Fixture/SymfonyRoute/RouteName.php
2018-09-14 18:01:40 +02:00
2020-08-30 23:29:39 +02:00
# tests
- tests/DependencyInjection/config
2017-11-06 11:40:43 +01:00
ignoreErrors :
2019-02-28 22:50:53 +01:00
- '#Parameter \#1 \$children of class PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocNode constructor expects array<PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocChildNode\>, array<int, PHPStan\\PhpDocParser\\Ast\\Node\> given#'
2019-04-14 00:37:05 +02:00
# known types
2019-05-11 15:22:57 +02:00
- '#Access to an undefined property PhpParser\\Node\\Expr\:\:\$args#'
2019-05-11 15:07:00 +02:00
2020-02-06 22:48:18 +01:00
- '#Parameter \#2 \$name of method Rector\\Core\\Rector\\AbstractRector\:\:isName\(\) expects string, string\|null given#'
2019-05-23 19:32:46 +02:00
2019-09-01 22:38:31 +02:00
# sense-less errors
2019-08-19 16:52:02 +02:00
# PHP 7.4 1_000 support
- '#Property PhpParser\\Node\\Scalar\\DNumber\:\:\$value \(float\) does not accept string#'
2019-11-04 17:30:10 +01:00
2019-12-08 11:03:08 +01:00
-
2020-07-29 01:41:20 +02:00
message : '#Class Rector\\Generic\\Tests\\Rector\\StaticCall\\SwapClassMethodArgumentsRector\\Fixture\\SomeClass not found#'
path : rules/generic/tests/Rector/StaticCall/SwapClassMethodArgumentsRector/SwapClassMethodArgumentsRectorTest.php
2019-12-08 18:01:29 +01:00
2019-12-08 22:00:38 +01:00
# mixed
- '#Offset int\|string\|null does not exist on array<PhpParser\\Node\\Stmt>\|null#'
- '#class-string<T of object>\|T of object#'
2020-03-26 23:22:29 +01:00
- '#Method Rector\\Php80\\Rector\\NotIdentical\\StrContainsRector\:\:matchNotIdenticalToFalse\(\) should return PhpParser\\Node\\Expr\\FuncCall\|null but returns PhpParser\\Node\\Expr#'
2020-03-29 03:35:25 +02:00
2020-04-13 23:44:44 +02:00
# broken
- '#Parameter \#2 \$name of method Rector\\NodeNameResolver\\NodeNameResolver\:\:isName\(\) expects string, string\|null given#'
2020-04-19 19:56:05 +02:00
2020-04-23 23:49:56 +02:00
- '#Parameter \#1 \$funcCall of method Rector\\Php80\\MatchAndRefactor\\StrStartsWithMatchAndRefactor\\AbstractMatchAndRefactor\:\:createStrStartsWithValueObjectFromFuncCall\(\) expects PhpParser\\Node\\Expr\\FuncCall, PhpParser\\Node\\Expr given#'
2020-04-25 16:45:36 +02:00
# mostly strings in tests
2020-05-02 23:25:24 +02:00
- '#Method Rector\\Naming\\Naming\\PropertyNaming\:\:resolveShortClassName\(\) should return string but returns string\|null#'
2020-05-03 16:07:56 +02:00
2020-07-27 08:56:25 +02:00
-
message : "#in iterable type Iterator#"
paths :
- *Test.php
2020-05-03 16:16:10 +02:00
-
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
-
message : "#^Cognitive complexity for \"Rector\\\\PhpSpecToPHPUnit\\\\Rector\\\\MethodCall\\\\PhpSpecPromisesToPHPUnitAssertRector\\:\\:refactor\\(\\)\" is 13, keep it under 9$#"
count : 1
path : rules/php-spec-to-phpunit/src/Rector/MethodCall/PhpSpecPromisesToPHPUnitAssertRector.php
2020-05-07 01:22:02 +02:00
- "#^Cognitive complexity for \"Rector\\\\Php70\\\\EregToPcreTransformer\\:\\:(.*?)\" is (.*?), keep it under 9$#"
2020-05-03 16:16:10 +02:00
2020-05-07 01:22:02 +02:00
- '#Cannot cast PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Identifier to string#'
2020-05-07 01:51:06 +02:00
- '#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#'
2020-05-14 01:34:05 +02:00
- '#Property PhpParser\\Node\\Stmt\\Namespace_\:\:\$stmts \(array<PhpParser\\Node\\Stmt\>\) does not accept array<PhpParser\\Node\>#'
2020-05-17 12:43:03 +02:00
- '#Cognitive complexity for "Rector\\TypeDeclaration\\PHPStan\\Type\\ObjectTypeSpecifier\:\:matchShortenedObjectType\(\)" is 10, keep it under 9#'
2020-05-28 15:40:19 +02:00
- '#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#'
2020-05-28 21:20:16 +02:00
- '#Cognitive complexity for "Rector\\Core\\PhpParser\\Node\\Value\\ValueResolver\:\:getValue\(\)" is \d+, keep it under 9#'
2020-05-30 00:44:36 +02:00
- '#Cognitive complexity for "Rector\\NetteKdyby\\ContributeEventClassResolver\:\:resolveGetterMethodByEventClassAndParam\(\)" is \d+, keep it under 9#'
2020-06-07 10:29:13 +02:00
- '#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#'
2020-07-01 23:41:49 +02:00
- '#Parameter \#1 \$objectType of method Rector\\Naming\\Naming\\PropertyNaming\:\:fqnToVariableName\(\) expects PHPStan\\Type\\ObjectType\|string, PHPStan\\Type\\Type given#'
2020-07-07 21:19:54 +02:00
# known value
- '#Property PhpParser\\Node\\Stmt\\Foreach_\:\:\$valueVar \(PhpParser\\Node\\Expr\) does not accept PhpParser\\Node\\Expr\|null#'
2020-07-12 18:35:56 +02:00
- '#Access to an undefined property PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagValueNode\:\:\$type#'
2021-01-26 02:32:23 +01:00
- '#Content of method "configure\(\)" is duplicated with method "configure\(\)" in "Rector\\Composer\\Rector\\AddPackageToRequireComposerRector" class\. Use unique content or abstract service instead#'
2020-07-13 11:46:55 +02:00
2020-07-22 15:08:40 +02:00
# 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'
2020-07-14 00:22:31 +02:00
- '#Class Rector\\Renaming\\Tests\\Rector\\MethodCall\\RenameMethodRector\\Fixture\\SkipSelfMethodRename not found#'
2020-07-22 15:08:40 +02:00
# fixed in symplfiy dev
-
message : '#Separate function "Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ref\(\)" in method call to standalone row to improve readability#'
path : 'packages/rector-generator/config/config.php'
2020-07-25 00:45:24 +02:00
2020-07-27 08:11:51 +02:00
- '#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#'
2020-07-27 08:56:25 +02:00
# is nested expr
- '#Access to an undefined property PhpParser\\Node\\Expr\:\:\$expr#'
- '#Cognitive complexity for "Rector\\DeadCode\\NodeManipulator\\LivingCodeManipulator\:\:keepLivingCodeFromExpr\(\)" is \d+, keep it under 9#'
2020-07-29 00:09:47 +02:00
- '#Parameter \#1 \$files of method Symplify\\SmartFileSystem\\Finder\\FinderSanitizer\:\:sanitize\(\) expects \(iterable<SplFileInfo\|string\>&Nette\\Utils\\Finder\)\|Symfony\\Component\\Finder\\Finder, array<string\> given#'
2020-08-11 12:59:04 +02:00
# wtf
-
message : '#Else branch is unreachable because ternary operator condition is always true#'
path : 'rules/psr4/src/Composer/PSR4NamespaceMatcher.php'
2020-08-18 17:57:30 +02:00
-
message : '#Class "Rector\\RectorGenerator\\ValueObject\\RectorRecipe" has invalid namespace category "ValueObject"\. Pick one of\: ""#'
path : packages/rector-generator/src/ValueObject/RectorRecipe.php
2020-08-23 11:39:09 +02:00
- '#Parameter \#2 \$currentNode of method Rector\\CodingStyle\\Rector\\Assign\\ManualJsonStringToJsonEncodeArrayRector\:\:matchNextExprAssignConcatToSameVariable\(\) expects PhpParser\\Node\\Expr\\Assign\|PhpParser\\Node\\Expr\\AssignOp\\Concat, PhpParser\\Node given#'
-
2020-08-27 12:19:22 +02:00
message : '#Array (with keys|destruct) is not allowed\. Use value object to pass data instead#'
2020-08-23 11:39:09 +02:00
paths :
# working with cvs file
# 3rd party package
- rules/php70/src/EregToPcreTransformer.php
2020-08-23 15:39:26 +02:00
# template variables
- packages/rector-generator/src/TemplateVariablesFactory.php
# output format to json
- rules/doctrine/src/Collector/UuidMigrationDataCollector.php
2020-08-25 00:26:14 +02:00
2020-08-27 12:19:22 +02:00
-
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'
2020-08-28 23:10:00 +02:00
-
message : '#Use value object over return of values#'
path : 'rules/phpunit/src/Composer/ComposerAutoloadedDirectoryProvider.php'
2020-08-27 12:19:22 +02:00
-
2020-08-28 23:10:00 +02:00
message : '#Use value object over return of values#'
path : 'rules/php70/src/EregToPcreTransformer.php'
2020-08-31 22:32:33 +02:00
2020-12-20 22:05:48 +01:00
# -
# message: '#Instead of "Symfony\\Component\\Finder\\SplFileInfo" class/interface use "Symplify\\SmartFileSystem\\SmartFileInfo"#'
# paths:
# - src/FileSystem/FilesFinder.php
2020-09-24 20:54:39 +02:00
2020-10-01 23:55:10 +07:00
-
2020-10-20 22:27:12 +02:00
message : '#Instead of container injection, use specific service#'
2020-10-01 23:55:10 +07:00
paths :
2020-10-20 22:27:12 +02:00
- src/Configuration/RectorClassesProvider.php
2020-10-01 23:55:10 +07:00
-
2020-10-20 22:27:12 +02:00
message : '#Nested foreach with empty statement is not allowed#'
2020-12-20 22:05:48 +01:00
path : packages/better-php-doc-parser/tests/PhpDocParser/TagValueNodeReprint/TagValueNodeReprintTest.php
2020-10-01 23:55:10 +07:00
-
2020-10-20 22:27:12 +02:00
message : '#Function "dump\(\)" cannot be used/left in the code#'
2020-12-20 22:05:48 +01:00
path : tests/debug_functions.php
2020-10-20 22:27:12 +02:00
- '#Method Rector\\NetteKdyby\\NodeFactory\\EventValueObjectClassFactory\:\:wrapClassToNamespace\(\) should return PhpParser\\Node\\Stmt\\Namespace_ but returns PhpParser\\Node#'
2020-10-01 23:55:10 +07:00
2020-12-20 22:05:48 +01:00
# 3rd party code
2020-10-03 22:09:43 +02:00
-
2020-10-20 22:27:12 +02:00
message : '#Do not use static property#'
2020-12-20 22:05:48 +01:00
path : packages/doctrine-annotation-generated/src/DataCollector/ResolvedConstantStaticCollector.php
2020-10-07 16:20:53 +02:00
2020-10-21 23:06:24 +02:00
- '#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#'
2020-10-26 21:03:26 +07:00
2020-10-29 22:34:51 +01:00
-
message : '#Do not use trait#'
paths :
- packages/better-php-doc-parser/src/Attributes/Attribute/AttributeTrait.php # 7
- packages/better-php-doc-parser/src/PartPhpDocTagPrinter/Behavior/ArrayPartPhpDocTagPrinterTrait.php # 14
- packages/better-php-doc-parser/src/PhpDocNode/PrintTagValueNodeTrait.php # 13
- packages/changes-reporting/src/Rector/AbstractRector/NotifyingRemovingNodeTrait.php # 17
- packages/post-rector/src/Rector/AbstractRector/NodeCommandersTrait.php # 31
2020-12-12 13:08:34 +01:00
- src/Rector/AbstractRector/*
2020-10-29 22:34:51 +01:00
-
2020-11-24 22:32:49 +07:00
message : '#Do not use scalar or array as constructor parameter\. Use "Symplify\\PackageBuilder\\Parameter\\ParameterProvider" service instead#'
2020-10-29 22:34:51 +01:00
paths :
2020-12-12 13:08:34 +01:00
# value objects
- packages/attribute-aware-php-doc/src/Ast/*
2020-10-29 22:34:51 +01:00
- 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
- rules/type-declaration/src/Rector/FunctionLike/ReturnTypeDeclarationRector.php # 82
2020-11-05 04:32:49 +07:00
2020-11-12 20:47:25 +00:00
# trait in trait call
- '#Call to an undefined method Rector\\PostRector\\Rector\\AbstractPostRector\:\:isObjectType\(\)#'
2020-11-13 20:32:18 +00:00
- '#Parameter \#1 \$expr of class PhpParser\\Node\\Stmt\\Expression constructor expects PhpParser\\Node\\Expr, PhpParser\\Node\\Expr\|PhpParser\\Node\\Stmt given#'
2020-11-16 17:50:38 +00:00
-
2020-11-27 21:39:42 +01:00
message : '#Class cognitive complexity is \d+, keep it under \d+#'
2020-11-16 17:50:38 +00:00
paths :
- rules/php70/src/EregToPcreTransformer.php
- packages/node-collector/src/NodeCollector/NodeRepository.php
- packages/node-type-resolver/src/NodeTypeResolver.php
2020-12-25 17:22:19 +01:00
- rules/code-quality-strict/src/Rector/Variable/MoveVariableDeclarationNearReferenceRector.php
2020-11-27 21:39:42 +01:00
- rules/php80/src/Rector/If_/NullsafeOperatorRector.php
- rules/code-quality/src/Rector/For_/ForToForeachRector.php
2021-01-19 18:19:20 +07:00
- rules/phpunit/src/Rector/ClassMethod/TryCatchToExpectExceptionRector.php
2020-11-16 17:50:38 +00:00
# symplify 9
- '#Use decoupled factory service to create "(.*?)" object#'
- '#Use another value object over array with string\-keys and objects, array<string, ValueObject\>#'
- '#Trait method "(.*?)" should not contain any logic, but only delegate to other class call#'
- '#Do not use factory/method call in constructor\. Put factory in config and get service with dependency injection#'
2020-11-16 23:32:24 +00:00
- '#Constant string value need to only have small letters, _, \-, \. and numbers#'
2020-11-16 17:50:38 +00:00
-
message : '#Use explicit names over dynamic ones#'
paths :
- packages/doctrine-annotation-generated/src/PhpDocNode/ConstantReferenceIdentifierRestorer.php # 61
2020-11-23 17:40:29 +07:00
2020-11-24 21:30:17 +00:00
- '#Method Rector\\BetterPhpDocParser\\Tests\\PhpDocInfo\\PhpDocInfo\\PhpDocInfoTest\:\:createPhpDocInfoFromFile\(\) should return Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo but returns Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo\|null#'
2020-12-01 02:09:50 +01:00
2020-12-05 00:22:12 +01:00
-
2020-12-10 00:40:38 +01:00
message : '#"(getComments|getDocComment|setDocComment)\(\)" call on "PhpParser\\Node" type is not allowed#'
2020-12-05 00:22:12 +01:00
paths :
# merging comments
2020-12-10 00:40:38 +01:00
- packages/better-php-doc-parser/tests/PhpDocInfo/PhpDocInfo/PhpDocInfoTest.php
2021-01-28 20:52:11 +01:00
- src/Rector/AbstractTemporaryRector.php
2020-12-05 00:22:12 +01:00
- src/PhpParser/NodeTransformer.php
# playing around with doc block format
2020-12-25 14:20:13 +01:00
- rules/coding-style/src/Rector/Assign/PHPStormVarAnnotationRector.php
2020-12-12 14:53:10 +01:00
- rules/code-quality/src/Rector/Return_/SimplifyUselessVariableRector.php
- rules/dead-code/src/Rector/Expression/RemoveDeadStmtRector.php
2020-12-25 01:56:59 +01:00
- rules/dead-doc-block/src/Rector/Node/RemoveNonExistingVarAnnotationRector.php
2020-12-10 00:40:38 +01:00
- rules/php-spec-to-phpunit/src/Rector/MethodCall/PhpSpecMocksToPHPUnitMocksRector.php
2020-12-05 00:22:12 +01:00
- packages/better-php-doc-parser/src/Comment/CommentsMerger.php
- rules/coding-style/src/Node/DocAliasResolver.php
2021-01-20 17:17:59 +01:00
- packages/comments/src/NodeDocBlock/DocBlockUpdater.php
2020-12-10 00:40:38 +01:00
- packages/better-php-doc-parser/src/PhpDocInfo/PhpDocInfoFactory.php
- packages/better-php-doc-parser/tests/PhpDocInfo/PhpDocInfoPrinter/AbstractPhpDocInfoPrinterTest.php
2020-12-09 23:25:53 +01:00
2020-12-20 22:05:48 +01:00
# 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/*
2020-12-12 13:08:34 +01:00
-
message : '#Do not use setter on a service#'
paths :
- packages/rector-generator/src/Rector/Closure/AddNewServiceToSymfonyPhpConfigRector.php
2020-12-20 22:05:48 +01:00
- src/Configuration/Configuration.php
2020-12-28 14:01:27 +01:00
# prevent circular dependnecy
- packages/static-type-mapper/src/Naming/NameScopeFactory.php
2020-12-12 14:53:10 +01:00
2020-12-20 22:05:48 +01:00
# class-string vs string
- '#Parameter \#1 \$expected of method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) expects class\-string<object\>, string given#'
2020-12-12 14:53:10 +01:00
2020-12-20 22:05:48 +01:00
-
message : '#Cannot cast array<string\>\|bool\|string\|null to string#'
paths :
- utils/node-documentation-generator/src/Command/DumpNodesCommand.php
- src/Configuration/Configuration.php
- src/Console/Command/ProcessCommand.php
2020-12-20 13:50:55 +01:00
2020-12-20 22:05:48 +01:00
- '#Method (.*?) should return array<PhpParser\\Node\\(.*?)\> but returns array<PhpParser\\Node\>#'
- '#Parameter \#1 (.*?) expects Symfony\\Component\\DependencyInjection\\ContainerBuilder, Symfony\\Component\\DependencyInjection\\ContainerInterface given#'
2020-12-20 13:50:55 +01:00
-
2020-12-20 22:05:48 +01:00
message : '#Strict comparison using \=\=\= between PhpParser\\Node and null will always evaluate to false#'
2020-12-20 13:50:55 +01:00
paths :
2020-12-20 22:05:48 +01:00
# looping
- src/PhpParser/Node/BetterNodeFinder.php
# intersection
- '#Property Rector\\TypeDeclaration\\TypeInferer\\ReturnTypeInferer\:\:\$returnTypeInferers \(array<Rector\\TypeDeclaration\\Contract\\TypeInferer\\ReturnTypeInfererInterface\>\) does not accept array<Rector\\TypeDeclaration\\Contract\\TypeInferer\\PriorityAwareTypeInfererInterface\>#'
- '#Property Rector\\TypeDeclaration\\TypeInferer\\PropertyTypeInferer\:\:\$propertyTypeInferers \(array<Rector\\TypeDeclaration\\Contract\\TypeInferer\\PropertyTypeInfererInterface\>\) does not accept array<Rector\\TypeDeclaration\\Contract\\TypeInferer\\PriorityAwareTypeInfererInterface\>#'
- '#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 :
2020-12-20 13:50:55 +01:00
- rules/php80/src/Rector/If_/NullsafeOperatorRector.php
2020-12-20 22:05:48 +01:00
###################################################
- '#should return ReflectionClassConstant\|null but returns ReflectionClassConstant\|false#'
- '#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<PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagNode\>, array<PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagNode\|Rector\\BetterPhpDocParser\\Contract\\PhpDocNode\\AttributeAwareNodeInterface\> 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<PhpParser\\Node\\Stmt\>, array<PhpParser\\Node\> given#'
-
message : '#Call to function is_string\(\) with float will always evaluate to false#'
path : src/PhpParser/Printer/BetterStandardPrinter.php
2020-12-21 03:12:42 +01:00
# known values from other methods
-
message : '#Negated boolean expression is always true#'
2021-01-16 20:11:11 +01:00
path : rules/php-spec-to-phpunit/src/NodeFactory/AssertMethodCallFactory.php
2020-12-21 03:12:42 +01:00
-
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/*
- '#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#'
- '#Cognitive complexity for "Rector\\CodeQuality\\Rector\\If_\\SimplifyIfIssetToNullCoalescingRector\:\:shouldSkip\(\)" is 10, keep it under 9#'
- '#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#'
2021-01-19 18:19:20 +07:00
paths :
- bin/rector.php
- src/Rector/AbstractRector/NodeTypeResolverTrait.php
- rules/php70/src/Rector/FuncCall/MultiDirnameRector.php
2020-12-21 03:12:42 +01:00
# @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
2020-12-24 00:44:16 +01:00
- '#Cognitive complexity for "Rector\\Php80\\NodeResolver\\SwitchExprsResolver\:\:resolve\(\)" is \d+, keep it under 9#'
2020-12-24 20:20:16 +07:00
-
message : '#".*" regex need to use string named capture group instead of numeric#'
paths :
- packages/better-php-doc-parser/src/PhpDocParser/BetterPhpDocParser.php #268
- rules/php70/src/EregToPcreTransformer.php #277
2020-12-24 23:16:27 +01:00
2021-01-11 18:12:46 +07:00
-
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
- rules/symfony/tests/Rector/MethodCall/AbstractToConstructorInjectionRectorSource/SomeTranslator.php #9
- rules/transform/tests/Rector/MethodCall/MethodCallToStaticCallRector/AnotherDependency.php #7
2021-01-08 23:30:33 +01:00
# 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<T of PhpParser\\Node\> but returns array<PhpParser\\Node\>#'
- '#Parameter \#1 \$nodes of method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder<PhpParser\\Node\>\:\:findFirst\(\) expects array<PhpParser\\Node\>\|PhpParser\\Node, array<PhpParser\\Node\\Stmt\>\|null given#'
- '#Parameter \#2 \$type of method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder<T of PhpParser\\Node\>\:\:findInstanceOfName\(\) expects class\-string<T of PhpParser\\Node\>, string given#'
- '#Method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:findVariableOfName\(\) should return PhpParser\\Node\\Expr\\Variable\|null but returns T of PhpParser\\Node\|null#'
2021-01-11 21:12:10 +01:00
# fixed in php-parser master
- '#Method Rector\\SymfonyCodeQuality\\NodeFactory\\RouteNameClassFactory\:\:create\(\) should return PhpParser\\Node\\Stmt\\Namespace_ but returns PhpParser\\Node#'
2021-01-12 14:41:47 +01:00
- '#Parameter \#4 \$classWithConstants of class Rector\\Privatization\\ValueObject\\ReplaceStringWithClassConstant constructor expects class\-string, string given#'
2021-01-13 14:02:14 +01:00
2021-01-15 21:27:36 +01:00
- '#Method Rector\\BetterPhpDocParser\\Tests\\PhpDocParser\\AbstractPhpDocInfoTest\:\:parseFileAndGetFirstNodeOfType\(\) should return T of PhpParser\\Node but returns PhpParser\\Node#'
-
message : '#new <class\> is limited to 3 "new <class\>\(new <class\>\)\)" 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#'
2021-01-16 20:11:11 +01:00
2021-01-16 22:45:18 +01:00
-
message : '#Class Rector\\RemovingStatic\\Tests\\Rector\\Property\\DesiredPropertyClassMethodTypeToDynamicRector\\Fixture\\StaticProperty not found#'
paths :
- rules/removing-static/tests/Rector/Property/DesiredPropertyClassMethodTypeToDynamicRector/config/some_config.php
2021-01-17 16:43:47 +01:00
2021-01-26 02:51:31 +01:00
- '#Content of method "configure\(\)" is duplicated with method "configure\(\)" in "Rector\\Composer\\Rector\\AddPackageToRequireComposerRector" class\. Use unique content or abstract service instead#'
2021-01-18 11:07:57 +01:00
2021-01-18 22:45:13 +01:00
- '#Content of method "getFunctionLikePhpDocInfo\(\)" is duplicated with method "getFunctionLikePhpDocInfo\(\)" in "Rector\\TypeDeclaration\\TypeInferer\\ParamTypeInferer\\PHPUnitDataProviderParamTypeInferer" class\. Use unique content or abstract service instead#'
2021-01-19 02:15:32 +01:00
- '#Parameter \#1 \$type of method Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo\:\:hasByType\(\) expects class\-string<PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagValueNode\>, string given#'
2021-01-19 16:03:26 +01:00
- '#Method Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo\:\:findAllByType\(\) should return array<T of PHPStan\\PhpDocParser\\Ast\\Node\> but returns array<int, PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagNode\|\(PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagValueNode&T of PHPStan\\PhpDocParser\\Ast\\Node\)\>#'
2021-01-21 21:58:26 +01:00
# buggy phpstan clas-string
- '#Method (.*?) should return class\-string but returns string#'
2021-01-23 00:11:10 +01:00
-
2021-01-28 22:48:01 +07:00
message : '#\$this as argument is not allowed\. Refactor method to service composition#'
2021-01-23 00:11:10 +01:00
paths :
2021-01-28 20:52:11 +01:00
- src/Rector/AbstractTemporaryRector.php
2021-01-23 00:11:10 +01:00
# 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
2021-01-27 23:00:42 +07:00
- '#Class Rector\\NodeTypeResolver\\Tests\\PerNodeTypeResolver\\PropertyFetchTypeResolver\\Source\\IDontExist not found\.#'
- '#Class A\\B\\C\\IDontExist not found\.#'
2021-01-28 22:48:01 +07:00
-
message : '#Use non\-dynamic property on static call#'
path : packages/better-php-doc-parser/src/AnnotationReader/AnnotationReaderFactory.php #56
2021-01-28 20:52:11 +01:00
# todo - skip in Symplify if imlements an interface
-
message : '#There should be no empty class#'
path : src/Rector/AbstractRector.php