forked from api-platform/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpstan.neon.dist
More file actions
132 lines (128 loc) · 8.9 KB
/
phpstan.neon.dist
File metadata and controls
132 lines (128 loc) · 8.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
parameters:
level: 5
paths:
- src
- tests
- tests/Fixtures/app/console
inferPrivatePropertyTypeFromConstructor: true
symfony:
container_xml_path: tests/Fixtures/app/var/cache/test/AppKernelTestDebugContainer.xml
constant_hassers: false
bootstrapFiles:
- vendor/bin/.phpunit/phpunit/vendor/autoload.php
# We're aliasing classes for phpunit in this file, it needs to be added here see phpstan/#2194
- src/Bridge/Symfony/Bundle/Test/Constraint/ArraySubset.php
- tests/Fixtures/app/AppKernel.php
excludes_analyse:
# Symfony cache
- tests/Fixtures/app/var/cache
# Deprecated integrations (will be removed in API Platform 3)
- src/Bridge/NelmioApiDoc/*
- tests/Bridge/NelmioApiDoc/*
- src/Bridge/FosUser/*
# BC layer
- tests/Bridge/Symfony/Bundle/DependencyInjection/Compiler/AnnotationFilterPassTest.php
- tests/Annotation/ApiResourceTest.php
- tests/Annotation/ApiPropertyTest.php
- tests/Metadata/Resource/Factory/AnnotationResourceMetadataFactoryTest.php
- tests/Fixtures/TestBundle/BrowserKit/Client.php
# The Symfony Configuration API isn't good enough to be analysed
- src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php
# Phpstan runs on phpunit > 9, a signature changed in this file
- src/Bridge/Symfony/Bundle/Test/Constraint/ArraySubsetLegacy.php
# Imported code (temporary)
- src/Bridge/Symfony/Bundle/Test/BrowserKitAssertionsTrait.php
- tests/Bridge/Symfony/Bundle/Test/WebTestCaseTest.php
- tests/ProphecyTrait.php
- tests/Behat/CoverageContext.php
earlyTerminatingMethodCalls:
PHPUnit\Framework\Constraint\Constraint:
- fail
ignoreErrors:
# Real problems, hard to fix
- '#Parameter \#2 \$dqlPart of method Doctrine\\ORM\\QueryBuilder::add\(\) expects array\|object, string given\.#'
# False positives
-
message: '#Strict comparison using !== between .+ and .+ will always evaluate to false\.#'
paths:
- src/Bridge/Doctrine/Common/PropertyHelperTrait.php
-
message: '#Variable \$iri might not be defined\.#'
path: src/JsonApi/Serializer/ItemNormalizer.php
-
message: '#Variable \$positionPm might not be defined\.#'
path: src/Util/ClassInfoTrait.php
- '#Access to an undefined property Prophecy\\Prophecy\\ObjectProphecy<(\\?[a-zA-Z0-9_]+)+>::\$[a-zA-Z0-9_]+#'
-
message: '#Call to an undefined method Doctrine\\Persistence\\ObjectManager::getConnection\(\)#'
path: src/Bridge/Doctrine/Common/Util/IdentifierManagerTrait.php
# https://github.com/willdurand/Negotiation/issues/89#issuecomment-513283286
-
message: '#Call to an undefined method Negotiation\\AcceptHeader::getType\(\)\.#'
path: src/EventListener/AddFormatListener.php
- '#Parameter \#1 \$vars of class GraphQL\\Language\\AST\\(IntValue|ObjectField|ObjectValue|BooleanValue|ListValue|StringValue)Node constructor expects array<bool\|float\|GraphQL\\Language\\AST\\Location\|GraphQL\\Language\\AST\\NameNode\|GraphQL\\Language\\AST\\NodeList\|GraphQL\\Language\\AST\\SelectionSetNode\|int\|string\|null>, array<string, .+> given\.#'
- '#Parameter \#1 \$defaultContext of class Symfony\\Component\\Serializer\\Encoder\\Json(De|En)code constructor expects array, (int|true) given\.#'
- '#Parameter \#(2|3) \$(resourceMetadataFactory|pagination) of class ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Extension\\PaginationExtension constructor expects (ApiPlatform\\Core\\Metadata\\Resource\\Factory\\ResourceMetadataFactoryInterface\|Symfony\\Component\\HttpFoundation\\RequestStack|ApiPlatform\\Core\\DataProvider\\Pagination\|ApiPlatform\\Core\\Metadata\\Resource\\Factory\\ResourceMetadataFactoryInterface), stdClass given\.#'
-
message: '#Parameter \#[0-9] \$filterLocator of class .+ constructor expects ApiPlatform\\Core\\Api\\FilterCollection|Psr\\Container\\ContainerInterface, ArrayObject<mixed, mixed> given\.#'
paths:
- tests/Bridge/Doctrine/Orm/Extension/FilterExtensionTest.php
- tests/Hydra/Serializer/CollectionFiltersNormalizerTest.php
- tests/Swagger/Serializer/DocumentationNormalizerV2Test.php
- tests/Swagger/Serializer/DocumentationNormalizerV3Test.php
-
message: '#Parameter \#1 \$objectValue of method GraphQL\\Type\\Definition\\InterfaceType::resolveType\(\) expects object, array(<string, string>)? given.#'
path: tests/GraphQl/Type/TypeBuilderTest.php
# https://github.com/phpstan/phpstan-doctrine/issues/115
-
message: '#Property ApiPlatform\\Core\\Test\\DoctrineMongoDbOdmFilterTestCase::\$repository \(Doctrine\\ODM\\MongoDB\\Repository\\DocumentRepository\) does not accept Doctrine\\ORM\\EntityRepository<ApiPlatform\\Core\\Tests\\Fixtures\\TestBundle\\Document\\Dummy>\.#'
path: src/Test/DoctrineMongoDbOdmFilterTestCase.php
-
message: "#Call to method PHPUnit\\\\Framework\\\\Assert::assertSame\\(\\) with array\\('(collection_context|item_context|subresource_context)'\\) and array<Symfony\\\\Component\\\\VarDumper\\\\Cloner\\\\Data>\\|bool\\|float\\|int\\|string\\|null will always evaluate to false\\.#"
path: tests/Bridge/Symfony/Bundle/DataCollector/RequestDataCollectorTest.php
# https://github.com/phpstan/phpstan-phpunit/issues/62
-
message: '#Call to method PHPUnit\\Framework\\Assert::assertSame\(\) with 2 and int will always evaluate to false\.#'
path: tests/Identifier/Normalizer/IntegerDenormalizerTest.php
-
message: '#Call to method PHPUnit\\Framework\\Assert::assertSame\(\) with array\(.+\) and array\(.+\) will always evaluate to false\.#'
path: tests/Util/SortTraitTest.php
# https://github.com/phpstan/phpstan-symfony/issues/76
-
message: '#Service "test" is not registered in the container\.#'
path: tests/GraphQl/Type/TypesContainerTest.php
-
message: '#Property Doctrine\\ORM\\Mapping\\ClassMetadataInfo::\$fieldMappings \(array.*\)>\) does not accept array\(.*\)\.#'
path: tests/Bridge/Doctrine/Orm/Metadata/Property/DoctrineOrmPropertyMetadataFactoryTest.php
# Expected, due to PHP 8 attributes
- '#ReflectionProperty::getAttributes\(\)#'
- '#ReflectionMethod::getAttributes\(\)#'
- '#ReflectionClass<mixed>::getAttributes\(\)#'
- '#Constructor of class ApiPlatform\\Core\\Annotation\\ApiResource has an unused parameter#'
- '#Constructor of class ApiPlatform\\Core\\Annotation\\ApiProperty has an unused parameter#'
# Expected, due to optional interfaces
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Extension\\QueryCollectionExtensionInterface::applyToCollection\(\) invoked with 5 parameters, 3-4 required\.#'
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Extension\\QueryResult(Item|Collection)ExtensionInterface::getResult\(\) invoked with 4 parameters, 1 required\.#'
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Extension\\QueryResult(Item|Collection)ExtensionInterface::supportsResult\(\) invoked with 3 parameters, 1-2 required\.#'
- '#Method ApiPlatform\\Core\\Bridge\\Symfony\\Routing\\RouteNameResolverInterface::getRouteName\(\) invoked with 3 parameters, 2 required\.#'
- '#Method ApiPlatform\\Core\\DataPersister\\DataPersisterInterface::persist\(\) invoked with 2 parameters, 1 required\.#'
- '#Method ApiPlatform\\Core\\DataPersister\\DataPersisterInterface::remove\(\) invoked with 2 parameters, 1 required\.#'
- '#Method ApiPlatform\\Core\\DataPersister\\DataPersisterInterface::supports\(\) invoked with 2 parameters, 1 required\.#'
- '#Method ApiPlatform\\Core\\DataProvider\\CollectionDataProviderInterface::getCollection\(\) invoked with 3 parameters, 1-2 required\.#'
- '#Method Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface::denormalize\(\) invoked with (2|3|4) parameters, 1 required\.#'
- '#Method Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface::normalize\(\) invoked with (2|3|4) parameters, 1 required\.#'
- '#Method Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface::supportsNormalization\(\) invoked with 3 parameters, 1-2 required\.#'
# Expected, due to deprecations
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Filter\\(Abstract|Exists|Order)Filter::filterProperty\(\) invoked with 7 parameters, 5-6 required\.#'
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Filter\\(AbstractFilter|FilterInterface)::apply\(\) invoked with 5 parameters, 3-4 required\.#'
- '#Method ApiPlatform\\Core\\PathResolver\\OperationPathResolverInterface::resolveOperationPath\(\) invoked with 4 parameters, 3 required\.#'
# Expected, due to backward compatibility
-
message: "#Call to function method_exists\\(\\) with ApiPlatform\\\\Core\\\\JsonApi\\\\Serializer\\\\ItemNormalizer and 'setCircularReferenc…' will always evaluate to false\\.#"
path: tests/JsonApi/Serializer/ItemNormalizerTest.php
# Waiting to be fixed by https://github.com/Roave/BetterReflection/issues/663
-
message: '#Call to private method getNestedFieldPath\(\) of class ApiPlatform\\Core\\Bridge\\Elasticsearch\\DataProvider\\Filter\\AbstractFilter\.#'
paths:
- src/Bridge/Elasticsearch/DataProvider/Filter/OrderFilter.php
- src/Bridge/Elasticsearch/DataProvider/Filter/AbstractSearchFilter.php