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
130 lines (126 loc) · 8.86 KB
/
Copy pathphpstan.neon.dist
File metadata and controls
130 lines (126 loc) · 8.86 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
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/Core/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/Core/Bridge/NelmioApiDoc/*
- tests/Core/Bridge/NelmioApiDoc/*
- src/Core/Bridge/FosUser/*
# BC layer
- tests/Core/Bridge/Symfony/Bundle/DependencyInjection/Compiler/AnnotationFilterPassTest.php
- tests/Core/Annotation/ApiResourceTest.php
- tests/Core/Annotation/ApiPropertyTest.php
- tests/Core/Metadata/Resource/Factory/AnnotationResourceMetadataFactoryTest.php
- tests/Fixtures/TestBundle/BrowserKit/Client.php
# The Symfony Configuration API isn't good enough to be analysed
- src/Core/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php
# Phpstan runs on phpunit > 9, a signature changed in this file
- src/Core/Bridge/Symfony/Bundle/Test/Constraint/ArraySubsetLegacy.php
# Imported code (temporary)
- src/Core/Bridge/Symfony/Bundle/Test/BrowserKitAssertionsTrait.php
- tests/Core/Bridge/Symfony/Bundle/Test/WebTestCaseTest.php
- tests/Core/ProphecyTrait.php
- tests/Core/Behat/CoverageContext.php
- tests/Fixtures/TestBundle/Security/AbstractSecurityUser.php
# Templates for Maker
- src/Core/Bridge/Symfony/Maker/Resources/skeleton
- src/Bridge/Symfony/Maker/Resources/skeleton
# Rector because new API Platform 3.0 classes don't exist yet
- src/Core/Bridge/Rector
- src/Core/Bridge/Symfony/Bundle/Command/RectorCommand.php
- tests/Core/Bridge/Rector/Rules
earlyTerminatingMethodCalls:
PHPUnit\Framework\Constraint\Constraint:
- fail
ApiPlatform\Metadata\Resource\ResourceMetadataCollection:
- handleNotFound
ignoreErrors:
# False positives
-
message: '#Unreachable statement - code above always terminates.#'
paths:
- tests/GraphQl/Resolver/Stage/SecurityPostDenormalizeStageTest.php
-
message: "#Parameter \\#2 \\$dqlPart of method Doctrine\\\\ORM\\\\QueryBuilder::add\\(\\) expects array<'join'\\|int, array<int\\|string, object>\\|string>\\|object\\|string, array\\('o' => Doctrine\\\\ORM\\\\Query\\\\Expr\\\\Join\\) given\\.#"
paths:
- tests/Core/Bridge/Doctrine/Orm/Extension/FilterEagerLoadingExtensionTest.php
-
message: '#Strict comparison using !== between .+ and .+ will always evaluate to false\.#'
paths:
- src/Core/Bridge/Doctrine/Common/PropertyHelperTrait.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/Core/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/Core/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/Core/Bridge/Doctrine/Orm/Extension/FilterExtensionTest.php
- tests/Core/Hydra/Serializer/CollectionFiltersNormalizerTest.php
- tests/Core/Swagger/Serializer/DocumentationNormalizerV2Test.php
- tests/Core/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\\Tests\\Fixtures\\TestBundle\\Document\\Dummy>\.#'
path: src/Core/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/Core/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/Core/Identifier/Normalizer/IntegerDenormalizerTest.php
-
message: '#Call to method PHPUnit\\Framework\\Assert::assertSame\(\) with array\(.+\) and array\(.+\) will always evaluate to false\.#'
path: tests/Core/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
# Expected, due to PHP 8 attributes
- '#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/Core/JsonApi/Serializer/ItemNormalizerTest.php