2018-09-14 18:01:40 +02:00
includes:
2018-09-15 20:50:52 +02:00
- 'vendor/symplify/phpstan-extensions/config/config.neon'
2019-01-18 03:41:58 +01:00
# return after compatibility with phpstan 0.11
# - 'vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon'
# - 'vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.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-14 23:05:14 +01:00
reportUnmatchedIgnoredErrors: false
2018-12-12 09:15:04 +01:00
level: 7
2018-10-18 22:42:58 +02:00
2018-09-14 18:01:40 +02:00
excludes_analyse:
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'
2018-09-14 18:01:40 +02:00
- '*tests/Rector/MethodCall/MethodNameReplacerRector/**/SomeClass.php'
- '*packages/BetterReflection/tests/Reflector/NotLoadedSource/SomeClass.php'
- 'packages/NodeTypeResolver/tests/PerNodeTypeResolver/VariableTypeResolver/Source/NewClass.php'
# tests files
2018-12-06 01:55:00 +01:00
- '*tests/**/Fixture/*'
2018-09-14 18:01:40 +02:00
- '*tests/**/Source/*'
2018-10-08 13:19:10 +08:00
# intetionally original
- 'packages/Php/src/EregToPcreTransformer.php'
2018-10-13 18:34:37 +08:00
- '*/packages/ContributorTools/templates/*'
2018-10-21 21:43:47 +02:00
# 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
- '#PHPDoc tag \@param for parameter \$node with type float is incompatible with native type PhpParser\\Node#'
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-10-01 12:27:56 +08:00
- '#(.*?)\(\) should return Psr\\Container\\ContainerInterface but returns Symfony\\Component\\DependencyInjection\\ContainerInterface\|null#'
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#'
2018-12-15 21:28:41 +01:00
# subtype
2018-12-21 19:03:46 +01:00
- '#(.*?) expects ReflectionFunction\|ReflectionMethod, ReflectionFunctionAbstract given#'
2018-07-25 13:06:07 +02:00
2018-08-06 12:31:17 +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-12-16 14:42:59 +01:00
- '#Method Rector\\Php\\Rector\\FuncCall\\RegexDashEscapeRector::findAssigners\(\) should return array<PhpParser\\Node\\Expr\\Assign> but returns array<PhpParser\\Node>#'
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\>\>#'
2018-10-19 06:44:55 +02:00
- '#Method Rector\\NodeTypeResolver\\PhpDoc\\NodeAnalyzer\\DocBlockAnalyzer::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-11-07 18:22:27 +01:00
- '#Parameter \#1 \$binaryOpNode of method Rector\\CodeQuality\\Rector\\Identical\\SimplifyConditionsRector::createInversedBooleanOp\(\) expects PhpParser\\Node\\Expr\\BinaryOp, 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
2018-12-15 13:47:01 +01:00
- '#Access to an undefined property PhpParser\\Node\\Expr::\$left#'
- '#Access to an undefined property PhpParser\\Node\\Expr::\$right#'
2018-10-21 12:32:51 +02:00
- '#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-31 08:38:25 +02:00
- '#Cannot call method getAttribute\(\) on PhpParser\\Node\\Name\|null#'
2018-07-25 13:06:07 +02:00
- '#Cannot call method getText\(\) on PhpParser\\Comment\\Doc\|null#'
2018-12-25 17:00:06 +01:00
- '#Method Rector\\PhpParser\\Node\\Maintainer\\PropertyMaintainer::getAllPropertyFetch\(\) should return array<PhpParser\\Node\\Expr\\PropertyFetch> but returns array<PhpParser\\Node>#'
2018-07-25 13:06:07 +02:00
2018-10-15 21:30:38 +08:00
# false positive, has annotation type above
2018-10-21 12:32:51 +02:00
- '#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+)#'
- '#Parameter \#2 \$boolConstFetchNode of method Rector\\CodeQuality\\Rector\\Identical\\SimplifyArraySearchRector::resolveIsNot\(\) expects PhpParser\\Node\\Expr\\ConstFetch, PhpParser\\Node given#'
2018-11-08 12:56:06 +01:00
- '#Method Rector\\PhpParser\\Node\\BetterNodeFinder::findFirstAncestorInstanceOf\(\) should return PhpParser\\Node\|null but returns object#'
2018-10-21 12:32:51 +02:00
2018-10-22 12:43:10 +02:00
# false positive, resolved in previous method
2018-11-04 17:53:20 +01:00
- '#Parameter (.*?) of method Rector\\PhpParser\\Node\\Maintainer\\IdentifierMaintainer\:\:(.*?)\(\) 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-11-04 17:53:20 +01:00
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#'
2019-01-14 23:05:14 +01:00
- '#Access to an undefined property PHPStan\\PhpDocParser\\Ast\\Node::\$name#'
2018-10-07 17:53:59 +08:00
- '#Cannot access property \$value on PhpParser\\Node\\Expr\\ArrayItem\|null#'
2018-12-06 14:19:58 +01:00
- '#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
2018-10-22 12:43:10 +02:00
# use of 3rd party factory that returns general type
2019-01-14 23:05:14 +01:00
- '#Property Rector\\NodeTypeResolver\\NodeVisitor\\NamespaceNodeVisitor::\$useNodes \(array<PhpParser\\Node\\Stmt\\Use_>\) does not accept array<PhpParser\\Node>#'
2018-02-21 00:27:01 +01:00
2018-10-06 12:32:19 +08:00
# not really needed, empty
2018-11-04 02:17:02 +01:00
- '#Rector\\PhpParser\\NodeTraverser\\RectorNodeTraverser::__construct\(\) does not call parent constructor from PhpParser\\NodeTraverser#'
2018-10-06 12:32:19 +08:00
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#'
- '#Cannot cast array<string>\|string\|null to string#'
2018-09-21 07:19:24 +02:00
services:
-
2018-09-28 01:14:25 +08:00
class: Symplify\PHPStanExtensions\Type\SplFileInfoTolerantDynamicMethodReturnTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension