Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-63422

Fix cases of continue within switch statements

    XMLWordPrintable

Details

    • MOODLE_36_STABLE
    • MOODLE_36_STABLE
    • Hide

      Verify that not breakage happens via automated tests.

      With PHP 7.3 it would be possible to verify that the "PHP Warning" is not shown, but that has been already verified in the Epic issue with this patch applied. So testing that everything continues working in automated tests should be enough.

      Show
      Verify that not breakage happens via automated tests. With PHP 7.3 it would be possible to verify that the "PHP Warning" is not shown, but that has been already verified in the Epic issue with this patch applied. So testing that everything continues working in automated tests should be enough.

    Description

      With PHP 7.3 a warning has been added (about an existing problem) when continue; commands are used within switch statements. Really they act as normal break; statements there and, if within a loop, we should be using continue 2; instead.

      PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"

      Link: https://github.com/php/php-src/blob/PHP-7.3/UPGRADING
      PHPUnit run: https://pastebin.com/pLcjfX3V

      This is about to find all those continue uses within switch statements and replace them with the correct statement when needed.

      Some links explaining continue within switch and loops:

      Attachments

        Issue Links

          Activity

            People

              stronk7 Eloy Lafuente (stronk7)
              stronk7 Eloy Lafuente (stronk7)
              Víctor Déniz Falcón Víctor Déniz Falcón
              Andrew Lyons Andrew Lyons
              CiBoT CiBoT
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Dan Marsden, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Jean-Philippe Gaudreau, Steve Massicotte, Serge Gauthier, Issam Taboubi, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo, Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                3/Dec/18