2018-09-14 18:01:40 +02:00
includes:
2018-09-15 20:50:52 +02:00
- 'vendor/symplify/phpstan-extensions/config/config.neon'
2018-09-21 07:12:24 +02:00
- '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-09-14 18:01:40 +02:00
excludes_analyse:
# 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
- '*tests/**/Wrong/*'
- '*tests/**/Correct/*'
- '*tests/**/Source/*'
2017-11-06 11:40:43 +01:00
ignoreErrors:
2018-03-28 09:04:03 -03:00
# the # after each ignored error is the number of occurrences
2018-08-13 18:50:48 +02:00
- '#Parameter \#2 \$filePath of method Rector\\(.*?)::decorateNodesFromFile\(\) expects string, string\|false given#'
2018-08-13 17:50:16 +02:00
2018-08-09 10:03:18 +02:00
# missuse of interface and class
- '#Parameter \#1 (.*?) expects Symfony\\Component\\DependencyInjection\\ContainerBuilder, Symfony\\Component\\DependencyInjection\\ContainerInterface given#' # 2
2018-08-09 14:50:18 +02:00
- '#Method Rector\\Symfony\\Bridge\\DefaultAnalyzedSymfonyApplicationContainer::getContainer\(\) should return Symfony\\Component\\DependencyInjection\\ContainerBuilder but returns Symfony\\Component\\DependencyInjection\\Container#' # 1
2018-08-09 10:03:18 +02:00
2018-07-25 13:06:07 +02:00
# 0.10.2
# false positives & ->toString() methods
- '#Cannot cast PhpParser\\Node\\Expr\|string to string#' # 8
- '#Offset string does not exist on string#' # 1
- '#Cannot cast PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Identifier to string#'
- '#Cannot cast PhpParser\\Node\\Expr\|PhpParser\\Node\\Identifier to string#' # 4
- '#Cannot cast PhpParser\\Node\\Expr\|PhpParser\\Node\\Identifier|string to string#' # 3
- '#Cannot cast PhpParser\\Node\\Expr\|PhpParser\\Node\\Name to string#'
- '#Array \(array<array<PhpParser\\Node\\Stmt>>\) does not accept array<PhpParser\\Node\\Stmt|null>#'
# already fixed, invalidated cache?
- '#Access to an undefined property PhpParser\\Node\\Expr::\$args#'
2018-08-06 12:31:17 +02:00
2018-08-13 17:50:16 +02:00
# symfony container autowire interface falsy
- '#Call to an undefined method Symfony\\Component\\DependencyInjection\\ContainerInterface::getServiceIds\(\)#'
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-08-31 00:57:59 +02:00
# false postive - type is set by annotatoin above
- '#Access to an undefined property PhpParser\\Node::\$(args|var)#'
2018-09-16 19:30:17 +02:00
- '#Call to function is_string\(\) with PhpParser\\Node\\Expr\|PhpParser\\Node\\Identifier will always evaluate to false#'
2018-08-31 00:57:59 +02:00
2018-07-25 13:06:07 +02:00
# irelevant
- '#Call to function in_array\(\) with arguments string, array<array<string\|false>> and true will always evaluate to false#'
# known values
2018-08-31 14:23:53 +02:00
- '#Parameter \#1 \$methodCallNode of method Rector\\PHPUnit\\Rector\\TryCatchToExpectExceptionRector::renameMethodCallAndKeepFirstArgument\(\) expects PhpParser\\Node\\Expr\\MethodCall, PhpParser\\Node given#'
2018-08-15 00:12:41 +02:00
- '#Access to an undefined property PhpParser\\Node\\Expr\\MethodCall\|PhpParser\\Node\\Stmt\\ClassMethod::\$params#'
2018-08-14 13:24:34 +02:00
- '#Cannot call method getName\(\) on PHPStan\\Reflection\\ClassReflection\|null#' # 1
2018-08-06 10:22:01 +02:00
- '#Parameter \#1 \$classReflection of method Rector\\NodeTypeResolver\\Reflection\\ClassReflectionTypesResolver::resolve\(\) expects PHPStan\\Reflection\\ClassReflection, PHPStan\\Reflection\\ClassReflection|null given#'
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 getBasename\(\) on Symfony\\Component\\Finder\\SplFileInfo\|null#'
- '#Cannot call method getText\(\) on PhpParser\\Comment\\Doc\|null#'
# Error php-parser token
- '#Access to an undefined property PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Expr\\Variable::\$name#'
2018-09-21 07:12:24 +02:00
# SplFileInfo::getRealPath() strict
2018-07-25 13:06:07 +02:00
- '#Parameter \#1 \$filePath of method Rector\\Parser\\Parser::parseFile\(\) expects string, string\|false given#'
2018-09-21 07:12:24 +02:00
- '#Parameter \#2 \$filename of function fnmatch expects string, string\|false given#'
- '#Parameter \#1 \$filename of function Safe\\file_put_contents expects string, string\|false given#'
- '#Parameter \#2 \$args of function Safe\\sprintf expects float\|int\|string\|null, string\|false given#'
2018-07-25 13:06:07 +02:00
2017-11-06 12:48:43 +01:00
# false positive, has annotation type above (@todo recheck for possible ignored positives)
2018-05-12 13:48:36 -03:00
- '#Access to an undefined property PhpParser\\Node::\$name#' # 11
2018-03-19 14:39:58 -03:00
- '#Parameter \#1 \$node of method Rector\\NodeAnalyzer\\ClassConstAnalyzer::isNames\(\) expects PhpParser\\Node\\Expr\\ClassConstFetch, PhpParser\\Node given#' # 1
2017-11-06 14:15:35 +01:00
2017-12-10 01:13:25 +01:00
# subtype
2018-05-12 13:48:36 -03:00
- '#Property PhpParser\\Node\\Param::\$type \(PhpParser\\Node\\Name|PhpParser\\Node\\NullableType\|string\|null\) does not accept PhpParser\\Node\\Identifier|PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType#' # 3
2017-12-10 01:13:25 +01:00
2018-04-09 00:08:05 +02:00
# intentionally incorrect - part of the test
2018-08-01 11:53:26 +02:00
- '#Parameter \#2 \$codeSamples of class Rector\\RectorDefinition\\RectorDefinition constructor expects array<Rector\\Contract\\RectorDefinition\\CodeSampleInterface>, array<int, stdClass> given#' # 1
# invalid interface type resolution
- '#Method Rector\\NodeTraverser\\RectorNodeTraverser::getRectors\(\) should return array<Rector\\Contract\\Rector\\PhpRectorInterface> but returns array<PhpParser\\NodeVisitor>#' # 1
2018-04-09 00:08:05 +02:00
2017-11-06 13:58:51 +01:00
# known values
2018-05-12 13:48:36 -03:00
- '#Access to an undefined property PHPStan\\PhpDocParser\\Ast\\Node::\$name#' # 2
2018-04-02 15:17:12 +02:00
2018-05-12 15:11:10 -03:00
- '#Method Rector\\Node\\NodeFactory::createNullConstant\(\) should return PhpParser\\Node\\Expr\\ConstFetch but returns PhpParser\\Node\\Expr#' # 1
2018-01-18 19:10:39 -02:00
- '#Method Rector\\Node\\NodeFactory::createNamespace\(\) should return PhpParser\\Node\\Stmt\\Namespace_ but returns PhpParser\\Node#' # 1
2018-08-13 20:11:03 +02:00
- '#Method Rector\\Utils\\BetterNodeFinder::findFirstAncestorInstanceOf\(\) should return PhpParser\\Node\|null but returns object#' # 1
2018-08-15 18:53:53 +02:00
- '#Property Rector\\NodeTypeResolver\\NodeVisitor\\NamespaceNodeVisitor::\$useNodes \(array<PhpParser\\Node\\Stmt\\Use_>\) does not accept array<PhpParser\\Node>#' # 1
2018-05-12 13:48:36 -03:00
- '#Parameter \#1 \$node of method Rector\\NodeTypeResolver\\NodeTypeResolver::resolve\(\) expects PhpParser\\Node, PhpParser\\Node\\Expr|string given#' # 3
2017-11-06 11:40:43 +01:00
2017-11-06 14:24:40 +01:00
# buggy
2018-05-12 15:11:10 -03:00
- '#Access to an undefined property PhpParser\\Node\\Expr::\$value#' # 2
- '#Access to an undefined property PhpParser\\Node\\Expr::\$(name|var)#' # 2
2018-02-21 00:27:01 +01:00
2018-09-21 07:12:24 +02:00
# variadic false positive
- '#In method "Rector\\Node\\NodeFactory::createArray", parameter \$items can be type-hinted to "array"#'
- '#In method "Rector\\Builder\\StatementGlue::addStatementToClassBeforeTypes", parameter \$types type is "array". Please provide a \@param annotation to further specify the type of the array. For instance: \@param int\[\] \$types#'
2018-08-13 20:11:03 +02:00
2018-09-21 07:12:24 +02:00
# intentionally
- '#Empty catch block#'