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
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.