Merge "PHAN: conditionally load stubs"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 23 Jan 2017 18:11:43 +0000 (18:11 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 23 Jan 2017 18:11:43 +0000 (18:11 +0000)
1  2 
tests/phan/config.php

diff --combined tests/phan/config.php
@@@ -34,19 -34,24 +34,24 @@@ 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' ],
+               class_exists( PEAR::class ) ? [] : [ 'tests/phan/stubs/mail.php' ],
+               [
+                       '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',
+               ]
+       ),
  
        /**
         * A list of directories that should be parsed for class and
@@@ -65,7 -70,6 +70,6 @@@
                'resources/',
                'skins/',
                'vendor/',
-               'tests/phan/stubs/',
        ],
  
        /**
                // External class
                'includes/libs/jsminplus.php',
                // separate repositories
-               'skins/'
+               'skins/',
        ],
  
        /**
         * ```php
         * <?php
         * function test($arg):int {
-        *      return $arg;
+        *    return $arg;
         * }
         * test("abc");
         * ```
         * 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
                "PhanUndeclaredProperty",
                // approximate error count: 3
                "PhanUndeclaredStaticMethod",
 -              // approximate error count: 79
 -              "PhanUndeclaredVariable",
        ],
  
        /**