MediaWiki REL1_31
config.php
Go to the documentation of this file.
1<?php
2
3// If xdebug is enabled, we need to increase the nesting level for phan
4ini_set( 'xdebug.max_nesting_level', 1000 );
5
28return [
35 'file_list' => array_merge(
36 function_exists( 'register_postsend_function' ) ? [] : [ 'tests/phan/stubs/hhvm.php' ],
37 function_exists( 'wikidiff2_do_diff' ) ? [] : [ 'tests/phan/stubs/wikidiff.php' ],
38 function_exists( 'tideways_enable' ) ? [] : [ 'tests/phan/stubs/tideways.php' ],
39 class_exists( PEAR::class ) ? [] : [ 'tests/phan/stubs/mail.php' ],
40 class_exists( Memcached::class ) ? [] : [ 'tests/phan/stubs/memcached.php' ],
41 // Per composer.json, PHPUnit 6 is used for PHP 7.0+, PHPUnit 4 otherwise.
42 // Load the interface for the version of PHPUnit that isn't installed.
43 // Phan only supports PHP 7.0+ (and not HHVM), so we only need to stub PHPUnit 4.
44 class_exists( PHPUnit_TextUI_Command::class ) ? [] : [ 'tests/phan/stubs/phpunit4.php' ],
45 [
46 'maintenance/7zip.inc',
47 'maintenance/backup.inc',
48 'maintenance/cleanupTable.inc',
49 'maintenance/CodeCleanerGlobalsPass.inc',
50 'maintenance/commandLine.inc',
51 'maintenance/importImages.inc',
52 'maintenance/sqlite.inc',
53 'maintenance/userDupes.inc',
54 'maintenance/userOptions.inc',
55 'maintenance/language/checkLanguage.inc',
56 'maintenance/language/languages.inc',
57 ]
58 ),
59
69 'directory_list' => [
70 'includes/',
71 'languages/',
72 'maintenance/',
73 'mw-config/',
74 'resources/',
75 'skins/',
76 'vendor/',
77 ],
78
86 'exclude_file_list' => [],
87
93 "exclude_analysis_directory_list" => [
94 'vendor/',
95 'tests/phan/stubs/',
96 // The referenced classes are not available in vendor, only when
97 // included from composer.
98 'includes/composer/',
99 // Directly references classes that only exist in Translate extension
100 'maintenance/language/',
101 // External class
102 'includes/libs/jsminplus.php',
103 // separate repositories
104 'skins/',
105 ],
106
114 'backward_compatibility_checks' => false,
115
120 'parent_constructor_required' => [
121 ],
122
154 'quick_mode' => false,
155
165 'should_visit_all_nodes' => true,
166
173 'analyze_signature_compatibility' => true,
174
175 // Emit all issues. They are then suppressed via
176 // suppress_issue_types, rather than a minimum
177 // severity.
178 "minimum_severity" => 0,
179
187 'allow_missing_properties' => false,
188
194 'null_casts_as_any_type' => true,
195
203 'scalar_implicit_cast' => true,
204
211 'ignore_undeclared_variables_in_global_scope' => true,
212
222 'dead_code_detection' => false,
223
233 'dead_code_detection_prefer_false_negative' => true,
234
241 'read_type_annotations' => true,
242
250 'stored_state_file_path' => null,
251
257 'disable_suppression' => false,
258
263 'dump_ast' => false,
264
269 'dump_signatures_file' => null,
270
276 'expand_file_list' => false,
277
278 // Include a progress bar in the output
279 'progress_bar' => false,
280
288 'progress_bar_sample_rate' => 0.005,
289
294 'processes' => 1,
295
300 'suppress_issue_types' => [
301 // approximate error count: 29
302 "PhanCommentParamOnEmptyParamList",
303 // approximate error count: 33
304 "PhanCommentParamWithoutRealParam",
305 // approximate error count: 8
306 "PhanDeprecatedClass",
307 // approximate error count: 415
308 "PhanDeprecatedFunction",
309 // approximate error count: 25
310 "PhanDeprecatedProperty",
311 // approximate error count: 17
312 "PhanNonClassMethodCall",
313 // approximate error count: 11
314 "PhanParamReqAfterOpt",
315 // approximate error count: 888
316 "PhanParamSignatureMismatch",
317 // approximate error count: 7
318 "PhanParamSignatureMismatchInternal",
319 // approximate error count: 1
320 "PhanParamSignatureRealMismatchTooFewParameters",
321 // approximate error count: 125
322 "PhanParamTooMany",
323 // approximate error count: 1
324 "PhanParamTooManyCallable",
325 // approximate error count: 3
326 "PhanParamTooManyInternal",
327 // approximate error count: 1
328 "PhanRedefineFunctionInternal",
329 // approximate error count: 2
330 "PhanTraitParentReference",
331 // approximate error count: 3
332 "PhanTypeComparisonFromArray",
333 // approximate error count: 2
334 "PhanTypeComparisonToArray",
335 // approximate error count: 3
336 "PhanTypeInvalidRightOperand",
337 // approximate error count: 1
338 "PhanTypeMagicVoidWithReturn",
339 // approximate error count: 218
340 "PhanTypeMismatchArgument",
341 // approximate error count: 13
342 "PhanTypeMismatchArgumentInternal",
343 // approximate error count: 6
344 "PhanTypeMismatchDeclaredParam",
345 // approximate error count: 111
346 "PhanTypeMismatchDeclaredParamNullable",
347 // approximate error count: 1
348 "PhanTypeMismatchDefault",
349 // approximate error count: 5
350 "PhanTypeMismatchDimAssignment",
351 // approximate error count: 2
352 "PhanTypeMismatchDimEmpty",
353 // approximate error count: 1
354 "PhanTypeMismatchDimFetch",
355 // approximate error count: 14
356 "PhanTypeMismatchForeach",
357 // approximate error count: 56
358 "PhanTypeMismatchProperty",
359 // approximate error count: 74
360 "PhanTypeMismatchReturn",
361 // approximate error count: 11
362 "PhanTypeMissingReturn",
363 // approximate error count: 5
364 "PhanTypeNonVarPassByRef",
365 // approximate error count: 1
366 "PhanUndeclaredClassInCallable",
367 // approximate error count: 32
368 "PhanUndeclaredConstant",
369 // approximate error count: 233
370 "PhanUndeclaredMethod",
371 // approximate error count: 1224
372 "PhanUndeclaredProperty",
373 // approximate error count: 3
374 "PhanUndeclaredStaticMethod",
375 // approximate error count: 11
376 "PhanUndeclaredTypeReturnType",
377 // approximate error count: 27
378 "PhanUndeclaredVariable",
379 // approximate error count: 58
380 "PhanUndeclaredVariableDim",
381 ],
382
388 'whitelist_issue_types' => [
389 // 'PhanAccessMethodPrivate',
390 // 'PhanAccessMethodProtected',
391 // 'PhanAccessNonStaticToStatic',
392 // 'PhanAccessPropertyPrivate',
393 // 'PhanAccessPropertyProtected',
394 // 'PhanAccessSignatureMismatch',
395 // 'PhanAccessSignatureMismatchInternal',
396 // 'PhanAccessStaticToNonStatic',
397 // 'PhanCompatibleExpressionPHP7',
398 // 'PhanCompatiblePHP7',
399 // 'PhanContextNotObject',
400 // 'PhanDeprecatedClass',
401 // 'PhanDeprecatedFunction',
402 // 'PhanDeprecatedProperty',
403 // 'PhanEmptyFile',
404 // 'PhanNonClassMethodCall',
405 // 'PhanNoopArray',
406 // 'PhanNoopClosure',
407 // 'PhanNoopConstant',
408 // 'PhanNoopProperty',
409 // 'PhanNoopVariable',
410 // 'PhanParamRedefined',
411 // 'PhanParamReqAfterOpt',
412 // 'PhanParamSignatureMismatch',
413 // 'PhanParamSignatureMismatchInternal',
414 // 'PhanParamSpecial1',
415 // 'PhanParamSpecial2',
416 // 'PhanParamSpecial3',
417 // 'PhanParamSpecial4',
418 // 'PhanParamTooFew',
419 // 'PhanParamTooFewInternal',
420 // 'PhanParamTooMany',
421 // 'PhanParamTooManyInternal',
422 // 'PhanParamTypeMismatch',
423 // 'PhanParentlessClass',
424 // 'PhanRedefineClass',
425 // 'PhanRedefineClassInternal',
426 // 'PhanRedefineFunction',
427 // 'PhanRedefineFunctionInternal',
428 // 'PhanStaticCallToNonStatic',
429 // 'PhanSyntaxError',
430 // 'PhanTraitParentReference',
431 // 'PhanTypeArrayOperator',
432 // 'PhanTypeArraySuspicious',
433 // 'PhanTypeComparisonFromArray',
434 // 'PhanTypeComparisonToArray',
435 // 'PhanTypeConversionFromArray',
436 // 'PhanTypeInstantiateAbstract',
437 // 'PhanTypeInstantiateInterface',
438 // 'PhanTypeInvalidLeftOperand',
439 // 'PhanTypeInvalidRightOperand',
440 // 'PhanTypeMismatchArgument',
441 // 'PhanTypeMismatchArgumentInternal',
442 // 'PhanTypeMismatchDefault',
443 // 'PhanTypeMismatchForeach',
444 // 'PhanTypeMismatchProperty',
445 // 'PhanTypeMismatchReturn',
446 // 'PhanTypeMissingReturn',
447 // 'PhanTypeNonVarPassByRef',
448 // 'PhanTypeParentConstructorCalled',
449 // 'PhanTypeVoidAssignment',
450 // 'PhanUnanalyzable',
451 // 'PhanUndeclaredClass',
452 // 'PhanUndeclaredClassCatch',
453 // 'PhanUndeclaredClassConstant',
454 // 'PhanUndeclaredClassInstanceof',
455 // 'PhanUndeclaredClassMethod',
456 // 'PhanUndeclaredClassReference',
457 // 'PhanUndeclaredConstant',
458 // 'PhanUndeclaredExtendedClass',
459 // 'PhanUndeclaredFunction',
460 // 'PhanUndeclaredInterface',
461 // 'PhanUndeclaredMethod',
462 // 'PhanUndeclaredProperty',
463 // 'PhanUndeclaredStaticMethod',
464 // 'PhanUndeclaredStaticProperty',
465 // 'PhanUndeclaredTrait',
466 // 'PhanUndeclaredTypeParameter',
467 // 'PhanUndeclaredTypeProperty',
468 // 'PhanUndeclaredVariable',
469 // 'PhanUnreferencedClass',
470 // 'PhanUnreferencedConstant',
471 // 'PhanUnreferencedMethod',
472 // 'PhanUnreferencedProperty',
473 // 'PhanVariableUseClause',
474 ],
475
481 'globals_type_map' => [
482 'IP' => 'string',
483 ],
484
485 // Emit issue messages with markdown formatting
486 'markdown_issue_messages' => false,
487
492 'generic_types_enabled' => true,
493
494 // A list of plugin files to execute
495 'plugins' => [
496 ],
497];
The phpstorm stubs package includes the Memcached class with two parameters and docs saying that they...
Definition memcached.php:11
Minimal set of classes necessary for UserMailer to be happy.
Definition mail.php:9
Some old classes from PHPUnit 4 that MediaWiki (conditionally) references.
Definition phpunit4.php:9
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
Definition hooks.txt:2006
processing should stop and the error should be shown to the user * false
Definition hooks.txt:187
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition injection.txt:37
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class