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

Overriding methods must declare compatible return type in PHP8.1

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.11.4
    • 4.1
    • Other

    Description

          Most non-final internal methods now require overriding methods to declare a
          compatible return type, otherwise a deprecated notice is emitted during
          inheritance validation.
          In case the return type cannot be declared for an overriding method due to
          PHP cross-version compatibility concerns, a `#[ReturnTypeWillChange]`
          attribute can be added to silence the deprecation notice.
      

      RFC: https://wiki.php.net/rfc/internal_method_return_types

      Violations in Moodle - all classes implementing ArrayIterator, Countable, etc

      Attachments

        Issue Links

          Activity

            People

              marina Marina Glancy
              marina Marina Glancy
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Jake Dallimore Jake Dallimore
              CiBoT CiBoT
              Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                28/Nov/22

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 55 minutes
                  4h 55m