jenkins-bot has submitted this change and it was merged.

Change subject: Comment and DRY for functions filter
......................................................................


Comment and DRY for functions filter

Bug: T136381
Change-Id: I3d91932b8032ee5dc8d5b1cfe60bbca737e9d666
---
M extras/custom_filters/filters/functions/functions.body.php
1 file changed, 7 insertions(+), 4 deletions(-)

Approvals:
  Ejegg: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I3d91932b8032ee5dc8d5b1cfe60bbca737e9d666
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: AndyRussG <[email protected]>
Gerrit-Reviewer: Cdentinger <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: Ssmith <[email protected]>
Gerrit-Reviewer: XenoRyet <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to