Use "break" instead of "continue"
authorRazeSoldier <razesoldier@outlook.com>
Thu, 23 Aug 2018 16:18:07 +0000 (00:18 +0800)
committerKunal Mehta <legoktm@member.fsf.org>
Mon, 15 Oct 2018 02:25:15 +0000 (19:25 -0700)
"continue" statements are equivalent to "break". In PHP 7.3, will generate a
warning.

Bug: T200595
Change-Id: I244ecb2e1ce5a76295f014fb1becd8d263196846
(cherry picked from commit 24ffbd9bd182944daa8b12244b729562cd5f50db)

RELEASE-NOTES-1.31
includes/json/FormatJson.php
languages/LanguageConverter.php

index cf8e6e9..b4f95ca 100644 (file)
@@ -9,6 +9,8 @@ THIS IS NOT A RELEASE YET
 * (T200254) Add pear/Net_SMTP 1.7.3 to composer dependencies.
 * (T206765) Load installer i18n when running update.php.
 * (T109121) Remove deprecated pear/mail_mime-decode from composer suggested libraries.
+* (T200595) Fix PHP 7.3 warnings of using "continue" in some scenarios instead
+  of "break".
 
 == MediaWiki 1.31.1 ==
 
index 0c77a7b..bd6a365 100644 (file)
@@ -294,7 +294,7 @@ class FormatJson {
                                        $lookAhead = ( $idx + 1 < $maxLen ) ? $str[$idx + 1] : '';
                                        $lookBehind = ( $idx - 1 >= 0 ) ? $str[$idx - 1] : '';
                                        if ( $inString ) {
-                                               continue;
+                                               break;
 
                                        } elseif ( !$inComment &&
                                                ( $lookAhead === '/' || $lookAhead === '*' )
index f611358..24b1d0c 100644 (file)
@@ -770,7 +770,7 @@ class LanguageConverter {
                                                        $warningDone = true;
                                                }
                                                $startPos += 2;
-                                               continue;
+                                               break;
                                        }
                                        // Recursively parse another rule
                                        $inner .= $this->recursiveConvertRule( $text, $variant, $startPos, $depth + 1 );