Merge "i18n: Add line-break in email notificaton for minor edits"
[lhc/web/wiklou.git] / .phan / config.php
1 <?php
2 /**
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
17 *
18 * @file
19 */
20
21 $cfg = require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
22
23 $cfg['file_list'] = array_merge(
24 $cfg['file_list'],
25 function_exists( 'register_postsend_function' ) ? [] : [ '.phan/stubs/hhvm.php' ],
26 function_exists( 'wikidiff2_do_diff' ) ? [] : [ '.phan/stubs/wikidiff.php' ],
27 class_exists( PEAR::class ) ? [] : [ '.phan/stubs/mail.php' ],
28 defined( 'PASSWORD_ARGON2I' ) ? [] : [ '.phan/stubs/password.php' ],
29 // Per composer.json, PHPUnit 6 is used for PHP 7.0+, PHPUnit 4 otherwise.
30 // Load the interface for the version of PHPUnit that isn't installed.
31 // Phan only supports PHP 7.0+ (and not HHVM), so we only need to stub PHPUnit 4.
32 class_exists( PHPUnit_TextUI_Command::class ) ? [] : [ '.phan/stubs/phpunit4.php' ],
33 class_exists( ProfilerExcimer::class ) ? [] : [ '.phan/stubs/excimer.php' ],
34 [
35 'maintenance/7zip.inc',
36 'maintenance/cleanupTable.inc',
37 'maintenance/CodeCleanerGlobalsPass.inc',
38 'maintenance/commandLine.inc',
39 'maintenance/sqlite.inc',
40 'maintenance/userDupes.inc',
41 'maintenance/language/checkLanguage.inc',
42 'maintenance/language/languages.inc',
43 ]
44 );
45
46 $cfg['autoload_internal_extension_signatures'] = [
47 'memcached' => '.phan/internal_stubs/memcached.phan_php',
48 'oci8' => '.phan/internal_stubs/oci8.phan_php',
49 'sqlsrv' => '.phan/internal_stubs/sqlsrv.phan_php',
50 'tideways' => '.phan/internal_stubs/tideways.phan_php',
51 ];
52
53 $cfg['directory_list'] = [
54 'includes/',
55 'languages/',
56 'maintenance/',
57 'mw-config/',
58 'resources/',
59 'vendor/',
60 '.phan/stubs/',
61 ];
62
63 $cfg['exclude_analysis_directory_list'] = [
64 'vendor/',
65 '.phan/stubs/',
66 // The referenced classes are not available in vendor, only when
67 // included from composer.
68 'includes/composer/',
69 // Directly references classes that only exist in Translate extension
70 'maintenance/language/',
71 // External class
72 'includes/libs/jsminplus.php',
73 ];
74
75 $cfg['suppress_issue_types'] = array_merge( $cfg['suppress_issue_types'], [
76 // approximate error count: 18
77 "PhanAccessMethodInternal",
78 // approximate error count: 17
79 "PhanCommentParamOnEmptyParamList",
80 // approximate error count: 30
81 "PhanCommentParamWithoutRealParam",
82 // approximate error count: 2
83 "PhanCompatibleNegativeStringOffset",
84 // approximate error count: 1
85 "PhanEmptyFQSENInCallable",
86 // approximate error count: 1
87 "PhanInvalidCommentForDeclarationType",
88 // approximate error count: 6
89 "PhanNonClassMethodCall",
90 // approximate error count: 21
91 "PhanParamReqAfterOpt",
92 // approximate error count: 27
93 "PhanParamSignatureMismatch",
94 // approximate error count: 4
95 "PhanParamSignatureMismatchInternal",
96 // approximate error count: 1
97 "PhanParamSignatureRealMismatchTooFewParameters",
98 // approximate error count: 1
99 "PhanParamSuspiciousOrder",
100 // approximate error count: 127
101 "PhanParamTooMany",
102 // approximate error count: 2
103 "PhanParamTooManyCallable",
104 // approximate error count: 1
105 "PhanParamTooManyInternal",
106 // approximate error count: 2
107 "PhanPluginDuplicateExpressionBinaryOp",
108 // approximate error count: 2
109 "PhanTraitParentReference",
110 // approximate error count: 27
111 "PhanTypeArraySuspicious",
112 // approximate error count: 33
113 "PhanTypeArraySuspiciousNullable",
114 // approximate error count: 26
115 "PhanTypeComparisonFromArray",
116 // approximate error count: 2
117 "PhanTypeComparisonToArray",
118 // approximate error count: 1
119 "PhanTypeConversionFromArray",
120 // approximate error count: 2
121 "PhanTypeExpectedObjectOrClassName",
122 // approximate error count: 7
123 "PhanTypeExpectedObjectPropAccess",
124 // approximate error count: 3
125 "PhanTypeInstantiateAbstract",
126 // approximate error count: 1
127 "PhanTypeInvalidCallableArraySize",
128 // approximate error count: 62
129 "PhanTypeInvalidDimOffset",
130 // approximate error count: 10
131 "PhanTypeInvalidExpressionArrayDestructuring",
132 // approximate error count: 1
133 "PhanTypeInvalidLeftOperand",
134 // approximate error count: 7
135 "PhanTypeInvalidLeftOperandOfIntegerOp",
136 // approximate error count: 2
137 "PhanTypeInvalidRightOperand",
138 // approximate error count: 2
139 "PhanTypeInvalidRightOperandOfIntegerOp",
140 // approximate error count: 1
141 "PhanTypeMagicVoidWithReturn",
142 // approximate error count: 152
143 "PhanTypeMismatchArgument",
144 // approximate error count: 28
145 "PhanTypeMismatchArgumentInternal",
146 // approximate error count: 1
147 "PhanTypeMismatchBitwiseBinaryOperands",
148 // approximate error count: 1
149 "PhanTypeMismatchDeclaredParam",
150 // approximate error count: 2
151 "PhanTypeMismatchDimEmpty",
152 // approximate error count: 29
153 "PhanTypeMismatchDimFetch",
154 // approximate error count: 10
155 "PhanTypeMismatchForeach",
156 // approximate error count: 77
157 "PhanTypeMismatchProperty",
158 // approximate error count: 88
159 "PhanTypeMismatchReturn",
160 // approximate error count: 43
161 "PhanTypeMissingReturn",
162 // approximate error count: 1
163 "PhanTypeNoAccessiblePropertiesForeach",
164 // approximate error count: 4
165 "PhanTypeNonVarPassByRef",
166 // approximate error count: 12
167 "PhanTypeObjectUnsetDeclaredProperty",
168 // approximate error count: 9
169 "PhanTypeSuspiciousNonTraversableForeach",
170 // approximate error count: 3
171 "PhanTypeSuspiciousStringExpression",
172 // approximate error count: 22
173 "PhanUndeclaredConstant",
174 // approximate error count: 3
175 "PhanUndeclaredInvokeInCallable",
176 // approximate error count: 242
177 "PhanUndeclaredMethod",
178 // approximate error count: 847
179 "PhanUndeclaredProperty",
180 // approximate error count: 1
181 "PhanUndeclaredTypeReturnType",
182 // approximate error count: 3
183 "PhanUndeclaredTypeThrowsType",
184 // approximate error count: 2
185 "PhanUndeclaredVariableAssignOp",
186 // approximate error count: 55
187 "PhanUndeclaredVariableDim",
188 // approximate error count: 4
189 "PhanUnextractableAnnotationElementName",
190 // approximate error count: 4
191 "PhanUnextractableAnnotationSuffix",
192 ] );
193
194 $cfg['ignore_undeclared_variables_in_global_scope'] = true;
195 $cfg['globals_type_map']['IP'] = 'string';
196
197 return $cfg;