From d9c717c0893b2b2cf52bddc14de1f08d0b0263f2 Mon Sep 17 00:00:00 2001 From: addshore Date: Fri, 20 Jan 2017 17:35:03 +0000 Subject: [PATCH] PHAN: conditionally load stubs Change-Id: I6f78c573468a393d82927d614df5bceda86a9e9c --- tests/phan/config.php | 36 ++++++++++++++++++++---------------- tests/phan/stubs/mail.php | 4 ++-- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/tests/phan/config.php b/tests/phan/config.php index cef03ee013..e8374eb63d 100644 --- a/tests/phan/config.php +++ b/tests/phan/config.php @@ -34,19 +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 @@ return [ 'resources/', 'skins/', 'vendor/', - 'tests/phan/stubs/', ], /** @@ -96,7 +100,7 @@ return [ // External class 'includes/libs/jsminplus.php', // separate repositories - 'skins/' + 'skins/', ], /** @@ -129,7 +133,7 @@ return [ * ```php *