mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-01 08:50:50 +00:00
1f63ed3e55
* try reworking trait scope run * load configs from extension installer * add trait type * load configs from extension installer in PHPStan internally in Rector too * [ci-review] Rector Rectify Co-authored-by: GitHub Action <action@github.com>
514 lines
27 KiB
Plaintext
514 lines
27 KiB
Plaintext
includes:
|
|
- 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/forbidden-static-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/static-rules.neon
|
|
- 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
|
|
|
|
parameters:
|
|
level: max
|
|
|
|
paths:
|
|
- 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:
|
|
# temporary stinrgable migration from template type provider
|
|
- src/Console/Command/InitCommand.php
|
|
|
|
- */config.php
|
|
- tests/debug_functions.php
|
|
|
|
# broken in PHPStan https://github.com/rectorphp/rector/runs/1305002460#step:5:56
|
|
- packages/BetterPhpDocParser/ValueObject/PhpDocNode/AbstractTagValueNode.php
|
|
- packages/Testing/PHPUnit/*.php
|
|
- packages-tests/NodeVisitor/FunctionMethodAndClassNodeVisitor/FunctionMethodAndClassNodeVisitorTest.php
|
|
- rules/DowngradePhp70/Rector/FunctionLike/AbstractDowngradeParamDeclarationRector.php
|
|
|
|
# demo rule
|
|
- tests/Issues/AliasedImportDouble/Rector/ClassMethod/AddAliasImportRector.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-tests/BetterPhpDocPraser/PhpDocParser/TagValueNodeReprint/Fixture/SymfonyRoute/RouteName.php
|
|
|
|
# tests
|
|
- tests/DependencyInjection/config
|
|
|
|
ignoreErrors:
|
|
# 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<PhpParser\\Node\\Stmt>\|null#'
|
|
|
|
- '#Parameter \#1 \$node of method Rector\\PostRector\\Collector\\NodesToAddCollector\:\:wrapToExpression\(\) expects PhpParser\\Node\\Expr\|PhpParser\\Node\\Stmt, PhpParser\\Node given#'
|
|
|
|
- '#Cognitive complexity for "Rector\\Php80\\NodeResolver\\SwitchExprsResolver\:\:resolve\(\)" is (.*?), keep it under 9#'
|
|
|
|
-
|
|
message: "#^Cognitive complexity for \"Rector\\\\PhpSpecToPHPUnit\\\\Rector\\\\MethodCall\\\\PhpSpecPromisesToPHPUnitAssertRector\\:\\:refactor\\(\\)\" is 13, keep it under 9$#"
|
|
path: rules/PhpSpecToPHPUnit/Rector/MethodCall/PhpSpecPromisesToPHPUnitAssertRector.php
|
|
|
|
-
|
|
message: '#Class cognitive complexity is \d+, keep it under \d+#'
|
|
paths:
|
|
- rules/Php70/EregToPcreTransformer.php
|
|
- packages/NodeTypeResolver/NodeTypeResolver.php
|
|
- rules/Renaming/NodeManipulator/ClassRenamer.php
|
|
- rules/DowngradePhp72/Rector/FuncCall/DowngradePregUnmatchedAsNullConstantRector.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\\DeadCode\\NodeManipulator\\LivingCodeManipulator\:\:keepLivingCodeFromExpr\(\)" is \d+, keep it under 9#'
|
|
- '#Cognitive complexity for "Rector\\Transform\\Rector\\Class_\\AddInterfaceByParentRector\:\:refactor\(\)" is \d+, keep it under 9#'
|
|
|
|
|
|
- '#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#'
|
|
|
|
- '#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#'
|
|
|
|
# 3rd party package
|
|
-
|
|
message: '#Array (with keys|destruct) is not allowed\. Use value object to pass data instead#'
|
|
path: rules/Php70/EregToPcreTransformer.php
|
|
|
|
# 3rd party code
|
|
-
|
|
message: '#Use explicit return value over magic &reference#'
|
|
path: rules/Php70/EregToPcreTransformer.php
|
|
|
|
# 3rd party code
|
|
-
|
|
message: '#Use value object over return of values#'
|
|
path: rules/Php70/EregToPcreTransformer.php
|
|
|
|
-
|
|
message: '#Nested foreach with empty statement is not allowed#'
|
|
path: packages-tests/BetterPhpDocParser/PhpDocParser/TagValueNodeReprint/TagValueNodeReprintTest.php
|
|
|
|
-
|
|
message: '#Function "dump\(\)" cannot be used/left in the code#'
|
|
path: tests/debug_functions.php
|
|
|
|
# symplify 9
|
|
- '#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#'
|
|
|
|
-
|
|
message: '#"(getComments|getDocComment|setDocComment)\(\)" call on "PhpParser\\Node" type is not allowed#'
|
|
paths:
|
|
- src/PhpParser/NodeTransformer.php
|
|
- src/Rector/AbstractRector.php
|
|
- src/Exclusion/ExclusionManager.php
|
|
# playing around with doc block format
|
|
- packages/Comments/CommentRemover.php
|
|
- rules/CodingStyle/Rector/Assign/PHPStormVarAnnotationRector.php
|
|
- rules/CodeQuality/Rector/Return_/SimplifyUselessVariableRector.php
|
|
- rules/DeadCode/Rector/Expression/RemoveDeadStmtRector.php
|
|
- rules/DeadCode/Rector/Node/RemoveNonExistingVarAnnotationRector.php
|
|
- rules/PhpSpecToPHPUnit/Rector/MethodCall/PhpSpecMocksToPHPUnitMocksRector.php
|
|
- rules/CodingStyle/Node/DocAliasResolver.php
|
|
- packages/BetterPhpDocParser/Comment/CommentsMerger.php
|
|
- packages/Comments/NodeDocBlock/DocBlockUpdater.php
|
|
- packages/BetterPhpDocParser/PhpDocInfo/PhpDocInfoFactory.php
|
|
|
|
# false positives checked in another method
|
|
-
|
|
message: '#If condition is always false#'
|
|
paths:
|
|
- rules/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php
|
|
- rules/CodeQuality/Rector/Concat/JoinStringConcatRector.php
|
|
- packages/NodeNestingScope/NodeFinder/ScopeAwareNodeFinder.php
|
|
|
|
- '#Method (.*?) should return array<PhpParser\\Node\\(.*?)\> but returns array<PhpParser\\Node\>#'
|
|
- '#Parameter \#1 (.*?) expects Symfony\\Component\\DependencyInjection\\ContainerBuilder, Symfony\\Component\\DependencyInjection\\ContainerInterface given#'
|
|
|
|
# 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#'
|
|
|
|
-
|
|
message: '#Comparison operation "<" between 0 and 2 is always true#'
|
|
paths:
|
|
- rules/Php70/Rector/FuncCall/MultiDirnameRector.php
|
|
# - '#PHPDoc tag @param for parameter \$node with type float is incompatible with native type PhpParser\\Node#'
|
|
|
|
# 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
|
|
|
|
# class_exists is forbidden to enforce static reflection, but in a compiler pass we want runtime autoloading
|
|
-
|
|
message: '#Function "class_exists\(\)" cannot be used/left in the code#'
|
|
paths:
|
|
- src/DependencyInjection/CompilerPass/VerifyRectorServiceExistsCompilerPass.php
|
|
# for config class reflection
|
|
- packages/NodeTypeResolver/DependencyInjection/PHPStanServicesFactory.php
|
|
|
|
# known values from other methods
|
|
-
|
|
message: '#Negated boolean expression is always true#'
|
|
path: rules/PhpSpecToPHPUnit/NodeFactory/AssertMethodCallFactory.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/Rector/If_/IfToSpaceshipRector.php
|
|
|
|
- '#PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Expr\\Variable given#'
|
|
|
|
-
|
|
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
|
|
|
|
-
|
|
message: '#Property with protected modifier is not allowed\. Use interface contract method instead#'
|
|
paths:
|
|
- rules/Defluent/ValueObject/*
|
|
|
|
- '#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: '#Unreachable statement \- code above always terminates#'
|
|
paths:
|
|
- bin/rector.php
|
|
- rules/Php70/Rector/FuncCall/MultiDirnameRector.php
|
|
|
|
-
|
|
message: '#Function "class_exists\(\)" cannot be used/left in the code#'
|
|
paths:
|
|
- src/Bootstrap/ExtensionConfigResolver.php
|
|
|
|
# @todo fix later
|
|
-
|
|
message: '#There should be no empty class#'
|
|
paths:
|
|
- packages/StaticTypeMapper/ValueObject/Type/*Type.php
|
|
|
|
# generics nullable bugs
|
|
- '#Method (.*?) should return (.*?)\|null but returns PhpParser\\Node\|null#'
|
|
- '#Method (.*?) should return array<T of PhpParser\\Node\> but returns array<PhpParser\\Node\>#'
|
|
|
|
# fixed in php-parser master
|
|
- '#Parameter \#4 \$classWithConstants of class Rector\\Privatization\\ValueObject\\ReplaceStringWithClassConstant constructor expects class\-string, string given#'
|
|
|
|
# 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
|
|
|
|
-
|
|
message: '#Use defined constant Symplify\\ComposerJsonManipulator\\ValueObject\\ComposerJsonSection\:\:REQUIRE over string require#'
|
|
paths:
|
|
# is "require" in PHP
|
|
- src/Php/ReservedKeywordAnalyzer.php
|
|
|
|
- '#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#'
|
|
|
|
-
|
|
message: '#"%s" in sprintf\(\) format must be quoted#'
|
|
paths:
|
|
- packages/BetterPhpDocParser/ValueObject/PhpDoc/VariadicAwareParamTagValueNode.php
|
|
|
|
- '#Property Rector\\Core\\PhpParser\\Node\\AssignAndBinaryMap\:\:\$binaryOpToAssignClasses \(array<class\-string<PhpParser\\Node\\Expr\\BinaryOp\>, class\-string<PhpParser\\Node\\Expr\\BinaryOp\>\>\) does not accept array#'
|
|
|
|
-
|
|
message: '#Function "property_exists\(\)" cannot be used/left in the code#'
|
|
paths:
|
|
# on PhpParser Nodes
|
|
- src/NodeManipulator/ClassMethodAssignManipulator.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
|
|
|
|
# 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: '#Parameter \#1 \$types of method Rector\\Defluent\\NodeAnalyzer\\FluentCallStaticTypeResolver\:\:filterOutAlreadyPresentParentClasses\(\) expects array<class\-string\>, array<int, string\> given#'
|
|
paths:
|
|
- rules/Defluent/NodeAnalyzer/FluentCallStaticTypeResolver.php
|
|
|
|
- '#Cognitive complexity for "Rector\\CodeQuality\\Rector\\Isset_\\IssetOnPropertyObjectToPropertyExistsRector\:\:refactor\(\)" is \d+, keep it under 9#'
|
|
|
|
-
|
|
message: '#Argument and options "debug" got confused#'
|
|
paths:
|
|
- src/Console/Command/ProcessCommand.php
|
|
|
|
- '#(.*?) class\-string, string given#'
|
|
|
|
# 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'
|
|
|
|
# PHP 7_4 literal syntax
|
|
- '#Property PhpParser\\Node\\Scalar\\DNumber\:\:\$value \(float\|int\) does not accept string#'
|
|
|
|
# mimics original doctrine/annotations parser, improve later when finished
|
|
-
|
|
message: '#Array destruct is not allowed\. Use value object to pass data instead#'
|
|
paths:
|
|
- packages/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser/ArrayParser.php
|
|
|
|
-
|
|
message: '#Use value object over return of values#'
|
|
paths:
|
|
- 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
|
|
|
|
- '#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#'
|
|
|
|
-
|
|
message: '#Property with protected modifier is not allowed\. Use interface contract method instead#'
|
|
path: 'packages/BetterPhpDocParser/ValueObject/PhpDoc/DoctrineAnnotation/AbstractValuesAwareNode.php'
|
|
|
|
-
|
|
message: '#Do not use setter on a service#'
|
|
paths:
|
|
- packages/NodeTypeResolver/PhpDocNodeVisitor/*PhpDocNodeVisitor.php
|
|
|
|
# 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#'
|
|
|
|
-
|
|
message: '#Class cognitive complexity is \d+, keep it under 50#'
|
|
paths:
|
|
- packages/PHPStanStaticTypeMapper/TypeMapper/UnionTypeMapper.php
|
|
|
|
- '#Cognitive complexity for "Rector\\PHPStanStaticTypeMapper\\TypeMapper\\UnionTypeMapper\:\:mapToPhpParserNode\(\)" is 10, keep it under 9#'
|
|
|
|
-
|
|
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#'
|
|
|
|
- '#Method Rector\\Core\\Tests\\DependencyInjection\\ConfigurableRectorImportConfigCallsMergeTest\:\:provideData\(\) return type has no value type specified in iterable type Iterator#'
|
|
|
|
-
|
|
message: '#Function "function_exists\(\)" cannot be used/left in the code#'
|
|
paths:
|
|
- src/functions/node_helper.php
|
|
- packages/ReadWrite/Guard/VariableToConstantGuard.php
|
|
- packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php
|
|
|
|
# upgrade to PHP 7.4 wip
|
|
- '#This property type might be inlined to PHP\. Do you have confidence it is correct\? Put it here#'
|
|
|
|
# special case - cleanup in the future
|
|
-
|
|
message: '#File processor must require Rector rules in constructor via TypeRectorInterface\[\] \$typeRectors array autowire#'
|
|
path: src/Application/FileProcessor/PhpFileProcessor.php
|
|
|
|
- '#Use required typed property over of nullable property#'
|
|
- '#Method Rector\\BetterPhpDocParser\\PhpDocParser\\BetterPhpDocParser\:\:parseChildAndStoreItsPositions\(\) should return PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagNode\|PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTextNode but returns PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocChildNode#'
|
|
|
|
|
|
- '#Cognitive complexity for "Rector\\Core\\Rector\\AbstractRector\:\:enterNode\(\)" is \d+, keep it under 9#'
|
|
|
|
-
|
|
message: '#Class cognitive complexity is 33, keep it under 30#'
|
|
path: src/Rector/AbstractRector.php
|
|
|
|
# deserves better architecture
|
|
-
|
|
message: '#Do not use chained method calls#'
|
|
path: packages/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php
|
|
|
|
-
|
|
message: '#Function "dump_node\(\)" cannot be used/left in the code#'
|
|
path: src/functions/node_helper.php
|
|
|
|
# union false positive
|
|
- '#Method Rector\\Comments\\CommentRemover\:\:removeFromNode\(\) has parameter \$node with no value type specified in iterable type array#'
|
|
|
|
# false positive
|
|
- '#Attribute class JetBrains\\PhpStorm\\Immutable does not exist#'
|
|
|
|
# allowed for ease api
|
|
-
|
|
message: '#Cannot return include_once/require_once#'
|
|
path: rules/Renaming/Rector/Name/RenameClassRector.php
|
|
|
|
# class-string miss match
|
|
- '#Parameter \#1 \$classes of method Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo<PHPStan\\PhpDocParser\\Ast\\Node\>\:\:getByAnnotationClasses\(\) expects array<class\-string\>, array<int, string\> given#'
|
|
- '#Parameter \#1 \$classes of method Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo<TNode of PHPStan\\PhpDocParser\\Ast\\Node\>\:\:getByAnnotationClasses\(\) expects array<class\-string\>, array<string\> given#'
|
|
|
|
- '#expects class\-string<TNode of PHPStan\\PhpDocParser\\Ast\\Node\>, string given#'
|
|
# weird generics
|
|
- '#Method Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo\:\:getByType\(\) should return array<TNode of PHPStan\\PhpDocParser\\Ast\\Node\> but returns array<PHPStan\\PhpDocParser\\Ast\\Node\>#'
|
|
|
|
- '#Callable callable\(PHPStan\\Type\\Type\)\: PHPStan\\Type\\Type invoked with 2 parameters, 1 required#'
|
|
- '#Method Rector\\NodeNestingScope\\ParentFinder\:\:findByTypes\(\) should return T of PhpParser\\Node\|null but returns class\-string<T of PhpParser\\Node\>\|T of PhpParser\\Node#'
|
|
|
|
# array_index on generic types
|
|
- '#Method Rector\\NodeTypeResolver\\PHPStan\\Type\\TypeFactory\:\:uniquateTypes\(\) should return array<TType of PHPStan\\Type\\Type\> but returns array<int, PHPStan\\Type\\Type\>#'
|
|
|
|
# complex
|
|
- '#Cognitive complexity for "Rector\\NodeNameResolver\\NodeNameResolver\:\:getName\(\)" is 10, keep it under 9#'
|
|
|
|
# resolve later
|
|
- '#Method "(.*?)\(\)" only calling another method call and has no added value\. Use the inlined call instead#'
|
|
- '#Method "processRenameVariable\(\)" returns bool type, so the name should start with is/has/was#'
|
|
- '#Method "refactorParamType\(\)" returns bool type, so the name should start with is/has/was#'
|
|
- '#Method "decorateReturnWithSpecificType\(\)" returns bool type, so the name should start with is/has/was#'
|
|
- '#Method "resolveObjectType\(\)" returns bool type, so the name should start with is/has/was#'
|
|
|
|
-
|
|
message: '#Use dependency injection instead of dependency juggling#'
|
|
paths:
|
|
- packages/NodeTypeResolver/Reflection/BetterReflection/SourceLocatorProvider
|
|
|
|
# native filesystem calls, required for performance reasons
|
|
-
|
|
message: '#"@\\unlink\(\$tmpPath\)" is forbidden to use#'
|
|
paths:
|
|
- packages/Caching/ValueObject/Storage/FileCacheStorage.php
|
|
-
|
|
message: '#"@\\rename\(\$tmpPath, \$path\)" is forbidden to use#'
|
|
paths:
|
|
- packages/Caching/ValueObject/Storage/FileCacheStorage.php
|
|
-
|
|
message: '#"%s" in sprintf\(\) format must be quoted#'
|
|
paths:
|
|
- packages/Caching/ValueObject/Storage/FileCacheStorage.php
|
|
-
|
|
message: '#"@\\var_export\(new \\Rector\\Caching\\ValueObject\\CacheItem\(\$variableKey, \$data\), true\)" is forbidden to use#'
|
|
paths:
|
|
- packages/Caching/ValueObject/Storage/FileCacheStorage.php
|
|
|
|
-
|
|
message: '#Arguments names conflicts with parent class method\: "\$(.*?)" should be "\$(.*?)"\. This will break named arguments#'
|
|
paths:
|
|
- src/PhpParser/Printer/BetterStandardPrinter.php
|
|
- packages/BetterPhpDocParser/PhpDocParser/BetterPhpDocParser.php
|
|
- packages/BetterPhpDocParser/PhpDocParser/BetterTypeParser.php
|
|
|
|
# resolve later
|
|
- '#Variables "\$(.*?)" are overridden\. This can lead to unwanted bugs, please pick a different name to avoid it#'
|
|
|
|
-
|
|
message: '#Instead of array shape, use value object with specific types in constructor and getters#'
|
|
path: src/NodeFactory/ClassWithPublicPropertiesFactory.php #26
|
|
|
|
-
|
|
message: '#Instead of abstract class, use specific service with composition#'
|
|
paths:
|
|
- packages/BetterPhpDocParser/ValueObject/PhpDoc/DoctrineAnnotation/AbstractValuesAwareNode.php
|
|
- packages/PostRector/Rector/AbstractPostRector.php
|
|
- rules/Defluent/ValueObject/AbstractRootExpr.php
|
|
- rules/PhpSpecToPHPUnit/Rector/AbstractPhpSpecToPHPUnitRector.php
|
|
- src/Rector/AbstractRector.php
|
|
|
|
-
|
|
message: '#This call has duplicate argument#'
|
|
paths:
|
|
- rules/Php72/Rector/Assign/ReplaceEachAssignmentWithKeyCurrentRector.php
|
|
|
|
-
|
|
message: '#foreach\(\), while\(\), for\(\) or if\(\) cannot contain a complex expression\. Extract it to a new variable on a line before#'
|
|
paths:
|
|
- packages/NodeNestingScope/FlowOfControlLocator.php
|
|
- packages/NodeNestingScope/ParentFinder.php
|
|
- rules/CodeQuality/Rector/Return_/SimplifyUselessVariableRector.php
|
|
- rules/CodingStyle/Rector/Assign/ManualJsonStringToJsonEncodeArrayRector.php
|
|
- rules/Php70/Rector/FuncCall/MultiDirnameRector.php
|
|
- src/Application/FileProcessor.php
|
|
- src/PhpParser/Node/BetterNodeFinder.php
|
|
|
|
-
|
|
message: '#Parameter \#2 \$length of function str_split expects int<1, max\>, int given#'
|
|
paths:
|
|
- rules/Php74/Rector/LNumber/AddLiteralSeparatorToNumberRector.php
|
|
|
|
- '#^Cognitive complexity for "Rector\\CodingStyle\\Naming\\NameRenamer\:\:renameNameNode\(\)" is 13, keep it under 9$#'
|
|
|
|
-
|
|
message: '#Class has a static method must so must contains "Static" in its name#'
|
|
paths:
|
|
- packages/FileFormatter/ValueObject/Indent.php #17
|
|
- packages/FileFormatter/ValueObject/NewLine.php #15
|
|
- src/Application/VersionResolver.php #16
|
|
- utils/compiler/src/Unprefixer.php #9
|
|
|
|
# false positive - class_exists check is right above it
|
|
- '#Parameter \#1 \$objectOrClass of class ReflectionClass constructor expects class\-string<Rector\\RectorInstaller\\GeneratedConfig\>\|Rector\\RectorInstaller\\GeneratedConfig, string given#'
|
|
|
|
# waits for phpstan upgrade to php-parser 4.13
|
|
- '#Access to an undefined property PhpParser\\Node\\Arg\|PhpParser\\Node\\VariadicPlaceholder\:\:\$value#'
|
|
- '#(.*?), array<PhpParser\\Node\\Arg\|PhpParser\\Node\\VariadicPlaceholder\> given#'
|
|
- '#(.*?) but returns array<int, PhpParser\\Node\\Arg\|PhpParser\\Node\\VariadicPlaceholder\>#'
|
|
|
|
- '#Parameter "\w+" cannot have default value#'
|
|
|
|
# scope & mutating scope mish-mash
|
|
- '#Parameter \#4 \$nodeCallback of method PHPStan\\Analyser\\NodeScopeResolver\:\:processStmtNodes\(\) expects callable\(PhpParser\\Node, PHPStan\\Analyser\\Scope\)\: void, Closure\(PhpParser\\Node, PHPStan\\Analyser\\MutatingScope\)\: void given#'
|