-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpstan.neon
More file actions
68 lines (68 loc) · 3.76 KB
/
Copy pathphpstan.neon
File metadata and controls
68 lines (68 loc) · 3.76 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
parameters:
level: 5
paths:
- lib
bootstrapFiles:
- phpstan-bootstrap.php
scanFiles:
# AppHost engine base classes live in the sibling openregister app and are
# not in vendor/ here. scanFiles (not stubFiles) registers these symbols so
# the leaf Health/Metrics controllers' "extends unknown class" resolves,
# WITHOUT phpstan analysing/reporting the skeleton file itself (ADR-040).
- tests/phpstan/apphost-symbols.php
excludePaths:
- vendor
- vendor-bin
# Apps that ship a verbatim template snapshot under lib/Resources/template/ (e.g. openbuild).
- lib/Resources/template
scanDirectories:
- vendor/nextcloud/ocp
reportUnmatchedIgnoredErrors: false
# Prevents false-positive "always true/false" errors caused by defensive runtime
# checks on values whose PHPDoc type is narrower than what callers may pass.
treatPhpDocTypesAsCertain: false
ignoreErrors:
# Nextcloud server internals (\OC, OC_App, OC\) not stubbed in nextcloud/ocp
- '#Call to an undefined method OC::#'
- '#Class OC not found#'
- '#Access to static property \$server on an unknown class OC#'
- '#unknown class OC\\#'
- '#Caught class OC\\#'
- '#unknown class OC_App#'
- '#Class OC_App not found#'
# OCA\DAV is server-internal and not in nextcloud/ocp stubs
- '#unknown class OCA\\DAV\\#'
- '#Class OCA\\DAV\\#'
# OCA classes from other apps (OpenRegister) not available during static analysis
- '#unknown class OCA\\OpenRegister\\#'
- '#OCA\\OpenRegister\\[a-zA-Z\\]+.*not found#'
- '#on an unknown class OCA\\OpenRegister\\#'
- '#has invalid return type OCA\\OpenRegister\\#'
- '#has invalid type OCA\\OpenRegister\\#'
- '#implements unknown interface OCA\\OpenRegister\\#'
# GuzzleHttp is available at runtime via Nextcloud but not in composer require
- '#unknown class GuzzleHttp\\#'
- '#GuzzleHttp\\[a-zA-Z\\]+.*not found#'
- '#on an unknown class GuzzleHttp\\#'
- '#invalid type GuzzleHttp\\#'
- '#Caught class GuzzleHttp\\#'
# Doctrine\DBAL is shipped by Nextcloud server but not stubbed in nextcloud/ocp
- '#unknown class Doctrine\\DBAL\\#'
- '#Doctrine\\DBAL\\[a-zA-Z\\]+.*not found#'
- '#on an unknown class Doctrine\\DBAL\\#'
# Doctrine\DBAL types used in migration table-builder helpers are valid at runtime
# but PHPStan cannot verify them without the Doctrine stubs available here.
- '#has invalid type Doctrine\\DBAL\\#'
# DataResponse constructor accepts plain array at runtime; OCP stub types
# it with a generic bound that PHPStan cannot satisfy when passing array directly.
- '#Parameter \$data of class OCP\\AppFramework\\Http\\DataResponse constructor expects#'
# Dynamic HTTP status codes from business rule validation results
# (matches both JSONResponse and DataResponse, and both Parameter $statusCode and Parameter #N $statusCode forms)
- '#Parameter (\#\d+ )?\$statusCode of class OCP\\AppFramework\\Http\\(JSON|Data)Response constructor expects#'
# registerRepairStep exists on server; not yet in nextcloud/ocp stub used for analysis
- '#Call to an undefined method OCP\\AppFramework\\Bootstrap\\IRegistrationContext::registerRepairStep#'
# OCP stub gaps for methods that exist at runtime
- '#Call to an undefined method OCP\\IRequest::getContent\(\)#'
- '#Call to an undefined method OCP\\IRequest::setParameter\(\)#'
- '#Call to an undefined method OCP\\Mail\\IMessage::attachFile\(\)#'
- '#Call to an undefined method OCP\\AppFramework\\Db\\Entity::jsonSerialize#'