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

Review some break statements that maybe should be continue 2


    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 3.6
    • Gradebook
    • None

      This is a followup of MDL-63422 where, aiming to get PHP 7.3 working, all the switch / case / continue occurrences in core was reviewed.

      The policy followed was:

      • if possible, take rid of the continue (all activity modules), keeping original behavior.
      • when the intention clearly was to jump to next element in loop, change to continue 2.
      • when it was not clear, no matter the exiting continue there is (was) non-sense... change it to break that behaves exactly the same.

      And, as result of it some changes were applied to both grade/querylib.php and lib/gradelib.php, following the 3rd point in the policy above.

      Commit: https://github.com/stronk7/moodle/commit/2b655b85834abd757027a2e61eab3cb7a292a2d3#diff-53295022f0e8fb89ab3469d96f3eb508

      This is about to review if those new break; statements are really what we want there or it would be better to change to a continue 2 that would lead to the next iteration, not executing all the remaining code in the loop after the switch.

      To be analyzed. As said, the change performed was to keep original behavior (just end the switch). This is about to verify if we can go a step further and end the iteration (the original continue; used there, maybe was meant to do so.


            Unassigned Unassigned
            stronk7 Eloy Lafuente (stronk7)
            0 Vote for this issue
            1 Start watching this issue


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