includes: - 'utils/PHPStanExtensions/config/phpstan-extensions.neon' - 'vendor/symplify/phpstan-extensions/config/config.neon' - 'vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon' parameters: # to allow intalling with various phsptan versions without reporting old errors here reportUnmatchedIgnoredErrors: false level: max excludes_analyse: # 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/*' # intetionally original - 'packages/Php/src/EregToPcreTransformer.php' - '*/packages/ContributorTools/templates/*' # part of composer - 'tests/Composer/AutoloadWrongCasesEventSubscriber.php' 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#' - '#Result of && is always true#' # missuse 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#' # nette container - '#Method Rector\\NodeTypeResolver\\DependencyInjection\\PHPStanServicesFactory::create(.*?)() should return (.*?) but returns object#' # false postive - type is set by annotation above - '#Method Rector\\Php\\Rector\\FuncCall\\RegexDashEscapeRector::findAssigners\(\) should return array but returns array#' - '#Array \(array\) does not accept PhpParser\\Node#' - '#Method Rector\\Php\\Rector\\TryCatch\\MultiExceptionCatchRector\:\:collectCatchKeysByContent\(\) should return array\> but returns array\>#' - '#Method Rector\\NodeTypeResolver\\PhpDoc\\NodeAnalyzer\\DocBlockManipulator::getTagByName\(\) should return PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagNode but returns PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagNode\|null#' - '#Parameter \#1 \$expr of class PhpParser\\Node\\Expr\\BooleanNot constructor expects PhpParser\\Node\\Expr, PhpParser\\Node given#' - '#Parameter \#1 \$binaryOpNode of method Rector\\CodeQuality\\Rector\\Identical\\SimplifyConditionsRector::createInversedBooleanOp\(\) expects PhpParser\\Node\\Expr\\BinaryOp, PhpParser\\Node given#' - '#Parameter \#1 \$node of method Rector\\PhpParser\\Node\\Commander\\NodeAddingCommander::wrapToExpression\(\) expects PhpParser\\Node\\Expr\|PhpParser\\Node\\Stmt, PhpParser\\Node given#' # irelevant - '#Call to function in_array\(\) with arguments string, (.*?) and true will always evaluate to false#' - '#Parameter \#1 \$name of class ReflectionFunction constructor expects Closure\|string, callable given#' # known values - '#Access to an undefined property PhpParser\\Node\\Expr::\$left#' - '#Access to an undefined property PhpParser\\Node\\Expr::\$right#' - '#Method Rector\\ContributorTools\\Configuration\\ConfigurationFactory::resolveCategoryFromFqnNodeTypes\(\) should return string but returns string\|false#' - '#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#' - '#Method Rector\\PhpParser\\Node\\Manipulator\\PropertyManipulator::getAllPropertyFetch\(\) should return array but returns array#' # 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+)#' - '#Parameter \#2 \$boolConstFetchNode of method Rector\\CodeQuality\\Rector\\Identical\\SimplifyArraySearchRector::resolveIsNot\(\) expects PhpParser\\Node\\Expr\\ConstFetch, PhpParser\\Node given#' # 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#' - '#Parameter \#1 \$callables of method Rector\\Collector\\CallableCollectorPopulator::populate\(\) expects (.*?) 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 - '#Parameter \#1 \$stack of function array_shift expects array, \(array\)\|PhpParser\\Node\|null given#' - '#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 - '#Parameter \#(1|2) \$(left|right) of class PhpParser\\Node\\Expr\\BinaryOp\\Coalesce constructor expects PhpParser\\Node\\Expr, PhpParser\\Node\\Expr\|null given#' - '#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#' - '#PHPDoc tag @param for parameter \$data with type mixed is not subtype of native type array#' - '#Parameter \#2 \$classMethodNode of method Rector\\NetteToSymfony\\Rector\\ClassMethod\\RouterListToControllerAnnotationsRector\:\:resolvePathFromClassAndMethodNodes\(\) expects PhpParser\\Node\\Stmt\\ClassMethod, PhpParser\\Node\\Stmt given#' - '#Access to an undefined property Symplify\\BetterPhpDocParser\\Attributes\\Contract\\Ast\\AttributeAwareNodeInterface\:\:\$type#' - '#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 but returns array#' # known values - '#Parameter \#2 \$variableName of class Rector\\DeadCode\\Rector\\ClassMethod\\Data\\VariableNodeUseInfo constructor expects string, string\|null given#' - '#Cannot call method getParentNode\(\) on Rector\\DeadCode\\Rector\\ClassMethod\\Data\\VariableNodeUseInfo\|null#' - '#In method "Rector\\Rector\\AbstractRector\:\:isNodeEqual", parameter \$availableNodes type is "array"\. Please provide a @param annotation to further specify the type of the array\. For instance\: @param int\[\] \$availableNodes\. More info\: http\://bit\.ly/typehintarray#' # part of test - '#Class Manual\\Twig\\TwigFilter not found#' - '#Class Manual_Twig_Filter not found#' - '#Parameter \#1 \$node of method Rector\\PhpParser\\Node\\Manipulator\\VisibilityManipulator\:\:(.*?)\(\) expects PhpParser\\Node\\Stmt\\ClassConst\|PhpParser\\Node\\Stmt\\ClassMethod\|PhpParser\\Node\\Stmt\\Property, PhpParser\\Node given#' - '#PHPDoc tag @param for parameter \$node with type PhpParser\\Builder\\Property\|PhpParser\\Node\\Stmt\\ClassConst\|PhpParser\\Node\\Stmt\\ClassMethod is not subtype of native type PhpParser\\Node#' - '#Parameter \#2 \$constFetch of method Rector\\CodeQuality\\Rector\\Identical\\SimplifyArraySearchRector\:\:resolveIsNot\(\) expects PhpParser\\Node\\Expr\\ConstFetch, PhpParser\\Node given#' - '#Parameter \#1 \$binaryOp of method Rector\\CodeQuality\\Rector\\Identical\\SimplifyConditionsRector\:\:createInversedBooleanOp\(\) expects PhpParser\\Node\\Expr\\BinaryOp, PhpParser\\Node given#' - '#Parameter \#2 \$classMethod of method Rector\\NetteToSymfony\\Rector\\ClassMethod\\RouterListToControllerAnnotationsRector\:\:resolvePathFromClassAndMethodNodes\(\) expects PhpParser\\Node\\Stmt\\ClassMethod, PhpParser\\Node\\Stmt given#' - '#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#' - '#PHPDoc tag @return with type PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\|Symplify\\BetterPhpDocParser\\Attributes\\Contract\\Ast\\AttributeAwareNodeInterface is not subtype of native type PHPStan\\PhpDocParser\\Ast\\Type\\TypeNode\|null#' - '#(.*?)(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#'