From: Erik Bernhardson Date: Thu, 30 Jun 2016 22:11:41 +0000 (-0700) Subject: Don't reuse variable names X-Git-Tag: 1.31.0-rc.0~6473 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=af6e349f6740598f02836d3bdd729301495f90bc;p=lhc%2Fweb%2Fwiklou.git Don't reuse variable names This code was rather hard to follow due to reusing the same variable multiple times. Lets give them unique names. Change-Id: I8f134b6314d593a3e40b19765c7b71496b8e524d --- diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index 80798a10cd..f84f806b1f 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -231,16 +231,16 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { $hasInterwikiResults = false; $totalhits = null; if ( $interwiki && $resultPageSet === null && $matches->hasInterwikiResults() ) { - foreach ( $matches->getInterwikiResults() as $matches ) { - $matches = $matches->getInterwikiResults(); + foreach ( $matches->getInterwikiResults() as $interwikiMatches ) { + $currentMatches = $interwikiMatches->getInterwikiResults(); $hasInterwikiResults = true; // Include number of results if requested if ( $resultPageSet === null && isset( $searchInfo['totalhits'] ) ) { - $totalhits += $matches->getTotalHits(); + $totalhits += $currentMatches->getTotalHits(); } - $result = $matches->next(); + $result = $currentMatches->next(); while ( $result ) { $title = $result->getTitle(); @@ -267,7 +267,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { $titles[] = $title; } - $result = $matches->next(); + $result = $currentMatches->next(); } } if ( $totalhits !== null ) {