MediaWiki  1.29.2
config.php
Go to the documentation of this file.
1 <?php
2 
3 use \Phan\Config;
4 
5 // If xdebug is enabled, we need to increase the nesting level for phan
6 ini_set( 'xdebug.max_nesting_level', 1000 );
7 
30 return [
37  'file_list' => array_merge(
38  function_exists( 'register_postsend_function' ) ? [] : [ 'tests/phan/stubs/hhvm.php' ],
39  function_exists( 'wikidiff2_do_diff' ) ? [] : [ 'tests/phan/stubs/wikidiff.php' ],
40  function_exists( 'tideways_enable' ) ? [] : [ 'tests/phan/stubs/tideways.php' ],
41  class_exists( PEAR::class ) ? [] : [ 'tests/phan/stubs/mail.php' ],
42  class_exists( Memcached::class ) ? [] : [ 'tests/phan/stubs/memcached.php' ],
43  [
44  'maintenance/7zip.inc',
45  'maintenance/backup.inc',
46  'maintenance/backupPrefetch.inc',
47  'maintenance/cleanupTable.inc',
48  'maintenance/CodeCleanerGlobalsPass.inc',
49  'maintenance/commandLine.inc',
50  'maintenance/importImages.inc',
51  'maintenance/sqlite.inc',
52  'maintenance/userDupes.inc',
53  'maintenance/userOptions.inc',
54  'maintenance/language/checkLanguage.inc',
55  'maintenance/language/languages.inc',
56  ]
57  ),
58 
68  'directory_list' => [
69  'includes/',
70  'languages/',
71  'maintenance/',
72  'mw-config/',
73  'resources/',
74  'skins/',
75  'vendor/',
76  ],
77 
85  'exclude_file_list' => [],
86 
92  "exclude_analysis_directory_list" => [
93  'vendor/',
94  'tests/phan/stubs/',
95  // The referenced classes are not available in vendor, only when
96  // included from composer.
97  'includes/composer/',
98  // Directly references classes that only exist in Translate extension
99  'maintenance/language/',
100  // External class
101  'includes/libs/jsminplus.php',
102  // separate repositories
103  'skins/',
104  ],
105 
113  'backward_compatibility_checks' => false,
114 
119  'parent_constructor_required' => [
120  ],
121 
153  'quick_mode' => false,
154 
164  'should_visit_all_nodes' => true,
165 
172  'analyze_signature_compatibility' => true,
173 
174  // Emit all issues. They are then suppressed via
175  // suppress_issue_types, rather than a minimum
176  // severity.
177  "minimum_severity" => 0,
178 
186  'allow_missing_properties' => false,
187 
193  'null_casts_as_any_type' => true,
194 
202  'scalar_implicit_cast' => true,
203 
210  'ignore_undeclared_variables_in_global_scope' => true,
211 
221  'dead_code_detection' => false,
222 
232  'dead_code_detection_prefer_false_negative' => true,
233 
240  'read_type_annotations' => true,
241 
249  'stored_state_file_path' => null,
250 
256  'disable_suppression' => false,
257 
262  'dump_ast' => false,
263 
268  'dump_signatures_file' => null,
269 
275  'expand_file_list' => false,
276 
277  // Include a progress bar in the output
278  'progress_bar' => false,
279 
287  'progress_bar_sample_rate' => 0.005,
288 
293  'processes' => 1,
294 
299  'suppress_issue_types' => [
300  // approximate error count: 8
301  "PhanDeprecatedClass",
302  // approximate error count: 441
303  "PhanDeprecatedFunction",
304  // approximate error count: 24
305  "PhanDeprecatedProperty",
306  // approximate error count: 12
307  "PhanParamReqAfterOpt",
308  // approximate error count: 748
309  "PhanParamSignatureMismatch",
310  // approximate error count: 7
311  "PhanParamSignatureMismatchInternal",
312  // approximate error count: 308
313  "PhanParamTooMany",
314  // approximate error count: 3
315  "PhanParamTooManyInternal",
316  // approximate error count: 1
317  "PhanRedefineFunctionInternal",
318  // approximate error count: 2
319  "PhanTraitParentReference",
320  // approximate error count: 4
321  "PhanTypeComparisonFromArray",
322  // approximate error count: 3
323  "PhanTypeInvalidRightOperand",
324  // approximate error count: 563
325  "PhanTypeMismatchArgument",
326  // approximate error count: 39
327  "PhanTypeMismatchArgumentInternal",
328  // approximate error count: 16
329  "PhanTypeMismatchForeach",
330  // approximate error count: 63
331  "PhanTypeMismatchProperty",
332  // approximate error count: 95
333  "PhanTypeMismatchReturn",
334  // approximate error count: 11
335  "PhanTypeMissingReturn",
336  // approximate error count: 5
337  "PhanTypeNonVarPassByRef",
338  // approximate error count: 27
339  "PhanUndeclaredConstant",
340  // approximate error count: 185
341  "PhanUndeclaredMethod",
342  // approximate error count: 1342
343  "PhanUndeclaredProperty",
344  // approximate error count: 3
345  "PhanUndeclaredStaticMethod",
346  ],
347 
353  'whitelist_issue_types' => [
354  // 'PhanAccessMethodPrivate',
355  // 'PhanAccessMethodProtected',
356  // 'PhanAccessNonStaticToStatic',
357  // 'PhanAccessPropertyPrivate',
358  // 'PhanAccessPropertyProtected',
359  // 'PhanAccessSignatureMismatch',
360  // 'PhanAccessSignatureMismatchInternal',
361  // 'PhanAccessStaticToNonStatic',
362  // 'PhanCompatibleExpressionPHP7',
363  // 'PhanCompatiblePHP7',
364  // 'PhanContextNotObject',
365  // 'PhanDeprecatedClass',
366  // 'PhanDeprecatedFunction',
367  // 'PhanDeprecatedProperty',
368  // 'PhanEmptyFile',
369  // 'PhanNonClassMethodCall',
370  // 'PhanNoopArray',
371  // 'PhanNoopClosure',
372  // 'PhanNoopConstant',
373  // 'PhanNoopProperty',
374  // 'PhanNoopVariable',
375  // 'PhanParamRedefined',
376  // 'PhanParamReqAfterOpt',
377  // 'PhanParamSignatureMismatch',
378  // 'PhanParamSignatureMismatchInternal',
379  // 'PhanParamSpecial1',
380  // 'PhanParamSpecial2',
381  // 'PhanParamSpecial3',
382  // 'PhanParamSpecial4',
383  // 'PhanParamTooFew',
384  // 'PhanParamTooFewInternal',
385  // 'PhanParamTooMany',
386  // 'PhanParamTooManyInternal',
387  // 'PhanParamTypeMismatch',
388  // 'PhanParentlessClass',
389  // 'PhanRedefineClass',
390  // 'PhanRedefineClassInternal',
391  // 'PhanRedefineFunction',
392  // 'PhanRedefineFunctionInternal',
393  // 'PhanStaticCallToNonStatic',
394  // 'PhanSyntaxError',
395  // 'PhanTraitParentReference',
396  // 'PhanTypeArrayOperator',
397  // 'PhanTypeArraySuspicious',
398  // 'PhanTypeComparisonFromArray',
399  // 'PhanTypeComparisonToArray',
400  // 'PhanTypeConversionFromArray',
401  // 'PhanTypeInstantiateAbstract',
402  // 'PhanTypeInstantiateInterface',
403  // 'PhanTypeInvalidLeftOperand',
404  // 'PhanTypeInvalidRightOperand',
405  // 'PhanTypeMismatchArgument',
406  // 'PhanTypeMismatchArgumentInternal',
407  // 'PhanTypeMismatchDefault',
408  // 'PhanTypeMismatchForeach',
409  // 'PhanTypeMismatchProperty',
410  // 'PhanTypeMismatchReturn',
411  // 'PhanTypeMissingReturn',
412  // 'PhanTypeNonVarPassByRef',
413  // 'PhanTypeParentConstructorCalled',
414  // 'PhanTypeVoidAssignment',
415  // 'PhanUnanalyzable',
416  // 'PhanUndeclaredClass',
417  // 'PhanUndeclaredClassCatch',
418  // 'PhanUndeclaredClassConstant',
419  // 'PhanUndeclaredClassInstanceof',
420  // 'PhanUndeclaredClassMethod',
421  // 'PhanUndeclaredClassReference',
422  // 'PhanUndeclaredConstant',
423  // 'PhanUndeclaredExtendedClass',
424  // 'PhanUndeclaredFunction',
425  // 'PhanUndeclaredInterface',
426  // 'PhanUndeclaredMethod',
427  // 'PhanUndeclaredProperty',
428  // 'PhanUndeclaredStaticMethod',
429  // 'PhanUndeclaredStaticProperty',
430  // 'PhanUndeclaredTrait',
431  // 'PhanUndeclaredTypeParameter',
432  // 'PhanUndeclaredTypeProperty',
433  // 'PhanUndeclaredVariable',
434  // 'PhanUnreferencedClass',
435  // 'PhanUnreferencedConstant',
436  // 'PhanUnreferencedMethod',
437  // 'PhanUnreferencedProperty',
438  // 'PhanVariableUseClause',
439  ],
440 
446  'globals_type_map' => [
447  'IP' => 'string',
448  ],
449 
450  // Emit issue messages with markdown formatting
451  'markdown_issue_messages' => false,
452 
457  'generic_types_enabled' => true,
458 
459  // A list of plugin files to execute
460  'plugins' => [
461  ],
462 ];
php
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:35
class
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
Definition: maintenance.txt:52