includes: - 'utils/PHPStanExtensions/config/phpstan-extensions.neon' - 'vendor/symplify/phpstan-extensions/config/config.neon' - 'vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon' # bleeing edge - 'vendor/phpstan/phpstan/conf/bleedingEdge.neon' parameters: # to allow installing with various phsptan versions without reporting old errors here reportUnmatchedIgnoredErrors: false level: max autoload_directories: - stubs excludes_analyse: - "*/Expected/*" # complex printer - "packages/ContributorTools/src/Command/DumpNodesCommand.php" - "utils/phpstan/generate-paths.php" # test files - '*packages/NodeTypeResolver/tests/Source/AnotherClass.php' - '*tests/Rector/MethodCall/RenameMethodRector/**/SomeClass.php' - '*packages/BetterReflection/tests/Reflector/NotLoadedSource/SomeClass.php' - 'packages/NodeTypeResolver/tests/PerNodeTypeResolver/VariableTypeResolver/Source/NewClass.php' # tests files - '*tests/*/Fixture/*' - '*tests/*/Source/*' - '*tests/Source/*' - 'packages/NodeTypeResolver/tests/Source/SomeClass.php' # intentionally original - 'packages/Php/src/EregToPcreTransformer.php' - '*/packages/ContributorTools/templates/*' # part of composer - 'tests/Composer/AutoloadWrongCasesEventSubscriber.php' - '*/tests/Rector/Psr4/MultipleClassFileToPsr4ClassesRector/Expected/Just*ExceptionWithoutNamespace.php' # stubs - 'stubs/*' ignoreErrors: # 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#' - '#Method Rector\\Symfony\\Bridge\\DefaultAnalyzedSymfonyApplicationContainer::getContainer\(\) should return Symfony\\Component\\DependencyInjection\\ContainerBuilder but returns Symfony\\Component\\DependencyInjection\\Container#' - '#Property Rector\\DependencyInjection\\Loader\\RectorServiceParametersShifter::\$serviceKeywords \(array\) does not accept ReflectionProperty#' - '#Strict comparison using === between string and null will always evaluate to false#' # subtype - '#(.*?) expects ReflectionFunction\|ReflectionMethod, ReflectionFunctionAbstract given#' - '#PHPDoc tag @return with type (.*?) is incompatible with native type Iterator#' # nette container - '#Method Rector\\NodeTypeResolver\\DependencyInjection\\PHPStanServicesFactory::create(.*?)() should return (.*?) but returns object#' # false positive - type is set by annotation above - '#Array \(array\) does not accept PhpParser\\Node#' - '#Method Rector\\NodeTypeResolver\\PhpDoc\\NodeAnalyzer\\DocBlockManipulator::getTagByName\(\) should return PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagNode but returns PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagNode\|null#' - '#Parameter \#1 \$node of method Rector\\PhpParser\\Node\\Commander\\NodeAddingCommander::wrapToExpression\(\) expects PhpParser\\Node\\Expr\|PhpParser\\Node\\Stmt, PhpParser\\Node given#' # 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::\$left#' - '#Access to an undefined property PhpParser\\Node\\Expr::\$right#' - '#Array \(array\) does not accept PhpParser\\Node\\Expr#' - '#Cannot access property \$expr on PhpParser\\Node\\Stmt\|null#' - '#Access to an undefined property PhpParser\\Node\\Expr\\MethodCall\|PhpParser\\Node\\Stmt\\ClassMethod::\$params#' - '#Cannot call method getName\(\) on PHPStan\\Reflection\\ClassReflection\|null#' - '#Cannot call method getText\(\) on PhpParser\\Comment\\Doc\|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+)#' # false positive, resolved in previous method - '#Parameter (.*?) of method Rector\\PhpParser\\Node\\Manipulator\\IdentifierManipulator\:\:(.*?)\(\) expects PhpParser\\Node\\Expr\\ClassConstFetch\|PhpParser\\Node\\Expr\\MethodCall\|PhpParser\\Node\\Expr\\PropertyFetch\|PhpParser\\Node\\Expr\\StaticCall\|PhpParser\\Node\\Stmt\\ClassMethod, PhpParser\\Node given#' # intentionally incorrect - part of the test - '#Parameter \#2 \$codeSamples of class Rector\\RectorDefinition\\RectorDefinition constructor expects array, array given#' # invalid interface type resolution - '#Method Rector\\PhpParser\\NodeTraverser\\RectorNodeTraverser::getRectors\(\) should return array but returns array#' # 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#' # not really needed, empty - '#Rector\\PhpParser\\NodeTraverser\\RectorNodeTraverser::__construct\(\) does not call parent constructor from PhpParser\\NodeTraverser#' # known values - '#Strict comparison using === between PhpParser\\Node\\Expr and null will always evaluate to false#' # known values - '#Parameter \#1 \$code of method PhpParser\\Parser\:\:parse\(\) expects string, string\|false given#' # console argument/option - '#Cannot cast array\|string\|null to string#' - '#Parameter \#1 \$nodes of method Rector\\PhpParser\\Node\\BetterNodeFinder\:\:find\(\) expects array\|PhpParser\\Node, array\|null given#' - '#Method Rector\\NetteToSymfony\\Rector\\ClassMethod\\RouterListToControllerAnnotationsRector\:\:resolveAssignRouteNodes\(\) should return array but returns array#' - '#Access to an undefined property PhpParser\\Node\\Stmt\:\:\$expr#' - '#Cannot access property \$stmts on PhpParser\\Node\\Stmt\\Else_\|null#' - '#Parameter \#1 \$node of method Rector\\DeadCode\\Rector\\ClassMethod\\RemoveDelegatingParentCallRector\:\:matchStaticCall\(\) expects PhpParser\\Node, PhpParser\\Node\\Expr\|PhpParser\\Node\\Stmt\|null given#' # node finder - '#Method Rector\\(.*?) should return array but returns array#' # known values - '#Parameter \#2 \$variableName of class Rector\\DeadCode\\Data\\VariableNodeUseInfo constructor expects string, string\|null given#' - '#Cannot call method getParentNode\(\) on Rector\\DeadCode\\Data\\VariableNodeUseInfo\|null#' # part of test - '#Class Manual\\Twig\\TwigFilter not found#' - '#Class Manual_Twig_Filter not found#' - '#Rector\\NetteToSymfony\\Annotation\\SymfonyRoutePhpDocTagNode\:\:__construct\(\) does not call parent constructor from PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagNode#' - '#Access to an undefined property Rector\\BetterPhpDocParser\\Attributes\\Contract\\Ast\\AttributeAwareNodeInterface\:\:\$type#' - '#(.*?)(AttributeAwareNodeInterface|AttributeAware(.*?)TagValueNode)(.*?)#' - '#Call to an undefined method PHPStan\\PhpDocParser\\Ast\\PhpDoc\\(.*?)\:\:getAttribute\(\)#' - '#Access to an undefined property PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagValueNode\:\:\$type#' - '#Parameter \#1 \$children of class PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocNode constructor expects array, array given#' # false positive - '#If condition is always false#' - '#Call to an undefined method PHPStan\\Type\\Type\:\:getValue\(\)#' - '#Method Rector\\PHPUnit\\Rector\\MethodCall\\ReplaceAssertArraySubsetRector\:\:matchArray\(\) should return PhpParser\\Node\\Expr\\Array_\|null but returns PhpParser\\Node\\Expr#' - '#Parameter \#2 \$classMethod of method Rector\\NetteToSymfony\\Rector\\ClassMethod\\RouterListToControllerAnnotationsRector\:\:resolvePathFromClassAndMethodNodes\(\) expects PhpParser\\Node\\Stmt\\ClassMethod, PhpParser\\Node\\Stmt given#' - '#(.*?)PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Expr\\Variable given#' # false positive 0.11.5 - '#Unreachable statement \- code above always terminates#' - '#Method Rector\\NodeTypeResolver\\NodeVisitor\\(.*?)\:\:enterNode\(\) should return int\|PhpParser\\Node\|void\|null but return statement is missing#' - '#Negated boolean expression is always true#' - '#Strict comparison using \=\=\= between PhpParser\\Node and null will always evaluate to false#' # known types - '#Method Rector\\NodeContainer\\ParsedNodesByType\:\:(.*?)\(\) should return PhpParser\\Node\\Stmt\\(.*?)\|null but returns PhpParser\\Node\|null#' - '#Method Rector\\NodeContainer\\ParsedNodesByType\:\:findImplementersOfInterface\(\) should return array but returns array#' - '#PHPDoc tag @param for parameter \$classLike with type PhpParser\\Builder\\Trait_\|PhpParser\\Node\\Stmt\\Interface_ is not subtype of native type PhpParser\\Node\\Stmt\\ClassLike#' - '#Access to an undefined property PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Expr\\Variable\:\:\$name#' - '#Empty array passed to foreach#' - '#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\|false given#' - '#Method Rector\\Collector\\CallableCollectorPopulator\:\:populate\(\) should return array but returns array#' - '#Access to an undefined property PhpParser\\Node\\Expr\:\:\$args#' - '#Parameter \#2 \$name of method Rector\\Rector\\AbstractRector\:\:isName\(\) expects string, string\|null given#' # cascade irrelevant - '#Parameter (.*?) expects array, array given#' # known value - '#Parameter \#1 \$node of method Rector\\Rector\\AbstractRector\:\:getName\(\) expects PhpParser\\Node, PhpParser\\Node\\Identifier\|null given#' - '#Cannot cast array\|bool\|string\|null to string#' - '#Method Rector\\Legacy\\Rector\\ClassMethod\\ChangeSingletonToServiceRector\:\:matchStaticPropertyFetchAndGetSingletonMethodName\(\) should return array\|null but returns array#' # future compat - '#Call to function method_exists\(\) with (.*?) will always evaluate to false#' - '#Parameter \#1 \$rule of method Rector\\Configuration\\Configuration\:\:setRule\(\) expects string\|null, array\|bool\|string\|null given#' - '#In method "Rector\\Rector\\Property\\InjectAnnotationClassRector\:\:resolveType", 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#' - '#Empty catch block\. If you are sure this is meant to be empty, please add a "// @ignoreException" comment in the catch block#' - '#Method Rector\\Rector\\AbstractRector\:\:wrapToArg\(\) should return array but returns array#' - '#Parameter \#2 \$currentNode of method Rector\\CodingStyle\\Rector\\String_\\ManualJsonStringToJsonEncodeArrayRector\:\:matchNextExpressionAssignConcatToSameVariable\(\) expects PhpParser\\Node\\Expr\\Assign\|PhpParser\\Node\\Expr\\AssignOp\\Concat, PhpParser\\Node given#' - '#Parameter \#1 \$node of method Rector\\CodingStyle\\ValueObject\\ConcatExpressionJoinData\:\:addNodeToRemove\(\) expects PhpParser\\Node, PhpParser\\Node\|null given#' - '#Method Rector\\FileSystemRector\\Rector\\AbstractFileSystemRector\:\:wrapToArg\(\) should return array but returns array#' # array is callable - '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher\:\:getListenerPriority\(\) expects callable\(\)\: mixed, array given#' - '#Parameter \#1 \$kernelClass of method Rector\\Symfony\\Bridge\\DependencyInjection\\SymfonyContainerFactory\:\:createFromKernelClass\(\) expects string, string\|null given#' - '#If condition is always true#' # symfony future compatibility - '#Call to an undefined static method Symfony\\Component\\EventDispatcher\\EventDispatcher\:\:__construct\(\)#' - '#Rector\\EventDispatcher\\AutowiredEventDispatcher\:\:__construct\(\) calls parent constructor but parent does not have one#' - '#Ternary operator condition is always true#' - '#Access to an undefined property PhpParser\\Node\\Expr\\Assign\|PhpParser\\Node\\Stmt\\ClassMethod\|PhpParser\\Node\\Stmt\\Property\:\:\$var#' - '#Parameter \#1 \$node of method Rector\\NodeTypeResolver\\NodeTypeResolver\:\:resolveSingleTypeToStrings\(\) expects PhpParser\\Node, PhpParser\\Node\\Expr\|null given#' - '#Parameter \#1 \$name of class ReflectionFunction constructor expects Closure\|string, callable\(\)\: mixed given#' - '#Method Rector\\DoctrinePhpDocParser\\Tests\\PhpDocParser\\OrmTagParser\\AbstractOrmTagParserTest\:\:parseFileAndGetFirstNodeOfType\(\) should return PhpParser\\Node but returns PhpParser\\Node\|null#' - '#Method Rector\\Symfony\\Bridge\\DefaultAnalyzedSymfonyApplicationContainer\:\:getService\(\) should return object but returns object\|null#' - '#Method Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo\:\:(.*?)\(\) should return Rector\\DoctrinePhpDocParser\\Ast\\PhpDoc\\(.*?)\|null but returns PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagValueNode\|null#' - '#Call to function property_exists\(\) with string and (.*?) will always evaluate to false#' - '#Method Rector\\Console\\Option\\SetOptionResolver\:\:separateVersionedAndUnversionedSets\(\) should return array\> but returns array\|string\>\>#' - '#Method Rector\\DoctrinePhpDocParser\\AnnotationReader\\NodeAnnotationReader\:\:readMethodAnnotation\(\) should return Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Template but returns object\|null#' - '#PHPDoc tag @param for parameter \$nodeWithStatements with type PhpParser\\Builder\\FunctionLike\|PhpParser\\Node\\Stmt\\ClassLike is not subtype of native type PhpParser\\Node#' - '#Access to an undefined property PhpParser\\Node\\FunctionLike\|PhpParser\\Node\\Stmt\\ClassLike\:\:\$stmts#' - '#Property Rector\\TypeDeclaration\\TypeInferer\\(.*?)\:\:\$(.*?)TypeInferers \(array\) does not accept array#' # sense-less errors - '#Parameter \#1 \$functionLike of method Rector\\NodeTypeResolver\\PhpDoc\\NodeAnalyzer\\DocBlockManipulator\:\:getParamTypeInfos\(\) expects PhpParser\\Node\\Expr\\Closure\|PhpParser\\Node\\Stmt\\ClassMethod\|PhpParser\\Node\\Stmt\\Function_, PhpParser\\Node\\FunctionLike given#' - '#Parameter \#1 \$classLike of method Rector\\PhpParser\\Node\\Resolver\\NameResolver\:\:resolveNamespacedNameAwareNode\(\) expects PhpParser\\Node\\Stmt\\ClassLike, \(PhpParser\\Builder\\Trait_&PhpParser\\Node\)\|PhpParser\\Node\\Stmt\\Interface_ given#' - '#In method "Rector\\(.*?)\:\:isType", parameter \$type has no type\-hint and no @param annotation\. More info\: http\://bit\.ly/usetypehint#' - '#In method "Rector\\(.*?)\:\:isTypes", parameter \$requiredTypes type is "array"\. (.*?)#' - '#Parameter \#1 \$type of method PhpParser\\Builder\\Param\:\:setType\(\) expects PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|string, PhpParser\\Node\\Identifier\|PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType given#' - '#Generator expects value type string, array given#' - '#In method "Rector\\Rector\\Property\\InjectAnnotationClassRector\:\:resolveJMSDIInjectType", 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#' - '#Instanceof between PHPStan\\Type\\Type and PHPStan\\Type\\VoidType will always evaluate to false#' - '#Parameter \#1 \$functionLike of method Rector\\NodeTypeResolver\\PhpDoc\\NodeAnalyzer\\DocBlockManipulator\:\:getParamTypesByName\(\) expects PhpParser\\Node\\Expr\\Closure\|PhpParser\\Node\\Stmt\\ClassMethod\|PhpParser\\Node\\Stmt\\Function_, PhpParser\\Node\\FunctionLike given#' # 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#' - '#PHPDoc tag @return with type array is incompatible with native type Iterator#' - '#Method Rector\\DoctrinePhpDocParser\\PhpDocParser\\TableTagValueNodeFactory\:\:createIndexTagValueNodes\(\) should return array but returns array#' - '#Method Rector\\DoctrinePhpDocParser\\PhpDocParser\\TableTagValueNodeFactory\:\:createUniqueConstraintTagValueNodes\(\) should return array but returns array#' - '#Parameter \#1 \$obj of function spl_object_hash expects object, PhpParser\\Comment\\Doc\|null given#' - '#Method Rector\\DoctrinePhpDocParser\\AnnotationReader\\NodeAnnotationReader\:\:readMethodAnnotation\(\) should return Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Template\|Symfony\\Component\\Routing\\Annotation\\Route\|null but returns object\|null#'