Ejegg has uploaded a new change for review.
https://gerrit.wikimedia.org/r/290830
Change subject: Comment and DRY for functions filter
......................................................................
Comment and DRY for functions filter
Change-Id: I3d91932b8032ee5dc8d5b1cfe60bbca737e9d666
---
M extras/custom_filters/filters/functions/functions.body.php
1 file changed, 7 insertions(+), 4 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface
refs/changes/30/290830/1
diff --git a/extras/custom_filters/filters/functions/functions.body.php
b/extras/custom_filters/filters/functions/functions.body.php
index 0711983..a25c9ca 100644
--- a/extras/custom_filters/filters/functions/functions.body.php
+++ b/extras/custom_filters/filters/functions/functions.body.php
@@ -24,17 +24,20 @@
}
/**
- * @param $filterListGlobal
+ * @param string $filterListGlobal Run filters listed in a
DonationInterface
+ * global variable with name
* @return bool
*/
public function filter( $filterListGlobal ) {
+ $functions = $this->gateway_adapter->getGlobal(
$filterListGlobal );
- if ( !$this->gateway_adapter->getGlobal(
'EnableFunctionsFilter' ) ||
- !count( $this->gateway_adapter->getGlobal(
$filterListGlobal ) ) ){
+ if (
+ !$this->gateway_adapter->getGlobal(
'EnableFunctionsFilter' ) ||
+ !count( $functions )
+ ) {
return true;
}
- $functions = $this->gateway_adapter->getGlobal(
$filterListGlobal );
foreach ( $functions as $function_name => $risk_score_modifier
) {
//run the function specified, if it exists.
if ( method_exists( $this->gateway_adapter,
$function_name ) ) {
--
To view, visit https://gerrit.wikimedia.org/r/290830
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d91932b8032ee5dc8d5b1cfe60bbca737e9d666
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits