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

Overriding methods must declare compatible return type in PHP8.1

    XMLWordPrintable

Details

    • Bug
    • Status: Waiting for peer review
    • Minor
    • Resolution: Unresolved
    • 3.11.4
    • None
    • 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

        Activity

          People

            marina Marina Glancy
            marina Marina Glancy
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

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