Merge "Fix phrase search"
[lhc/web/wiklou.git] / tests / phan / config.php
index 7d4cfb9..8a82d74 100644 (file)
@@ -34,19 +34,27 @@ return [
         * project. directory_list won't find .inc files so
         * we augment it here.
         */
-       'file_list' => [
-               'maintenance/7zip.inc',
-               'maintenance/backupPrefetch.inc',
-               'maintenance/commandLine.inc',
-               'maintenance/sqlite.inc',
-               'maintenance/userOptions.inc',
-               'maintenance/backup.inc',
-               'maintenance/cleanupTable.inc',
-               'maintenance/importImages.inc',
-               'maintenance/userDupes.inc',
-               'maintenance/language/checkLanguage.inc',
-               'maintenance/language/languages.inc',
-       ],
+       'file_list' => array_merge(
+               function_exists( 'register_postsend_function' ) ? [] : [ 'tests/phan/stubs/hhvm.php' ],
+               function_exists( 'wikidiff2_do_diff' ) ? [] : [ 'tests/phan/stubs/wikidiff.php' ],
+               function_exists( 'tideways_enable' ) ? [] : [ 'tests/phan/stubs/tideways.php' ],
+               class_exists( PEAR::class ) ? [] : [ 'tests/phan/stubs/mail.php' ],
+               class_exists( Memcached::class ) ? [] : [ 'tests/phan/stubs/memcached.php' ],
+               [
+                       'maintenance/7zip.inc',
+                       'maintenance/backup.inc',
+                       'maintenance/backupPrefetch.inc',
+                       'maintenance/cleanupTable.inc',
+                       'maintenance/CodeCleanerGlobalsPass.inc',
+                       'maintenance/commandLine.inc',
+                       'maintenance/importImages.inc',
+                       'maintenance/sqlite.inc',
+                       'maintenance/userDupes.inc',
+                       'maintenance/userOptions.inc',
+                       'maintenance/language/checkLanguage.inc',
+                       'maintenance/language/languages.inc',
+               ]
+       ),
 
        /**
         * A list of directories that should be parsed for class and
@@ -65,7 +73,6 @@ return [
                'resources/',
                'skins/',
                'vendor/',
-               'tests/phan/stubs/',
        ],
 
        /**
@@ -75,10 +82,7 @@ return [
         * This is useful for excluding hopelessly unanalyzable
         * files that can't be removed for whatever reason.
         */
-       'exclude_file_list' => function_exists( 'xcache_get' ) ? [] : [
-               // References xcache which probably isn't installed
-               'includes/libs/objectcache/XCacheBagOStuff.php'
-       ],
+       'exclude_file_list' => [],
 
        /**
         * A list of directories holding code that we want
@@ -95,6 +99,8 @@ return [
                'maintenance/language/',
                // External class
                'includes/libs/jsminplus.php',
+               // separate repositories
+               'skins/',
        ],
 
        /**
@@ -127,7 +133,7 @@ return [
         * ```php
         * <?php
         * function test($arg):int {
-        *      return $arg;
+        *    return $arg;
         * }
         * test("abc");
         * ```
@@ -165,8 +171,10 @@ return [
         */
        'analyze_signature_compatibility' => true,
 
-       // Only emit critical issues
-       "minimum_severity" => 10,
+       // Emit all issues. They are then suppressed via
+       // suppress_issue_types, rather than a minimum
+       // severity.
+       "minimum_severity" => 0,
 
        /**
         * If true, missing properties will be created when
@@ -199,7 +207,7 @@ return [
         * with complicated cross-file globals that you have no
         * hope of fixing.
         */
-       'ignore_undeclared_variables_in_global_scope' => false,
+       'ignore_undeclared_variables_in_global_scope' => true,
 
        /**
         * Set to true in order to attempt to detect dead
@@ -289,14 +297,52 @@ return [
         * to this black-list to inhibit them from being reported.
         */
        'suppress_issue_types' => [
-               // MediaWiki has so much deprecated class usage it's a bit hopeless to
-               // fix this immediately
-               'PhanDeprecatedClass',
-               'PhanDeprecatedFunction',
-               'PhanDeprecatedProperty',
-               // There are arround 1400 usages of undeclared properties.
-               // php is ok with that but it's a code smell.
-               'PhanUndeclaredProperty',
+               // approximate error count: 8
+               "PhanDeprecatedClass",
+               // approximate error count: 415
+               "PhanDeprecatedFunction",
+               // approximate error count: 25
+               "PhanDeprecatedProperty",
+               // approximate error count: 11
+               "PhanParamReqAfterOpt",
+               // approximate error count: 888
+               "PhanParamSignatureMismatch",
+               // approximate error count: 7
+               "PhanParamSignatureMismatchInternal",
+               // approximate error count: 125
+               "PhanParamTooMany",
+               // approximate error count: 3
+               "PhanParamTooManyInternal",
+               // approximate error count: 1
+               "PhanRedefineFunctionInternal",
+               // approximate error count: 2
+               "PhanTraitParentReference",
+               // approximate error count: 3
+               "PhanTypeComparisonFromArray",
+               // approximate error count: 3
+               "PhanTypeInvalidRightOperand",
+               // approximate error count: 218
+               "PhanTypeMismatchArgument",
+               // approximate error count: 13
+               "PhanTypeMismatchArgumentInternal",
+               // approximate error count: 14
+               "PhanTypeMismatchForeach",
+               // approximate error count: 56
+               "PhanTypeMismatchProperty",
+               // approximate error count: 74
+               "PhanTypeMismatchReturn",
+               // approximate error count: 11
+               "PhanTypeMissingReturn",
+               // approximate error count: 5
+               "PhanTypeNonVarPassByRef",
+               // approximate error count: 32
+               "PhanUndeclaredConstant",
+               // approximate error count: 233
+               "PhanUndeclaredMethod",
+               // approximate error count: 1224
+               "PhanUndeclaredProperty",
+               // approximate error count: 3
+               "PhanUndeclaredStaticMethod",
        ],
 
        /**