Use "break" instead of "continue" inside a switch
authorRazeSoldier <razesoldier@outlook.com>
Mon, 15 Oct 2018 15:58:26 +0000 (23:58 +0800)
committerLegoktm <legoktm@member.fsf.org>
Mon, 15 Oct 2018 17:51:05 +0000 (17:51 +0000)
"continue" statements in a switch are equivalent to "break". In PHP 7.3, will generate a warning.

Bug: T206974
Change-Id: I54bcec013ff52ab81bff09f8f7ef02f3944a5b7d
(cherry picked from commit f3b012b51f492155cd7acf4d7f641cd43147bfc0)

maintenance/storage/checkStorage.php

index bd0556a..f05be36 100644 (file)
@@ -266,12 +266,12 @@ class CheckStorage {
                                                case 'historyblobcurstub':
                                                        if ( strlen( $row->header ) == $headerLength ) {
                                                                $this->addError( 'unfixable', "Error: overlong stub header", $oldId );
-                                                               continue;
+                                                               break;
                                                        }
                                                        $stubObj = unserialize( $row->header );
                                                        if ( !is_object( $stubObj ) ) {
                                                                $this->addError( 'restore text', "Error: unable to unserialize stub object", $oldId );
-                                                               continue;
+                                                               break;
                                                        }
                                                        if ( $className == 'historyblobstub' ) {
                                                                $concatBlobs[$stubObj->mOldId][] = $oldId;