2018-09-14 18:01:40 +02:00
includes :
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
2021-04-28 11:33:25 +02:00
- vendor/symplify/phpstan-rules/config/forbidden-static-rules.neon
- vendor/symplify/phpstan-rules/config/generic-rules.neon
2020-12-11 18:25:42 +01:00
- vendor/symplify/phpstan-rules/config/naming-rules.neon
- vendor/symplify/phpstan-rules/config/regex-rules.neon
- vendor/symplify/phpstan-rules/config/services-rules.neon
2021-04-28 11:33:25 +02:00
- vendor/symplify/phpstan-rules/config/static-rules.neon
2020-12-11 18:25:42 +01:00
- vendor/symplify/phpstan-rules/config/size-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 :
2021-02-08 13:33:17 +01:00
- ecs.php
- rector.php
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
- 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
2021-03-12 02:21:29 +01:00
- packages/BetterPhpDocParser/ValueObject/PhpDocNode/AbstractTagValueNode.php
- packages/Testing/PHPUnit/*.php
- packages-tests/NodeVisitor/FunctionMethodAndClassNodeVisitor/FunctionMethodAndClassNodeVisitorTest.php
2021-03-12 23:20:25 +01:00
- rules/DowngradePhp70/Rector/FunctionLike/AbstractDowngradeParamDeclarationRector.php
2020-05-10 23:02:46 +02:00
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-03-12 02:21:29 +01:00
- packages-tests/BetterPhpDocPraser/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-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 22:00:38 +01:00
# mixed
- '#Offset int\|string\|null does not exist on array<PhpParser\\Node\\Stmt>\|null#'
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#'
2021-04-26 01:12:14 +02:00
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
2021-03-20 16:27:18 +01:00
- '#Cognitive complexity for "Rector\\Php80\\NodeResolver\\SwitchExprsResolver\:\:resolve\(\)" is (.*?), keep it under 9#'
2021-02-28 08:47:48 +01:00
2021-02-09 02:52:35 +01:00
-
message : "#^Cognitive complexity for \"Rector\\\\PhpSpecToPHPUnit\\\\Rector\\\\MethodCall\\\\PhpSpecPromisesToPHPUnitAssertRector\\:\\:refactor\\(\\)\" is 13, keep it under 9$#"
2021-03-12 23:20:25 +01:00
path : rules/PhpSpecToPHPUnit/Rector/MethodCall/PhpSpecPromisesToPHPUnitAssertRector.php
2021-02-28 08:47:48 +01:00
2021-02-09 02:52:35 +01:00
-
message : '#Class cognitive complexity is \d+, keep it under \d+#'
paths :
2021-03-12 23:20:25 +01:00
- rules/Php70/EregToPcreTransformer.php
2021-03-12 02:21:29 +01:00
- packages/NodeCollector/NodeCollector/NodeRepository.php
- packages/NodeTypeResolver/NodeTypeResolver.php
2021-03-12 23:20:25 +01:00
- rules/CodeQualityStrict/Rector/Variable/MoveVariableDeclarationNearReferenceRector.php
- rules/Php80/Rector/If_/NullsafeOperatorRector.php
2021-03-20 16:27:18 +01:00
- rules/Renaming/NodeManipulator/ClassRenamer.php
2021-04-04 18:40:55 +07:00
- rules/DowngradePhp72/Rector/FuncCall/DowngradePregUnmatchedAsNullConstantRector.php
2021-02-28 08:47:48 +01:00
2021-02-09 02:52:35 +01:00
- "#^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#'
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 21:20:16 +02:00
- '#Cognitive complexity for "Rector\\Core\\PhpParser\\Node\\Value\\ValueResolver\:\:getValue\(\)" is \d+, keep it under 9#'
2021-02-09 00:42:47 +01:00
- '#Cognitive complexity for "Rector\\DeadCode\\NodeManipulator\\LivingCodeManipulator\:\:keepLivingCodeFromExpr\(\)" is \d+, keep it under 9#'
2021-03-23 12:49:40 +01:00
- '#Cognitive complexity for "Rector\\Transform\\Rector\\Class_\\AddInterfaceByParentRector\:\:refactor\(\)" is \d+, keep it under 9#'
2021-02-09 00:42:47 +01:00
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#'
2020-07-13 11:46:55 +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#'
2021-02-09 00:42:47 +01:00
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 :
# 3rd party package
2021-03-12 23:20:25 +01:00
- rules/Php70/EregToPcreTransformer.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
2021-03-12 23:20:25 +01:00
- rules/Php70/EregToPcreTransformer.php
2020-08-27 12:19:22 +02:00
# symfony/console
-
2020-08-28 23:10:00 +02:00
message : '#Use value object over return of values#'
2021-03-12 23:20:25 +01:00
path : 'rules/Php70/EregToPcreTransformer.php'
2020-08-31 22:32:33 +02:00
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#'
2021-03-12 02:21:29 +01:00
path : packages-tests/BetterPhpDocParser/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
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-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\>#'
- '#Do not use factory/method call in constructor\. Put factory in config and get service with dependency injection#'
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 :
- src/PhpParser/NodeTransformer.php
2021-03-03 22:28:27 +01:00
- src/Rector/AbstractRector.php
2020-12-05 00:22:12 +01:00
# playing around with doc block format
2021-03-12 02:21:29 +01:00
- packages/Comments/CommentRemover.php
2021-03-12 23:20:25 +01:00
- rules/CodingStyle/Rector/Assign/PHPStormVarAnnotationRector.php
- rules/CodeQuality/Rector/Return_/SimplifyUselessVariableRector.php
- rules/DeadCode/Rector/Expression/RemoveDeadStmtRector.php
2021-03-21 13:57:56 +01:00
- rules/DeadCode/Rector/Node/RemoveNonExistingVarAnnotationRector.php
2021-03-12 23:20:25 +01:00
- rules/PhpSpecToPHPUnit/Rector/MethodCall/PhpSpecMocksToPHPUnitMocksRector.php
- rules/CodingStyle/Node/DocAliasResolver.php
2021-03-12 02:21:29 +01:00
- packages/BetterPhpDocParser/Comment/CommentsMerger.php
- packages/Comments/NodeDocBlock/DocBlockUpdater.php
- packages/BetterPhpDocParser/PhpDocInfo/PhpDocInfoFactory.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 :
2021-03-12 23:20:25 +01:00
- rules/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php
- rules/CodeQuality/Rector/Concat/JoinStringConcatRector.php
- rules/Php80/Rector/Switch_/ChangeSwitchToMatchRector.php
2021-03-12 02:21:29 +01:00
- packages/NodeNestingScope/NodeFinder/ScopeAwareNodeFinder.php
2020-12-20 22:05:48 +01:00
2020-12-12 13:08:34 +01:00
-
message : '#Do not use setter on a service#'
paths :
2020-12-20 22:05:48 +01:00
- src/Configuration/Configuration.php
2020-12-28 14:01:27 +01:00
# prevent circular dependnecy
2021-03-12 02:21:29 +01:00
- packages/StaticTypeMapper/Naming/NameScopeFactory.php
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 :
- src/Configuration/Configuration.php
- src/Console/Command/ProcessCommand.php
2021-04-25 21:43:59 +02:00
- src/Console/Command/InitCommand.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
# 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
-
2021-04-15 22:44:58 +02:00
message : '#Access to an undefined property PhpParser\\Node\:\:\$expr#'
paths :
2021-03-12 23:20:25 +01:00
- rules/Php80/Rector/If_/NullsafeOperatorRector.php
2020-12-20 22:05:48 +01:00
- '#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 :
2021-03-12 23:20:25 +01:00
- rules/Php70/Rector/FuncCall/MultiDirnameRector.php
2021-03-20 16:27:18 +01:00
# - '#PHPDoc tag @param for parameter \$node with type float is incompatible with native type PhpParser\\Node#'
2020-12-20 22:05:48 +01:00
# false postives
- '#Parameter \#2 \$right of class PhpParser\\Node\\Expr\\BinaryOp\\Spaceship constructor expects PhpParser\\Node\\Expr, PhpParser\\Node\\Expr\|null 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-03-12 23:20:25 +01:00
path : rules/PhpSpecToPHPUnit/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#'
2021-03-12 23:20:25 +01:00
path : rules/Php56/Rector/FunctionLike/AddDefaultValueForUndefinedVariableRector.php
2020-12-21 03:12:42 +01:00
-
message : '#Parameter \#1 \$left of class PhpParser\\Node\\Expr\\BinaryOp\\Spaceship constructor expects PhpParser\\Node\\Expr, PhpParser\\Node\\Expr\|null given#'
2021-03-12 23:20:25 +01:00
path : rules/Php70/Rector/If_/IfToSpaceshipRector.php
2020-12-21 03:12:42 +01:00
- '#PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Expr\\Variable given#'
-
2021-04-15 22:44:58 +02:00
message : '#Use `\$class\-\>namespaceName` instead of `\$class\-\>name` that only returns short class name#'
paths :
- rules/CodingStyle/Naming/NameRenamer.php
- packages/NodeNameResolver/NodeNameResolver/ClassNameResolver.php
2020-12-21 03:12:42 +01:00
-
message : '#Property with protected modifier is not allowed\. Use interface contract method instead#'
paths :
2021-03-12 23:20:25 +01:00
- rules/Defluent/ValueObject/*
2020-12-21 03:12:42 +01:00
- '#Method Rector\\CodeQuality\\Rector\\Foreach_\\SimplifyForeachToCoalescingRector\:\:matchReturnOrAssignNode\(\) should return PhpParser\\Node\\Expr\\Assign\|PhpParser\\Node\\Stmt\\Return_\|null but returns PhpParser\\Node\|null#'
2021-02-09 02:52:35 +01:00
2020-12-21 03:12:42 +01:00
- '#Instanceof between PhpParser\\Node\\Stmt and Rector\\Core\\PhpParser\\Node\\CustomNode\\FileWithoutNamespace will always evaluate to false#'
-
message : '#Unreachable statement \- code above always terminates#'
2021-01-19 18:19:20 +07:00
paths :
- bin/rector.php
2021-03-12 23:20:25 +01:00
- rules/Php70/Rector/FuncCall/MultiDirnameRector.php
2020-12-21 03:12:42 +01:00
-
2021-03-17 19:59:47 +01:00
message : '#Function "class_exists\(\)" cannot be used/left in the code#'
2020-12-21 03:12:42 +01:00
paths :
2021-03-17 19:59:47 +01:00
- bin/rector.php
2021-04-16 17:29:04 +02:00
- src/Bootstrap/ExtensionConfigResolver.php
2020-12-21 03:12:42 +01:00
2021-03-17 19:59:47 +01:00
-
message : '#Do not use static property#'
path : 'bin/rector.php'
# @todo fix later
2021-01-11 18:12:46 +07:00
-
message : '#There should be no empty class#'
paths :
2021-04-26 01:12:14 +02:00
- packages/StaticTypeMapper/ValueObject/Type/*Type.php
2021-01-11 18:12:46 +07:00
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\>#'
2021-01-11 21:12:10 +01:00
# fixed in php-parser master
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-15 21:27:36 +01:00
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-03-03 22:28:27 +01:00
- src/Rector/AbstractRector.php
2021-01-23 00:11:10 +01:00
# setter to avoid circular dependency in nested collector
2021-03-12 02:21:29 +01:00
- packages/StaticTypeMapper/StaticTypeMapper.php
- packages/PHPStanStaticTypeMapper/PHPStanStaticTypeMapper.php
2021-01-23 00:11:10 +01:00
# refactor later
2021-01-27 23:00:42 +07:00
2021-01-31 21:06:14 +01:00
-
2021-02-01 00:31:33 +01:00
message : '#Use defined constant Symplify\\ComposerJsonManipulator\\ValueObject\\ComposerJsonSection\:\:REQUIRE over string require#'
paths :
# is "require" in PHP
- src/Php/ReservedKeywordAnalyzer.php
2021-02-04 04:30:40 +07:00
2021-02-08 02:04:48 +01:00
- '#Method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:findParentType\(\) should return T of PhpParser\\Node\|null but returns class\-string<T of PhpParser\\Node\>\|T of PhpParser\\Node#'
2021-02-22 21:05:33 +01:00
-
message : '#"%s" in sprintf\(\) format must be quoted#'
paths :
2021-03-20 16:27:18 +01:00
- packages/BetterPhpDocParser/ValueObject/PhpDoc/VariadicAwareParamTagValueNode.php
2021-02-23 02:25:34 +01:00
- '#Property Rector\\Core\\PhpParser\\Node\\AssignAndBinaryMap\:\:\$binaryOpToAssignClasses \(array<class\-string<PhpParser\\Node\\Expr\\BinaryOp\>, class\-string<PhpParser\\Node\\Expr\\BinaryOp\>\>\) does not accept array#'
2021-02-28 08:47:48 +01:00
-
2021-04-15 22:44:58 +02:00
message : '#Function "property_exists\(\)" cannot be used/left in the code#'
paths :
# on PhpParser Nodes
- src/NodeManipulator/ClassMethodAssignManipulator.php
- rules/Php80/Rector/If_/NullsafeOperatorRector.php
- packages/NodeTypeResolver/NodeVisitor/FunctionMethodAndClassNodeVisitor.php
- packages/NodeTypeResolver/NodeVisitor/StatementNodeVisitor.php
- packages/NodeNameResolver/NodeNameResolver.php
- packages/NodeNameResolver/NodeNameResolver/ClassNameResolver.php
- packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php
2021-02-28 08:47:48 +01:00
# known types
- '#Call to an undefined method PHPStan\\Type\\ConstantType\:\:getValue\(\)#'
- '#Parameter \#1 \$stmts of method Rector\\EarlyReturn\\Rector\\Return_\\PreparedValueToEarlyReturnRector\:\:collectIfs\(\) expects array<PhpParser\\Node\\Stmt\\If_\>, array<PhpParser\\Node\\Stmt\> given#'
- '#Access to an undefined property PhpParser\\Node\\FunctionLike\|PhpParser\\Node\\Stmt\\If_\:\:\$stmts#'
-
message : '#Function "get_declared_classes\(\)" cannot be used/left in the code#'
paths :
2021-03-12 23:20:25 +01:00
- rules/Restoration/ClassMap/ExistingClassesProvider.php
2021-02-28 08:47:48 +01:00
-
message : '#Parameter \#1 \$types of method Rector\\Defluent\\NodeAnalyzer\\FluentCallStaticTypeResolver\:\:filterOutAlreadyPresentParentClasses\(\) expects array<class\-string\>, array<int, string\> given#'
paths :
2021-03-12 23:20:25 +01:00
- rules/Defluent/NodeAnalyzer/FluentCallStaticTypeResolver.php
2021-02-28 08:47:48 +01:00
- '#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 :
2021-03-12 02:21:29 +01:00
- packages/ReadWrite/Guard/VariableToConstantGuard.php
2021-02-28 08:47:48 +01:00
2021-03-03 20:34:32 +01:00
-
message : '#Argument and options "debug" got confused#'
paths :
- src/Console/Command/ProcessCommand.php
2021-03-03 22:28:27 +01:00
2021-03-07 22:07:50 +01:00
- '#Parameter \#2 \$returnedStrictTypeNode of method Rector\\TypeDeclaration\\Rector\\ClassMethod\\ReturnTypeFromStrictTypedCallRector\:\:refactorSingleReturnType\(\) expects PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|PhpParser\\Node\\UnionType, PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|PHPStan\\Type\\UnionType given#'
2021-03-08 15:52:36 +01:00
- '#(.*?) class\-string, string given#'
2021-03-09 01:29:10 +01:00
2021-03-14 14:11:24 +01:00
# part of refactor() API, node must be returned, or does bring any value
-
message : '#Use void instead of modify and return self object#'
paths :
- '*Rector.php'
2021-03-18 00:42:12 +01:00
-
message : '#Cannot cast array<string\>\|string\|null to string#'
paths :
- utils/compiler/src/Command/DowngradePathsCommand.php
2021-03-18 02:10:01 +01:00
2021-03-19 15:33:58 +01:00
# PHP 7_4 literal syntax
- '#Property PhpParser\\Node\\Scalar\\DNumber\:\:\$value \(float\|int\) does not accept string#'
2021-03-20 16:27:18 +01:00
- '#Unable to resolve the template type T in call to method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:findParentTypes\(\)#'
2021-03-20 22:16:54 +01:00
2021-04-04 11:01:11 +02:00
# mimics original doctrine/annotations parser, improve later when finished
-
2021-04-15 22:44:58 +02:00
message : '#Array destruct is not allowed\. Use value object to pass data instead#'
paths :
- packages/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser/ArrayParser.php
2021-04-04 11:01:11 +02:00
2021-03-30 16:24:16 +02:00
-
2021-04-04 11:01:11 +02:00
message : '#Use value object over return of values#'
2021-03-30 16:24:16 +02:00
paths :
2021-04-04 11:01:11 +02:00
- packages/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser/ArrayParser.php
-
message : '#\$this as argument is not allowed\. Refactor method to service composition#'
paths :
- packages/BetterPhpDocParser/ValueObject/Parser/BetterTokenIterator.php
-
message : '#Array with keys is not allowed\. Use value object to pass data instead#'
paths :
- rules/NetteToSymfony/Rector/ClassMethod/RouterListToControllerAnnotationsRector.php
- '#Cognitive complexity for "Rector\\BetterPhpDocParser\\PhpDocParser\\DoctrineAnnotationDecorator\:\:mergeNestedDoctrineAnnotations\(\)" is \d+, keep it under 9#'
- '#Cognitive complexity for "Rector\\BetterPhpDocParser\\Printer\\PhpDocInfoPrinter\:\:printDocChildNode\(\)" is \d+, keep it under 9#'
- '#Cognitive complexity for "Rector\\NodeTypeResolver\\NodeTypeResolver\:\:resolve\(\)" is \d+, keep it under 9#'
2021-04-05 10:40:13 +02:00
-
message : '#Property with protected modifier is not allowed\. Use interface contract method instead#'
path : 'packages/BetterPhpDocParser/ValueObject/PhpDoc/DoctrineAnnotation/AbstractValuesAwareNode.php'
2021-04-06 19:33:09 +02:00
-
message : '#Do not inherit from abstract class, better use composition#'
paths :
2021-04-15 22:44:58 +02:00
- packages/NodeTypeResolver/PhpDocNodeVisitor/*PhpDocNodeVisitor.php
- packages/BetterPhpDocParser/PhpDocNodeVisitor/*PhpDocNodeVisitor.php
- packages/BetterPhpDocParser/PhpDocParser/BetterTypeParser.php
- packages/BetterPhpDocParser/ValueObject/Parser/BetterTokenIterator.php
2021-04-06 19:33:09 +02:00
-
message : '#Do not use setter on a service#'
paths :
2021-04-15 22:44:58 +02:00
- packages/NodeTypeResolver/PhpDocNodeVisitor/*PhpDocNodeVisitor.php
2021-04-06 19:33:09 +02:00
# known type
- '#Parameter \#3 \$pseudoNamespaceToNamespace of method Rector\\NodeTypeResolver\\PhpDocNodeVisitor\\UnderscoreRenamePhpDocNodeVisitor\:\:shouldSkip\(\) expects Rector\\Renaming\\ValueObject\\PseudoNamespaceToNamespace, Rector\\Renaming\\ValueObject\\PseudoNamespaceToNamespace\|null given#'
# known types
- '#Parameter (.*?) expects PhpParser\\Node, PhpParser\\Node\|null given#'
2021-04-10 16:54:24 +02:00
2021-04-11 01:28:08 +02:00
-
message : '#Class cognitive complexity is \d+, keep it under 50#'
paths :
2021-04-15 22:44:58 +02:00
- packages/PHPStanStaticTypeMapper/TypeMapper/UnionTypeMapper.php
2021-04-11 01:28:08 +02:00
- '#Cognitive complexity for "Rector\\PHPStanStaticTypeMapper\\TypeMapper\\UnionTypeMapper\:\:mapToPhpParserNode\(\)" is 10, keep it under 9#'
2021-04-12 12:34:04 +02:00
2021-04-13 02:12:48 +02:00
-
message : '#Property with protected modifier is not allowed\. Use interface contract method instead#'
paths :
- src/Rector/AbstractRector.php
- '#Cannot call method getSmartFileInfo\(\) on Rector\\Core\\ValueObject\\Application\\File\|null#'
- '#Parameter \#1 \$file of method Rector\\CodingStyle\\ClassNameImport\\ShortNameResolver\:\:resolveForNode\(\) expects Rector\\Core\\ValueObject\\Application\\File, Rector\\Core\\ValueObject\\Application\\File\|null given#'
2021-04-14 04:15:10 +02:00
2021-04-15 23:41:07 +02:00
- '#Method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:findParentTypes\(\) should return T of PhpParser\\Node\|null but returns class\-string<T of PhpParser\\Node\>\|T of PhpParser\\Node#'
2021-04-16 17:29:04 +02:00
-
2021-04-23 19:54:30 +02:00
message : '#Assign in loop is not allowed#'
paths :
- rules/DowngradePhp72/NodeAnalyzer/ParamContravariantDetector.php
2021-04-23 20:14:51 +02:00
# doc typo in php-parser
2021-04-23 22:28:00 +02:00
- '#Parameter \#2 \$args of class PhpParser\\Node\\Expr\\FuncCall constructor expects array<PhpParser\\Node\\Arg\>, array<int, PhpParser\\Node\\Arg\|null\> given#'
2021-04-26 01:12:14 +02:00
- '#Class with base "(.*?)" name is already used in "Symplify\\(.*?)", "Rector\\(.*?)"\. Use unique name to make classes easy to recognize#'
# php-parser bug
- '#Parameter \#1 \$type of method PhpParser\\Builder\\FunctionLike\:\:setReturnType\(\) expects PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|string, PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|PhpParser\\Node\\UnionType given#'
- '#Method Rector\\Core\\Tests\\DependencyInjection\\ConfigurableRectorImportConfigCallsMergeTest\:\:provideData\(\) return type has no value type specified in iterable type Iterator#'
- '#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#'
2021-04-28 11:33:25 +02:00
-
message : '#Use dependency injection instead of dependency juggling#'
path : src/HttpKernel/RectorKernel.php
-
message : '#Use separate function calls with readable variable names#'
path : src/FileSystem/FilesFinder.php
# fixed in dev-main
-
message : '#Use dependency injection instead of dependency juggling#'
paths :
- src/Application/FileProcessor/PhpFileProcessor.php
- rules/NetteToSymfony/Rector/ClassMethod/RouterListToControllerAnnotationsRector.php
- packages/FamilyTree/Reflection/FamilyRelationsAnalyzer.php
- packages/Caching/FileSystem/DependencyResolver.php
- packages/BetterPhpDocParser/PhpDocNodeMapper.php
- packages/NodeTypeResolver/NodeVisitor/FileNodeVisitor.php
# hacking value object
- packages/BetterPhpDocParser/PhpDocInfo/PhpDocInfo.php
# better reflection static design
- packages/NodeTypeResolver/Reflection/BetterReflection/SourceLocatorProvider/DynamicSourceLocatorProvider.php
-
message : '#Use separate function calls with readable variable names#'
path : src/Application/ActiveRectorsProvider.php