rector/phpstan.neon

169 lines
13 KiB
Plaintext
Raw Normal View History

2018-09-14 18:01:40 +02:00
includes:
- 'utils/PHPStanExtensions/config/phpstan-extensions.neon'
2018-09-15 20:50:52 +02:00
- 'vendor/symplify/phpstan-extensions/config/config.neon'
2019-01-19 16:58:51 +01:00
- 'vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon'
2019-05-09 12:16:05 +02:00
# bleeing edge
- 'vendor/phpstan/phpstan/conf/bleedingEdge.neon'
2018-09-14 18:01:40 +02:00
2017-11-06 11:40:43 +01:00
parameters:
2018-10-21 10:53:32 +02:00
# to allow intalling with various phsptan versions without reporting old errors here
2019-01-25 01:49:26 +01:00
reportUnmatchedIgnoredErrors: false
2019-02-02 13:33:25 +01:00
level: max
2018-09-14 18:01:40 +02:00
excludes_analyse:
2019-02-21 15:36:16 +01:00
# complex printer
- "packages/ContributorTools/src/Command/DumpNodesCommand.php"
2018-12-28 17:01:16 +01:00
- "utils/phpstan/generate-paths.php"
2018-09-14 18:01:40 +02:00
# test files
2018-09-21 07:12:24 +02:00
- '*packages/NodeTypeResolver/tests/Source/AnotherClass.php'
- '*tests/Rector/MethodCall/RenameMethodRector/**/SomeClass.php'
2018-09-14 18:01:40 +02:00
- '*packages/BetterReflection/tests/Reflector/NotLoadedSource/SomeClass.php'
- 'packages/NodeTypeResolver/tests/PerNodeTypeResolver/VariableTypeResolver/Source/NewClass.php'
# tests files
2019-03-27 17:46:25 +01:00
- '*tests/*/Fixture/*'
- '*tests/*/Source/*'
- '*tests/Source/*'
- 'packages/NodeTypeResolver/tests/Source/SomeClass.php'
2018-10-08 13:19:10 +08:00
# intetionally original
- 'packages/Php/src/EregToPcreTransformer.php'
- '*/packages/ContributorTools/templates/*'
# part of composer
- 'tests/Composer/AutoloadWrongCasesEventSubscriber.php'
2018-09-14 18:01:40 +02:00
2017-11-06 11:40:43 +01:00
ignoreErrors:
2019-01-12 20:36:34 +01:00
# false positive
2019-01-31 22:31:42 +01:00
- '#Call to function method_exists\(\) with string and (.*?) will always evaluate to false#'
2019-01-12 20:36:34 +01:00
- '#PHPDoc tag \@param for parameter \$node with type float is incompatible with native type PhpParser\\Node#'
- '#Result of && is always true#'
2019-01-12 20:36:34 +01:00
2018-08-09 10:03:18 +02:00
# missuse of interface and class
2019-01-14 23:05:14 +01:00
- '#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#'
2018-08-09 10:03:18 +02:00
2018-10-06 01:13:09 +08:00
- '#Property Rector\\DependencyInjection\\Loader\\RectorServiceParametersShifter::\$serviceKeywords \(array<string>\) does not accept ReflectionProperty#'
2018-10-22 19:17:17 +02:00
- '#Strict comparison using === between string and null will always evaluate to false#'
# subtype
- '#(.*?) expects ReflectionFunction\|ReflectionMethod, ReflectionFunctionAbstract given#'
2018-07-25 13:06:07 +02:00
# nette container
- '#Method Rector\\NodeTypeResolver\\DependencyInjection\\PHPStanServicesFactory::create(.*?)() should return (.*?) but returns object#'
2018-07-25 13:06:07 +02:00
2018-11-07 01:24:44 +01:00
# false postive - type is set by annotation above
2018-11-07 21:53:19 +01:00
- '#Array \(array<PhpParser\\Node\\Stmt>\) does not accept PhpParser\\Node#'
2018-10-08 12:39:37 +08:00
- '#Method Rector\\Php\\Rector\\TryCatch\\MultiExceptionCatchRector\:\:collectCatchKeysByContent\(\) should return array<array<int\>\> but returns array<string, array<int, int\|string\>\>#'
- '#Method Rector\\NodeTypeResolver\\PhpDoc\\NodeAnalyzer\\DocBlockManipulator::getTagByName\(\) should return PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagNode but returns PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagNode\|null#'
2018-11-07 01:24:44 +01:00
- '#Parameter \#1 \$expr of class PhpParser\\Node\\Expr\\BooleanNot constructor expects PhpParser\\Node\\Expr, PhpParser\\Node given#'
2018-12-13 04:12:09 +01:00
- '#Parameter \#1 \$node of method Rector\\PhpParser\\Node\\Commander\\NodeAddingCommander::wrapToExpression\(\) expects PhpParser\\Node\\Expr\|PhpParser\\Node\\Stmt, PhpParser\\Node given#'
2018-08-31 00:57:59 +02:00
2018-07-25 13:06:07 +02:00
# irelevant
2018-10-22 12:43:10 +02:00
- '#Call to function in_array\(\) with arguments string, (.*?) and true will always evaluate to false#'
2018-12-23 16:47:15 +01:00
- '#Parameter \#1 \$name of class ReflectionFunction constructor expects Closure\|string, callable given#'
2018-07-25 13:06:07 +02:00
# 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#'
2018-09-26 19:41:53 +08:00
- '#Array \(array<PhpParser\\Node\\Expr\\MethodCall>\) does not accept PhpParser\\Node\\Expr#'
- '#Cannot access property \$expr on PhpParser\\Node\\Stmt\|null#'
2018-08-15 00:12:41 +02:00
- '#Access to an undefined property PhpParser\\Node\\Expr\\MethodCall\|PhpParser\\Node\\Stmt\\ClassMethod::\$params#'
2019-01-14 23:05:14 +01:00
- '#Cannot call method getName\(\) on PHPStan\\Reflection\\ClassReflection\|null#'
2019-01-14 15:10:41 +01:00
2018-07-25 13:06:07 +02:00
- '#Cannot call method getText\(\) on PhpParser\\Comment\\Doc\|null#'
- '#Method Rector\\PhpParser\\Node\\Manipulator\\PropertyManipulator::getAllPropertyFetch\(\) should return array<PhpParser\\Node\\Expr\\PropertyFetch> but returns array<PhpParser\\Node>#'
2018-07-25 13:06:07 +02:00
# 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#'
2018-11-07 18:22:27 +01:00
- '#Access to an undefined property PhpParser\\Node::\$(\w+)#'
2018-10-22 12:43:10 +02:00
# 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#'
2019-01-18 03:41:58 +01:00
- '#Parameter \#1 \$callables of method Rector\\Collector\\CallableCollectorPopulator::populate\(\) expects (.*?) given#'
2018-04-09 00:08:05 +02:00
# intentionally incorrect - part of the test
2019-01-14 23:05:14 +01:00
- '#Parameter \#2 \$codeSamples of class Rector\\RectorDefinition\\RectorDefinition constructor expects array<Rector\\Contract\\RectorDefinition\\CodeSampleInterface>, array<int, stdClass> given#'
2018-08-01 11:53:26 +02:00
# invalid interface type resolution
2019-01-14 23:05:14 +01:00
- '#Method Rector\\PhpParser\\NodeTraverser\\RectorNodeTraverser::getRectors\(\) should return array<Rector\\Contract\\Rector\\PhpRectorInterface> but returns array<PhpParser\\NodeVisitor>#'
2018-04-09 00:08:05 +02:00
2017-11-06 13:58:51 +01:00
# known values
2019-01-18 03:41:58 +01:00
- '#Parameter \#1 \$stack of function array_shift expects array, \(array<PhpParser\\Node\|null>\)\|PhpParser\\Node\|null given#'
2018-10-07 17:53:59 +08:00
- '#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#'
2018-04-02 15:17:12 +02:00
# not really needed, empty
- '#Rector\\PhpParser\\NodeTraverser\\RectorNodeTraverser::__construct\(\) does not call parent constructor from PhpParser\\NodeTraverser#'
2019-01-14 19:21:23 +01:00
# 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#'
2019-02-02 13:27:03 +01:00
# known values
- '#Parameter \#1 \$code of method PhpParser\\Parser\:\:parse\(\) expects string, string\|false given#'
# console argument/option
- '#Cannot cast array<string\>\|string\|null to string#'
2019-02-02 15:27:45 +01:00
- '#Parameter \#1 \$nodes of method Rector\\PhpParser\\Node\\BetterNodeFinder\:\:find\(\) expects array<PhpParser\\Node\>\|PhpParser\\Node, array<PhpParser\\Node\\Stmt\>\|null given#'
- '#Method Rector\\NetteToSymfony\\Rector\\ClassMethod\\RouterListToControllerAnnotationsRector\:\:resolveAssignRouteNodes\(\) should return array<PhpParser\\Node\\Expr\\Assign\> but returns array<PhpParser\\Node\>#'
- '#Access to an undefined property PhpParser\\Node\\Stmt\:\:\$expr#'
- '#Cannot access property \$stmts on PhpParser\\Node\\Stmt\\Else_\|null#'
2019-02-11 23:35:20 +01:00
# node finder
- '#Method Rector\\(.*?) should return array<PhpParser\\Node\\(.*?)> but returns array<PhpParser\\Node\>#'
# known values
2019-05-07 14:33:26 +02:00
- '#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#'
2019-02-11 23:35:20 +01:00
# part of test
- '#Class Manual\\Twig\\TwigFilter not found#'
- '#Class Manual_Twig_Filter not found#'
2019-02-22 00:08:04 +01:00
2019-02-22 18:25:31 +01:00
- '#Parameter \#1 \$binaryOp of method Rector\\CodeQuality\\Rector\\Identical\\SimplifyConditionsRector\:\:createInversedBooleanOp\(\) expects PhpParser\\Node\\Expr\\BinaryOp, PhpParser\\Node given#'
- '#Rector\\NetteToSymfony\\Annotation\\SymfonyRoutePhpDocTagNode\:\:__construct\(\) does not call parent constructor from PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagNode#'
2019-02-28 22:50:53 +01:00
- '#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<PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocChildNode\>, array<int, PHPStan\\PhpDocParser\\Ast\\Node\> given#'
2019-03-09 17:36:27 +00:00
# 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#'
2019-03-18 12:10:33 +01:00
- '#Parameter \#2 \$classMethod of method Rector\\NetteToSymfony\\Rector\\ClassMethod\\RouterListToControllerAnnotationsRector\:\:resolvePathFromClassAndMethodNodes\(\) expects PhpParser\\Node\\Stmt\\ClassMethod, PhpParser\\Node\\Stmt given#'
2019-03-26 23:56:10 +01:00
- '#Parameter \#2 \$constFetch of method Rector\\CodeQuality\\Rector\\Identical\\SimplifyArraySearchRector\:\:resolveIsNot\(\) expects PhpParser\\Node\\Expr\\ConstFetch, PhpParser\\Node given#'
- '#(.*?)PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Expr\\Variable given#'
2019-03-27 17:46:25 +01:00
# 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#'
2019-03-31 14:45:15 +02:00
- '#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<PhpParser\\Node\\Stmt\\Interface_\> but returns array<int, PhpParser\\Node\>#'
- '#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#'
2019-04-17 21:17:29 +02:00
- '#Method Rector\\CodingStyle\\Rector\\Namespace_\\ImportFullyQualifiedNamesRector\:\:getShortName\(\) should return string but returns string\|false#'
- '#Access to an undefined property PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Expr\\Variable\:\:\$name#'
- '#Empty array passed to foreach#'
- '#Method Rector\\RemovingStatic\\UniqueObjectFactoryFactory\:\:resolveClassShortName\(\) should return string but returns string\|false#'
- '#Strict comparison using \=\=\= between PhpParser\\Node\\Expr\\ArrayItem and null will always evaluate to false#'
- '#Anonymous function should have native typehint "string"#'
- '#Parameter \#2 \.\.\.\$args of function array_merge expects array, array<int, string\>\|false given#'
- '#Method Rector\\Collector\\CallableCollectorPopulator\:\:populate\(\) should return array<Closure\> but returns array<int\|string, callable\>#'
2019-05-11 15:22:57 +02:00
- '#Access to an undefined property PhpParser\\Node\\Expr\:\:\$args#'
# waits on php-parser release
- '#ArrowFunction#'
2019-05-11 15:22:57 +02:00
- '#Parameter \#6 \$fixup \(int\|null\) of method Rector\\PhpParser\\Printer\\BetterStandardPrinter\:\:pArray\(\) should be compatible with parameter \$subNodeName \(string\) of method PhpParser\\PrettyPrinterAbstract\:\:pArray\(\)#'
- '#Parameter \#6 \$subNodeName of method PhpParser\\PrettyPrinterAbstract\:\:pArray\(\) expects string, int\|null given#'
- '#Parameter \#7 \$fixup of method PhpParser\\PrettyPrinterAbstract\:\:pArray\(\) expects int\|null, string\|null given#'
- '#Class PhpParser\\Node\\Expr\\ArrayItem constructor invoked with 5 parameters, 1\-4 required#'