From 9252dff64bf5186267b30ce475a0978405296d46 Mon Sep 17 00:00:00 2001 From: addshore Date: Thu, 26 Jan 2017 16:49:04 +0100 Subject: [PATCH] PHAN: load stubs from phpstorm-stubs library Also add a single small stub for the Memcached class constructor that is slightly wrong in the phpstorm stubs library. jetbrains/phpstorm-stubs has been added to packagist via: https://github.com/JetBrains/phpstorm-stubs/pull/149 Change-Id: I1bca7390d1dc24c38d65c1c8968f356326ff4636 --- composer.json | 1 + tests/phan/config.php | 6 ++---- tests/phan/stubs/memcached.php | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 tests/phan/stubs/memcached.php diff --git a/composer.json b/composer.json index e8251528a1..d762bae9fc 100644 --- a/composer.json +++ b/composer.json @@ -50,6 +50,7 @@ "jakub-onderka/php-parallel-lint": "0.9.2", "justinrainbow/json-schema": "~3.0", "mediawiki/mediawiki-codesniffer": "0.7.2", + "jetbrains/phpstorm-stubs": "dev-master", "monolog/monolog": "~1.18.2", "nikic/php-parser": "2.1.0", "nmred/kafka-php": "0.1.5", diff --git a/tests/phan/config.php b/tests/phan/config.php index 19469d93e1..39b2fa1199 100644 --- a/tests/phan/config.php +++ b/tests/phan/config.php @@ -38,6 +38,7 @@ return [ 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' ], + class_exists( Memcached::class ) ? [] : [ 'tests/phan/stubs/memcached.php' ], [ 'maintenance/7zip.inc', 'maintenance/backupPrefetch.inc', @@ -79,10 +80,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 diff --git a/tests/phan/stubs/memcached.php b/tests/phan/stubs/memcached.php new file mode 100644 index 0000000000..ee47937a76 --- /dev/null +++ b/tests/phan/stubs/memcached.php @@ -0,0 +1,16 @@ +