Skip to content

Commit 99e32e1

Browse files
LukasReschkeMorrisJobke
authored andcommitted
Add stricter phan config
* fix ocs/ and remote.php * ignore some more templates of apps Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
1 parent 3a41db7 commit 99e32e1

1 file changed

Lines changed: 43 additions & 3 deletions

File tree

build/.phan/config.php

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,48 +54,66 @@
5454
'apps/comments/composer',
5555
'apps/comments/tests',
5656
'apps/dav/composer',
57+
'apps/dav/templates',
5758
'apps/dav/tests',
5859
'apps/encryption/composer',
60+
'apps/encryption/templates/',
5961
'apps/encryption/tests',
6062
'apps/federatedfilesharing/composer',
63+
'apps/federatedfilesharing/templates/',
6164
'apps/federatedfilesharing/tests',
6265
'apps/federation/composer',
66+
'apps/federation/templates/',
6367
'apps/federation/tests',
6468
'apps/files/composer',
69+
'apps/files/templates/',
6570
'apps/files/tests',
6671
'apps/files_external/3rdparty',
6772
'apps/files_external/composer',
73+
'apps/files_external/templates/',
6874
'apps/files_external/tests',
6975
'apps/files_sharing/composer',
76+
'apps/files_sharing/templates/',
7077
'apps/files_sharing/tests',
7178
'apps/files_trashbin/composer',
79+
'apps/files_trashbin/templates/',
7280
'apps/files_trashbin/tests',
7381
'apps/files_versions/composer',
7482
'apps/files_versions/tests',
7583
'apps/lookup_server_connector/composer',
7684
'apps/lookup_server_connector/tests',
7785
'apps/oauth2/composer',
86+
'apps/oauth2/templates/',
7887
'apps/oauth2/tests',
7988
'apps/provisioning_api/composer',
8089
'apps/provisioning_api/tests',
8190
'apps/sharebymail/composer',
91+
'apps/sharebymail/templates/',
8292
'apps/sharebymail/tests',
8393
'apps/systemtags/composer',
94+
'apps/systemtags/templates',
8495
'apps/systemtags/tests',
8596
'apps/testing/composer',
8697
'apps/testing/tests',
8798
'apps/theming/composer',
99+
'apps/theming/templates/',
88100
'apps/theming/tests',
89101
'apps/twofactor_backupcodes/composer',
102+
'apps/twofactor_backupcodes/templates/',
90103
'apps/twofactor_backupcodes/tests',
91104
'apps/updatenotification/composer',
105+
'apps/updatenotification/templates/',
92106
'apps/updatenotification/tests',
93107
'apps/user_ldap/composer',
108+
'apps/user_ldap/templates/',
94109
'apps/user_ldap/tests',
95110
'apps/workflowengine/composer',
111+
'apps/workflowengine/templates/',
96112
'apps/workflowengine/tests',
97113
'build/.phan/',
114+
'core/templates',
98115
'lib/composer',
116+
'settings/templates',
99117
],
100118

101119
// A file list that defines files that will be excluded
@@ -135,7 +153,7 @@
135153
// it before upgrading your version of PHP to a
136154
// new version that has backward compatibility
137155
// breaks.
138-
'backward_compatibility_checks' => false,
156+
'backward_compatibility_checks' => true,
139157

140158
// Run a quick version of checks that takes less
141159
// time at the cost of not running as thorough
@@ -144,12 +162,34 @@
144162
// to fix in your code base.
145163
'quick_mode' => false,
146164

165+
// If true, check to make sure the return type declared
166+
// in the doc-block (if any) matches the return type
167+
// declared in the method signature. This process is
168+
// slow.
169+
'check_docblock_signature_return_type_match' => true,
170+
147171
// If true, check to make sure the return type declared
148172
// in the doc-block (if any) matches the return type
149173
// declared in the method signature. This process is
150174
// slow.
151175
'check_docblock_signature_param_type_match' => true,
152176

177+
// (*Requires check_docblock_signature_param_type_match to be true*)
178+
// If true, make narrowed types from phpdoc params override
179+
// the real types from the signature, when real types exist.
180+
// (E.g. allows specifying desired lists of subclasses,
181+
// or to indicate a preference for non-nullable types over nullable types)
182+
// Affects analysis of the body of the method and the param types passed in by callers.
183+
'prefer_narrowed_phpdoc_param_type' => true,
184+
185+
// (*Requires check_docblock_signature_return_type_match to be true*)
186+
// If true, make narrowed types from phpdoc returns override
187+
// the real types from the signature, when real types exist.
188+
// (E.g. allows specifying desired lists of subclasses,
189+
// or to indicate a preference for non-nullable types over nullable types)
190+
// Affects analysis of return statements in the body of the method and the return types passed in by callers.
191+
'prefer_narrowed_phpdoc_return_type' => true,
192+
153193
// If enabled, check all methods that override a
154194
// parent method to make sure its signature is
155195
// compatible with the parent's. This check
@@ -187,7 +227,7 @@
187227

188228
// If enabled, scalars (int, float, bool, true, false, string, null)
189229
// are treated as if they can cast to each other.
190-
'scalar_implicit_cast' => true,
230+
'scalar_implicit_cast' => false,
191231

192232
// If this has entries, scalars (int, float, bool, true, false, string, null)
193233
// are allowed to perform the casts listed.
@@ -201,7 +241,7 @@
201241
// scope will be ignored. This is useful for projects
202242
// with complicated cross-file globals that you have no
203243
// hope of fixing.
204-
'ignore_undeclared_variables_in_global_scope' => true,
244+
'ignore_undeclared_variables_in_global_scope' => false,
205245

206246
// Add any issue types (such as 'PhanUndeclaredMethod')
207247
// to this black-list to inhibit them from being reported.

0 commit comments

Comments
 (0)