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)
              Victor Déniz Falcón Victor Déniz Falcón
              Andrew Lyons Andrew Lyons
              CiBoT CiBoT
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie, Amaia Anabitarte, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona), Dan Marsden, Amaia Anabitarte, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona), Jean-Philippe Gaudreau, Steve Massicotte, Serge Gauthier, Issam Taboubi, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie, Amaia Anabitarte, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona), Amaia Anabitarte, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona), Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie, Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie, Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, Tim Hunt, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie, Dan Marsden, Matteo Scaramuccia, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie, Amaia Anabitarte, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                3/Dec/18