From 355e58da2f6c4dc94fbbcd47e96943dbae08257a Mon Sep 17 00:00:00 2001 From: Reedy Date: Sat, 26 Sep 2015 17:45:29 +0100 Subject: [PATCH] Re-enable Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed Change-Id: I07b4043163e5d00709f72dbbb3e2a46b17414d1c --- includes/api/ApiBase.php | 3 ++- phpcs.xml | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index d53797bc51..7743384dd0 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -206,7 +206,8 @@ abstract class ApiBase extends ContextSource { // Fix up the ugly "even numbered elements are description, odd // numbered elemts are the link" format (see doc for self::getExamples) $tmp = array(); - for ( $i = 0; $i < count( $examples ); $i += 2 ) { + $examplesCount = count( $examples ); + for ( $i = 0; $i < $examplesCount; $i += 2 ) { $tmp[$examples[$i + 1]] = $examples[$i]; } $examples = $tmp; diff --git a/phpcs.xml b/phpcs.xml index d1453e3f9e..df0f1fb3bf 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -7,7 +7,6 @@ - -- 2.20.1