mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 05:48:21 +01:00
391 lines
28 KiB
YAML
391 lines
28 KiB
YAML
includes:
|
|
- utils/phpstan-extensions/config/phpstan-extensions.neon
|
|
- vendor/symplify/phpstan-extensions/config/config.neon
|
|
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
|
|
- vendor/slam/phpstan-extensions/conf/slam-rules.neon
|
|
|
|
# see https://github.com/symplify/coding-standard
|
|
- vendor/symplify/coding-standard/config/symplify-rules.neon
|
|
|
|
rules:
|
|
# should be fixed in next part of symplify CS release
|
|
- Symplify\CodingStandard\Rules\NoClassWithStaticMethodWithoutStaticNameRule
|
|
- Symplify\CodingStandard\Rules\SeeAnnotationToTestRule
|
|
|
|
services:
|
|
# this rule prevents bug in phar like these: https://github.com/rectorphp/rector/pull/3692/files
|
|
-
|
|
class: Rector\PHPStanExtensions\Rule\RequireStringArgumentInMethodCallRule
|
|
tags: [phpstan.rules.rule]
|
|
arguments:
|
|
constantArgByMethodByType:
|
|
Rector\Core\Rector\AbstractRector:
|
|
isObjectType: [1]
|
|
|
|
parameters:
|
|
level: max
|
|
|
|
# see https://github.com/symplify/coding-standard
|
|
symplify:
|
|
max_cognitive_complexity: 9 # default: 8
|
|
# @todo update, to make classes smaller
|
|
# max_class_cognitive_complexity: 40 # default: 50
|
|
parent_classes:
|
|
- Rector
|
|
required_see_types:
|
|
- PHPStan\Rules\Rule
|
|
- Rector\Core\Rector\AbstractRector
|
|
- Rector\FileSystemRector\Rector\AbstractFileSystemRector
|
|
|
|
old_to_preffered_classes:
|
|
# prevent PHPStorm autocomplete mess
|
|
'Symfony\Component\DependencyInjection\Variable': 'PhpParser\Node\Expr\Variable'
|
|
'Closure': 'PhpParser\Node\Expr\Closure'
|
|
'phpDocumentor\Reflection\DocBlock\Tags\Return_': 'PhpParser\Node\Stmt\Return_'
|
|
|
|
# to allow installing with various phsptan versions without reporting old errors here
|
|
reportUnmatchedIgnoredErrors: false
|
|
|
|
checkGenericClassInNonGenericObjectType: false
|
|
|
|
scanDirectories:
|
|
- stubs
|
|
|
|
paths:
|
|
- bin
|
|
- src
|
|
- rules
|
|
- packages
|
|
- tests
|
|
- compiler/src
|
|
- utils
|
|
- config
|
|
|
|
excludes_analyse:
|
|
# phsptan bug
|
|
- utils/phpstan-extensions/src/Rule/PreventParentMethodVisibilityOverrideRule.php
|
|
- utils/phpstan-extensions/src/Rule/KeepRectorNamespaceForRectorRule.php
|
|
|
|
# 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'
|
|
|
|
ignoreErrors:
|
|
# false positive
|
|
-
|
|
message: '#Class with base \"[a-zA-Z0-9\\_]+\" name is already used in#'
|
|
paths:
|
|
- src/Console/Application.php
|
|
- src/PhpParser/Parser/Parser.php
|
|
|
|
# false positive
|
|
# - '#Call to function method_exists\(\) with string and (.*?) will always evaluate to false#'
|
|
- '#PHPDoc tag \@param for parameter \$node with type float is incompatible with native type PhpParser\\Node#'
|
|
|
|
# misuse of interface and class
|
|
- '#Parameter \#1 (.*?) expects Symfony\\Component\\DependencyInjection\\ContainerBuilder, Symfony\\Component\\DependencyInjection\\ContainerInterface given#'
|
|
- '#Strict comparison using === between string and null will always evaluate to false#'
|
|
|
|
# false positive - type is set by annotation above
|
|
- '#Array \(array<PhpParser\\Node\\Stmt>\) does not accept PhpParser\\Node#'
|
|
|
|
# irrelevant
|
|
- '#Call to function in_array\(\) with arguments string, (.*?) and true will always evaluate to false#'
|
|
|
|
# known values
|
|
- '#Access to an undefined property PhpParser\\Node\\Expr::\$right#'
|
|
|
|
- '#Access to an undefined property PhpParser\\Node\\Expr\\MethodCall\|PhpParser\\Node\\Stmt\\ClassMethod::\$params#'
|
|
- '#Cannot call method getName\(\) on PHPStan\\Reflection\\ClassReflection\|null#'
|
|
|
|
# false positive, has annotation type above
|
|
- '#Method Rector\\CodeQuality\\Rector\\Foreach_\\SimplifyForeachToCoalescingRector\:\:matchReturnOrAssignNode\(\) should return PhpParser\\Node\\Expr\\Assign\|PhpParser\\Node\\Stmt\\Return_\|null but returns PhpParser\\Node\|null#'
|
|
- '#Access to an undefined property PhpParser\\Node::\$(\w+)#'
|
|
|
|
# intentionally incorrect - part of the test
|
|
- '#Parameter \#2 \$codeSamples of class Rector\\Core\\RectorDefinition\\RectorDefinition constructor expects array<Rector\\Core\\Contract\\RectorDefinition\\CodeSampleInterface>, array<int, stdClass> given#'
|
|
|
|
# known values
|
|
- '#Cannot access property \$value on PhpParser\\Node\\Expr\\ArrayItem\|null#'
|
|
- '#Method Rector\\Symfony\\Rector\\New_\\StringToArrayArgumentProcessRector::findPreviousNodeAssign\(\) should return PhpParser\\Node\\Expr\\Assign\|null but returns PhpParser\\Node\|null#'
|
|
|
|
# known values
|
|
- '#Strict comparison using === between PhpParser\\Node\\Expr and null will always evaluate to false#'
|
|
|
|
# console argument/option
|
|
- '#Cannot cast array<string\>\|string\|null to string#'
|
|
|
|
- '#Access to an undefined property PhpParser\\Node\\Stmt\:\:\$expr#'
|
|
- '#Cannot access property \$stmts on PhpParser\\Node\\Stmt\\Else_\|null#'
|
|
|
|
# node finder
|
|
- '#Method Rector\\(.*?) should return array<PhpParser\\Node\\(.*?)> but returns array<PhpParser\\Node\>#'
|
|
|
|
# part of test
|
|
- '#(.*?)(AttributeAwareNodeInterface|AttributeAware(.*?)TagValueNode)(.*?)#'
|
|
|
|
- '#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#'
|
|
- '#Method Rector\\PHPUnit\\Rector\\MethodCall\\ReplaceAssertArraySubsetRector\:\:matchArray\(\) should return PhpParser\\Node\\Expr\\Array_\|null but returns PhpParser\\Node\\Expr#'
|
|
|
|
- '#(.*?)PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Expr\\Variable given#'
|
|
|
|
# false positive 0.11.5
|
|
- '#Unreachable statement \- code above always terminates#'
|
|
- '#Negated boolean expression is always true#'
|
|
- '#Strict comparison using \=\=\= between PhpParser\\Node and null will always evaluate to false#'
|
|
|
|
# known types
|
|
- '#Access to an undefined property PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Expr\\Variable\:\:\$name#'
|
|
- '#Strict comparison using \=\=\= between PhpParser\\Node\\Expr\\ArrayItem and null will always evaluate to false#'
|
|
- '#Parameter \#2 \.\.\.\$args of function array_merge expects array, array<int, string\>\|false given#'
|
|
- '#Access to an undefined property PhpParser\\Node\\Expr\:\:\$args#'
|
|
|
|
- '#Parameter \#2 \$name of method Rector\\Core\\Rector\\AbstractRector\:\:isName\(\) expects string, string\|null given#'
|
|
# cascade irrelevant
|
|
- '#Parameter (.*?) expects array<PhpParser\\Node\\Stmt\>, array<PhpParser\\Node\> given#'
|
|
|
|
# known value
|
|
- '#Cannot cast array<string\>\|bool\|string\|null to string#'
|
|
- '#Method Rector\\Legacy\\Rector\\ClassMethod\\ChangeSingletonToServiceRector\:\:matchStaticPropertyFetchAndGetSingletonMethodName\(\) should return array<string\>\|null but returns array<int, string\|null\>#'
|
|
|
|
- '#Parameter \#2 \$currentNode of method Rector\\CodingStyle\\Rector\\String_\\ManualJsonStringToJsonEncodeArrayRector\:\:matchNextExpressionAssignConcatToSameVariable\(\) expects PhpParser\\Node\\Expr\\Assign\|PhpParser\\Node\\Expr\\AssignOp\\Concat, PhpParser\\Node given#'
|
|
|
|
# array is callable
|
|
- '#If condition is always true#'
|
|
|
|
- '#Ternary operator condition is always true#'
|
|
|
|
- '#Access to an undefined property PhpParser\\Node\\FunctionLike\|PhpParser\\Node\\Stmt\\ClassLike\:\:\$stmts#'
|
|
|
|
- '#Property Rector\\TypeDeclaration\\TypeInferer\\(.*?)\:\:\$(.*?)TypeInferers \(array<Rector\\TypeDeclaration\\Contract\\TypeInferer\\(.*?)TypeInfererInterface\>\) does not accept array<Rector\\TypeDeclaration\\Contract\\TypeInferer\\PriorityAwareTypeInfererInterface\>#'
|
|
# sense-less errors
|
|
|
|
# 3rd party
|
|
-
|
|
message: '#Use default null value and nullable compare instead of isset on object#'
|
|
path: 'rules/symfony/src/ServiceMapProvider.php'
|
|
|
|
# PHP 7.4 1_000 support
|
|
- '#Property PhpParser\\Node\\Scalar\\DNumber\:\:\$value \(float\) does not accept string#'
|
|
- '#Call to function is_string\(\) with float will always evaluate to false#'
|
|
|
|
- '#Method Rector\\Doctrine\\Rector\\MethodCall\\ChangeSetIdToUuidValueRector\:\:getSetUuidMethodCallOnSameVariable\(\) should return PhpParser\\Node\\Expr\\MethodCall\|null but returns PhpParser\\Node\|null#'
|
|
|
|
# bugs
|
|
- '#Parameter \#1 \$items of class PhpParser\\Node\\Expr\\Array_ constructor expects array<PhpParser\\Node\\Expr\\ArrayItem\>, array<PhpParser\\Node\\Expr\\ArrayItem\|null\> given#'
|
|
|
|
# known value
|
|
- '#Method Rector\\StrictCodeQuality\\Rector\\Stmt\\VarInlineAnnotationToAssertRector\:\:findVariableByName\(\) should return PhpParser\\Node\\Expr\\Variable\|null but returns PhpParser\\Node\|null#'
|
|
|
|
- '#Method Rector\\NodeTypeResolver\\PHPStan\\Type\\TypeFactory\:\:createUnionOrSingleType\(\) should return PHPStan\\Type\\MixedType\|PHPStan\\Type\\UnionType but returns PHPStan\\Type\\Type#'
|
|
|
|
#phpstan seems to be missing the entire docblock, though it's there
|
|
- '#.*keepLivingCodeFromExpr.*#'
|
|
|
|
# test
|
|
- '#Class Rector\\DynamicTypeAnalysis\\Tests\\Rector\\ClassMethod\\AddArgumentTypeWithProbeDataRector\\Fixture\\SomeClass not found#'
|
|
|
|
-
|
|
message: '#Class Rector\\Core\\Tests\\Rector\\StaticCall\\SwapClassMethodArgumentsRector\\Fixture\\SomeClass not found#'
|
|
path: tests/Rector/StaticCall/SwapClassMethodArgumentsRector/SwapClassMethodArgumentsRectorTest.php
|
|
|
|
# internal rule
|
|
- '#Class "Rector\\Utils\\(.*?)" is missing @see annotation with test case class reference#'
|
|
|
|
# mixed
|
|
- '#in iterable type Iterator#'
|
|
- '#with no typehint specified#'
|
|
- '#return type has no value type specified in iterable type array#'
|
|
- '#has no return typehint#'
|
|
- '#Offset int\|string\|null does not exist on array<PhpParser\\Node\\Stmt>\|null#'
|
|
- '#class-string<T of object>\|T of object#'
|
|
- '#with no value type specified in iterable type array#'
|
|
- '#type specified in iterable type (array|iterable)#'
|
|
|
|
# known values
|
|
- '#Offset 0 does not exist on array<PhpParser\\Node\\Stmt>\|null#'
|
|
- '#Parameter \#1 \$left of class PhpParser\\Node\\Expr\\BinaryOp\\Spaceship constructor expects PhpParser\\Node\\Expr, PhpParser\\Node\\Expr\|null given#'
|
|
- '#Parameter \#2 \$right of class PhpParser\\Node\\Expr\\BinaryOp\\Spaceship constructor expects PhpParser\\Node\\Expr, PhpParser\\Node\\Expr\|null given#'
|
|
- '#Parameter \#3 \$nodeCallback of method PHPStan\\Analyser\\NodeScopeResolver::processNodes\(\) expects Closure\(PhpParser\\Node, PHPStan\\Analyser\\Scope\): void, Closure\(PhpParser\\Node, PHPStan\\Analyser\\MutatingScope\): void given#'
|
|
|
|
# false positive
|
|
- '#Comparison operation "<" between 0 and 2 is always true#'
|
|
|
|
- '#Method Rector\\Symfony\\Rector\\FrameworkBundle\\AbstractToConstructorInjectionRector\:\:getServiceTypeFromMethodCallArgument\(\) should return PHPStan\\Type\\Type but returns PHPStan\\Type\\Type\|null#'
|
|
|
|
- '#Parameter \#1 \$expected of method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) expects class\-string<object\>, string given#'
|
|
- '#Unable to resolve the template type ExpectedType in call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\)#'
|
|
|
|
# fix Symplify 7.2 later
|
|
- '#Method (.*?) returns bool type, so the name should start with is/has/was#'
|
|
|
|
# known value
|
|
- "#^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\\.$#"
|
|
- '#Cannot cast \(array<string\>\)\|string\|true to string#'
|
|
|
|
- '#In method "Rector\\BetterPhpDocParser\\AnnotationReader\\NodeAnnotationReader\:\:createPropertyReflectionFromPropertyNode", caught "Throwable" must be rethrown\. Either catch a more specific exception or add a "throw" clause in the "catch" block to propagate the exception\. More info\: http\://bit\.ly/failloud#'
|
|
# doc is not enough
|
|
- '#Result of \|\| is always true#'
|
|
|
|
# known value
|
|
- '#Parameter \#2 \$name of class PhpParser\\Node\\Expr\\MethodCall constructor expects PhpParser\\Node\\Expr\|PhpParser\\Node\\Identifier\|string, string\|null given#'
|
|
|
|
- '#Parameter \#1 \$eventListenerTag of method Rector\\SymfonyCodeQuality\\Rector\\Class_\\EventListenerToEventSubscriberRector\:\:createEventItem\(\) expects Rector\\Symfony\\ValueObject\\Tag\\EventListenerTag, Rector\\Symfony\\Contract\\Tag\\TagInterface given#'
|
|
- '#Method Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfoFactory\:\:parseTokensToPhpDocNode\(\) should return Rector\\AttributeAwarePhpDoc\\Ast\\PhpDoc\\AttributeAwarePhpDocNode but returns PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocNode#'
|
|
|
|
- '#Property PhpParser\\Node\\Stmt\\Expression\:\:\$expr \(PhpParser\\Node\\Expr\) does not accept PhpParser\\Node\\Expr\|null#'
|
|
- '#Call to an undefined method PHPStan\\Type\\Type\:\:getClassName\(\)#'
|
|
- '#Parameter \#1 \$typeNode of method Rector\\StaticTypeMapper\\StaticTypeMapper\:\:mapPHPStanPhpDocTypeNodeToPHPStanType\(\) expects PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode, PHPStan\\PhpDocParser\\Ast\\Node given#'
|
|
- '#Parameter \#1 \$str of function preg_quote expects string, int\|string given#'
|
|
|
|
- '#Parameter \#1 \$sprintfFuncCall of method Rector\\Core\\PhpParser\\NodeTransformer\:\:transformSprintfToArray\(\) expects PhpParser\\Node\\Expr\\FuncCall, PhpParser\\Node given#'
|
|
- '#Parameter \#1 \$nodes of method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:find\(\) expects array<PhpParser\\Node\>\|PhpParser\\Node, array<PhpParser\\Node\\Stmt\>\|null given#'
|
|
- '#PHPDoc tag @return with type iterable<object\> is not subtype of native type array#'
|
|
- '#Method Rector\\SOLID\\Reflection\\ParentConstantReflectionResolver\:\:(.*?)\(\) should return ReflectionClassConstant\|null but returns ReflectionClassConstant\|false#'
|
|
- '#Parameter \#1 \$firstStmt of method Rector\\Core\\Rector\\MethodBody\\NormalToFluentRector\:\:isBothMethodCallMatch\(\) expects PhpParser\\Node\\Stmt\\Expression, PhpParser\\Node\\Stmt given#'
|
|
- '#Method Rector\\Core\\Rector\\AbstractRector\:\:wrapToArg\(\) should return array<PhpParser\\Node\\Arg\> but returns array<PhpParser\\Node\\Arg\|PhpParser\\Node\\Expr\>#'
|
|
|
|
- '#Method Rector\\FileSystemRector\\Rector\\AbstractFileSystemRector\:\:wrapToArg\(\) should return array<PhpParser\\Node\\Arg\> but returns array<PhpParser\\Node\\Arg\|PhpParser\\Node\\Expr\>#'
|
|
- '#Cannot call method (.*?)\(\) on Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo\|null#'
|
|
|
|
- '#Right side of && is always true#'
|
|
- '#Parameter \#(.*?) (.*?) of class PhpParser\\Node\\Expr\\BinaryOp\\(.*?) constructor expects PhpParser\\Node\\Expr, PhpParser\\Node given#'
|
|
|
|
- '#Access to an undefined property PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagValueNode\:\:\$description#'
|
|
|
|
- '#Method Rector\\Php80\\Rector\\NotIdentical\\StrContainsRector\:\:matchNotIdenticalToFalse\(\) should return PhpParser\\Node\\Expr\\FuncCall\|null but returns PhpParser\\Node\\Expr#'
|
|
|
|
- '#Parameter \#2 \$name of method Rector\\Core\\Rector\\AbstractRector\:\:isVariableName\(\) expects string, string\|null given#'
|
|
|
|
# mixed
|
|
- '#Property Rector\\Polyfill\\ValueObject\\BinaryToVersionCompareCondition\:\:\$expectedValue has no typehint specified#'
|
|
# node finder
|
|
- '#Method Rector\\Core\\PhpParser\\Node\\Manipulator\\MethodCallManipulator\:\:findAssignToVariableName\(\) should return PhpParser\\Node\\Expr\\Assign\|null but returns PhpParser\\Node\|null#'
|
|
|
|
# broken
|
|
- '#Cannot call method getParentNode\(\) on Rector\\DeadCode\\ValueObject\\VariableNodeUse\|null#'
|
|
- '#Method Rector\\DeadCode\\NodeFinder\\PreviousVariableAssignNodeFinder\:\:find\(\) should return PhpParser\\Node\\Expr\\Assign\|null but returns PhpParser\\Node\|null#'
|
|
- '#Parameter \#2 \$name of method Rector\\NodeNameResolver\\NodeNameResolver\:\:isName\(\) expects string, string\|null given#'
|
|
- '#Method Rector\\PHPOffice\\Rector\\MethodCall\\IncreaseColumnIndexRector\:\:findVariableAssignName\(\) should return PhpParser\\Node\\Expr\\Assign\|null but returns PhpParser\\Node\|null#'
|
|
|
|
- '#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#'
|
|
- '#Method Rector\\Caching\\ChangedFilesDetector\:\:hashFile\(\) should return string but returns string\|false#'
|
|
|
|
- '#If condition is always false#'
|
|
- '#Method Rector\\Php80\\Rector\\Identical\\StrStartsWithRector\:\:refactor\(\) should return PhpParser\\Node\|null but return statement is missing#'
|
|
|
|
- '#Parameter \#1 \$funcCall of method Rector\\Php80\\MatchAndRefactor\\StrStartsWithMatchAndRefactor\\AbstractMatchAndRefactor\:\:createStrStartsWithValueObjectFromFuncCall\(\) expects PhpParser\\Node\\Expr\\FuncCall, PhpParser\\Node\\Expr given#'
|
|
|
|
# mostly strings in tests
|
|
- '#Class (.*?) should be written with \:\:class notation, string found#'
|
|
- '#Parameter \#2 \$key of method Rector\\BetterPhpDocParser\\PhpDocNode\\AbstractTagValueNode\:\:printArrayItem\(\) expects string\|null, int\|string given#'
|
|
- '#Method Rector\\Naming\\Naming\\PropertyNaming\:\:resolveShortClassName\(\) should return string but returns string\|null#'
|
|
|
|
-
|
|
message: "#^Class cognitive complexity for \"PhpDocInfo\" is 53, keep it under 50$#"
|
|
count: 1
|
|
path: packages/better-php-doc-parser/src/PhpDocInfo/PhpDocInfo.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
|
|
|
|
# copy-pasted magic from symfony
|
|
-
|
|
message: '#Use default null value and nullable compare instead of isset/empty on object#'
|
|
path: 'rules/symfony/src/ServiceMapProvider.php'
|
|
|
|
-
|
|
message: "#^Parameter \\#1 \\$input of function array_splice expects array, array\\<PhpParser\\\\Node\\\\Stmt\\>\\|null given\\.$#"
|
|
count: 1
|
|
path: rules/coding-style/src/Rector/ClassMethod/NewlineBeforeNewAssignSetRector.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
|
|
|
|
-
|
|
message: "#^Class cognitive complexity for \"EregToPcreTransformer\" is (.*?), keep it under 50$#"
|
|
path: rules/php70/src/EregToPcreTransformer.php
|
|
|
|
-
|
|
message: "#Use explicit property fetch names over dynamic#"
|
|
path: packages/doctrine-annotation-generated/src/PhpDocNode/ConstantReferenceIdentifierRestorer.php
|
|
|
|
- "#^Cognitive complexity for \"Rector\\\\Php70\\\\EregToPcreTransformer\\:\\:(.*?)\" is (.*?), keep it under 9$#"
|
|
|
|
- '#Use explicit return value over magic &reference#'
|
|
- '#Method Rector\\Order\\StmtOrder\:\:createOldToNewKeys\(\) should return array<int\> but returns array\|false#'
|
|
|
|
- '#In method "Rector\\Utils\\ProjectValidator\\Process\\ParallelTaskRunner\:\:(.*?)", caught "Throwable" must be rethrown\. Either catch a more specific exception or add a "throw" clause in the "catch" block to propagate the exception#'
|
|
# weird
|
|
|
|
- '#Method (.*?) specified in iterable type Symfony\\Component\\Process\\Process#'
|
|
- '#Cannot cast PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Identifier to string#'
|
|
- '#Class cognitive complexity for "DumpNodesCommand" is 103, keep it under 50#'
|
|
- '#Cognitive complexity for "Rector\\Utils\\DocumentationGenerator\\Command\\DumpNodesCommand\:\:execute\(\)" is \d+, keep it under 9#'
|
|
|
|
- '#Method Rector\\Utils\\DocumentationGenerator\\Node\\NodeClassProvider\:\:getNodeClasses\(\) should return array<class\-string\> but returns array<int, \(int\|string\)\>#'
|
|
|
|
- '#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#'
|
|
- '#Method Rector\\BetterPhpDocParser\\Tests\\PhpDocParser\\AbstractPhpDocInfoTest\:\:parseFileAndGetFirstNodeOfType\(\) should return PhpParser\\Node but returns PhpParser\\Node\|null#'
|
|
- '#Method Rector\\Core\\Testing\\Finder\\RectorsFinder\:\:findInDirectories\(\) should return array<Rector\\Core\\Contract\\Rector\\RectorInterface\> but returns array<object\>#'
|
|
- '#Property PhpParser\\Node\\Stmt\\Namespace_\:\:\$stmts \(array<PhpParser\\Node\\Stmt\>\) does not accept array<PhpParser\\Node\>#'
|
|
|
|
- '#Cognitive complexity for "Rector\\TypeDeclaration\\PHPStan\\Type\\ObjectTypeSpecifier\:\:matchShortenedObjectType\(\)" is 10, keep it under 9#'
|
|
- '#Parameter \#1 \$objectType of method Rector\\Core\\Naming\\PropertyNaming\:\:fqnToVariableName\(\) expects PHPStan\\Type\\ObjectType\|string, PHPStan\\Type\\Type given#'
|
|
- '#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#'
|
|
- '#Cognitive complexity for "Rector\\Core\\PhpParser\\Node\\Value\\ValueResolver\:\:getValue\(\)" is \d+, keep it under 9#'
|
|
- '#Cognitive complexity for "Rector\\NetteKdyby\\NodeResolver\\ListeningMethodsCollector\:\:collectFromClassAndGetSubscribedEventClassMethod\(\)" is 11, keep it under 9#'
|
|
- '#Cognitive complexity for "Rector\\NetteKdyby\\ContributeEventClassResolver\:\:resolveGetterMethodByEventClassAndParam\(\)" is \d+, keep it under 9#'
|
|
- '#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 \$oldMethod of class Rector\\PHPOffice\\ValueObject\\ConditionalSetValue constructor expects string, bool\|int\|string given#'
|
|
- '#Parameter \#1 \$object of function get_class expects object, PhpParser\\Node\|null given#'
|
|
- '#Cognitive complexity for "Rector\\Core\\Application\\RectorApplication\:\:runOnFileInfos\(\)" is 10, keep it under 9#'
|
|
- '#Class "Rector\\FileSystemRector\\Rector\\Removing\\RemoveProjectFileRector" is missing @see annotation with test case class reference#'
|
|
- '#Class "Rector\\Php73\\Rector\\FuncCall\\SetCookieRector" is missing @see annotation with test case class reference#'
|
|
- '#Parameter \#1 \$type of method PhpParser\\Builder\\Param\:\:setType\(\) expects PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|PhpParser\\Node\\UnionType\|string, PhpParser\\Node\\Identifier\|PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|PhpParser\\Node\\UnionType given#'
|
|
- '#Parameter \#1 \$node of method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:findFirstAncestorInstanceOf\(\) expects PhpParser\\Node, PhpParser\\Node\\Expr\\Variable\|null given#'
|
|
- '#Parameter \#1 \$assignAndRootExpr of method Rector\\MagicDisclosure\\Rector\\MethodCall\\DefluentMethodCallRector\:\:createNodesToAdd\(\) expects Rector\\Core\\ValueObject\\AssignAndRootExpr\|Rector\\Core\\ValueObject\\SilentVariableAndRootExpr, Rector\\Core\\ValueObject\\AssignAndRootExpr\|Rector\\Core\\ValueObject\\SilentVariableAndRootExpr\|null given#'
|
|
- '#Parameter \#1 \$assignAndRootExpr of method Rector\\MagicDisclosure\\NodeFactory\\NonFluentMethodCallFactory\:\:createFromAssignObjectAndMethodCalls\(\) expects Rector\\Core\\ValueObject\\AssignAndRootExpr, Rector\\Core\\ValueObject\\AssignAndRootExpr\|null given#'
|
|
- '#Method Rector\\Core\\ValueObject\\AssignAndRootExpr\:\:getReturnSilentVariable\(\) should return PhpParser\\Node\\Expr\\Variable\|null but returns PhpParser\\Node\\Stmt\\Return_#'
|
|
- '#Parameter \#1 \$expr of method Rector\\MagicDisclosure\\Matcher\\ClassNameTypeMatcher\:\:doesExprMatchNames\(\) expects PhpParser\\Node\\Expr, PhpParser\\Node\\Expr\|null given#'
|
|
- '#Parameter \#1 \$objectType of method Rector\\Naming\\Naming\\PropertyNaming\:\:fqnToVariableName\(\) expects PHPStan\\Type\\ObjectType\|string, PHPStan\\Type\\Type given#'
|
|
- '#Method Rector\\Core\\PhpParser\\Node\\NodeFactory\:\:createConcat\(\) should return PhpParser\\Node\\Expr\\BinaryOp\\Concat\|null but returns PhpParser\\Node\\Expr#'
|
|
- '#Method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:findFirstNonAnonymousClass\(\) should return PhpParser\\Node\\Stmt\\Class_\|null but returns PhpParser\\Node\|null#'
|
|
# 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#'
|
|
|
|
# local type
|
|
-
|
|
message: '#Method call "isObjectType\(\)" argument on position 1 cannot use "\:\:class" reference#'
|
|
path: 'packages/dynamic-type-analysis/src/Rector/StaticCall/RemoveArgumentTypeProbeRector.php'
|
|
|
|
# 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'
|
|
|
|
- '#Call to an undefined method PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Identifier\:\:toString\(\)#'
|
|
- '#Class Rector\\Renaming\\Tests\\Rector\\MethodCall\\RenameMethodRector\\Fixture\\SkipSelfMethodRename not found#'
|
|
|
|
|
|
# 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'
|