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

PHP 8.0: Remove required parameters after optional parameters in Brickfield plugins

    XMLWordPrintable

Details

    Description

      In MDL-69863 Brickfield Education Labs accessibility toolkit landed. While testing MDL-71390, I've seen scenarios in lib/tests/behat/largeforms.feature are failing when they are run with PHP 8.0:

       

      PHP errors found:
      Unknown error type: Required parameter $resultstime follows optional parameter $html at moodle/admin/tool/brickfield/classes/accessibility.php: 223
       F---------....................................
      --- Failed steps:
      001 Scenario: Small form with checkboxes (not using workaround) # lib/tests/behat/largeforms.feature:21
       When I am on the "C1" "Course" page logged in as "admin" # lib/tests/behat/largeforms.feature:15
       PHP errors found:
       Unknown error type: Required parameter $resultstime follows optional parameter $html at admin/tool/brickfield/classes/accessibility.php: 223 (Exception)
      

       

       

      As it was done in MDL-70893, optional parameters being declared before required are forbidden.

      See https://php.watch/versions/8.0#deprecate-required-param-after-optional 

       

      Attachments

        Issue Links

          Activity

            People

              mchurch Mike Churchward
              sarjona Sara Arjona (@sarjona)
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                17/May/21

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 30 minutes
                  30m