Fix phan checks

Phan now can run and pass without BetaFeatures extension beeing installed.

Change-Id: I0bb8433fc9f882ff8e021785aba78f707cec00a1
This commit is contained in:
WMDE-Fisch 2017-04-06 09:24:36 +02:00
parent 218b85d0bb
commit a79fd1624a
2 changed files with 33 additions and 8 deletions

View file

@ -34,8 +34,8 @@ return [
* project. directory_list won't find .inc files so
* we augment it here.
*/
'file_list' => [
],
'file_list' => !is_dir( './../../extensions/BetaFeatures/includes' ) ?
[ 'tests/phan/stubs/betafeatures.php' ] : [],
/**
* A list of directories that should be parsed for class and
@ -46,15 +46,18 @@ return [
* Thus, both first-party and third-party code being used by
* your application should be included in this list.
*/
'directory_list' => [
'directory_list' => array_merge(
[
'src/',
'tests/phan/stubs/',
'./../../includes',
'./../../languages',
'./../../maintenance',
'./../../vendor',
'./../../extensions/BetaFeatures/includes',
],
],
is_dir( './../../extensions/BetaFeatures/includes' ) ?
[ './../../extensions/BetaFeatures/includes' ] : []
),
/**
* A file list that defines files that will be excluded
@ -71,14 +74,16 @@ return [
* to parse, but not analyze. Also works for individual
* files.
*/
"exclude_analysis_directory_list" => [
"exclude_analysis_directory_list" => array_merge(
[
'tests/phan/stubs/',
'./../../includes',
'./../../languages',
'./../../maintenance',
'./../../vendor',
'./../../extensions/BetaFeatures/includes',
],
],
is_dir( './../../extensions/BetaFeatures' ) ? [ './../../extensions/BetaFeatures' ] : []
),
/**
* Backwards Compatibility Checking. This is slow

View file

@ -0,0 +1,20 @@
<?php
/**
* Minimal set of classes necessary to fulfill needs of parts of the RevisionSlider relying on
* the BetaFeatures extension.
* @codingStandardsIgnoreFile
*/
class BetaFeatures {
/**
* Check if a user has a beta feature enabled.
*
* @param User $user The user to check
* @param string $feature The key passed back to BetaFeatures
* from the GetBetaFeaturePreferences hook
* @return bool
*/
public static function isFeatureEnabled( $user, $feature ) {
}
}