WMDE-Fisch has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/346698 )
Change subject: Fix phan checks
......................................................................
Fix phan checks
Phan now can run and pass without BetaFeatures extension beeing installed.
Change-Id: I0bb8433fc9f882ff8e021785aba78f707cec00a1
---
M tests/phan/config.php
A tests/phan/stubs/betafeatures.php
2 files changed, 33 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RevisionSlider
refs/changes/98/346698/1
diff --git a/tests/phan/config.php b/tests/phan/config.php
index 97d05ac..dd2681c 100644
--- a/tests/phan/config.php
+++ b/tests/phan/config.php
@@ -34,8 +34,8 @@
* 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 @@
* 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 @@
* 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
diff --git a/tests/phan/stubs/betafeatures.php
b/tests/phan/stubs/betafeatures.php
new file mode 100644
index 0000000..ece9954
--- /dev/null
+++ b/tests/phan/stubs/betafeatures.php
@@ -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 ) {
+ }
+}
\ No newline at end of file
--
To view, visit https://gerrit.wikimedia.org/r/346698
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bb8433fc9f882ff8e021785aba78f707cec00a1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RevisionSlider
Gerrit-Branch: master
Gerrit-Owner: WMDE-Fisch <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits