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

Abstract static methods used in core_privacy\local\sitepolicy\handler

    XMLWordPrintable

    Details

      Description

      As reported by Tobias Reischmann at https://moodle.org/local/chatlogs/index.php?conversationid=21752#c638360

      It seems that the new privacy changes in core created some "regressions" for moodle3.3 in combination with php5.6 and behat. privacy/classes/local/sitepolicy/handler.php uses abstract static functions, which are not allowed in php5.6 and cause a warning. This warning is handled within behat tests as exception. Thus the very common behat step 'And I log in as "teacher"' is no longer working. Do we bother about something like that?

      Moodle core has zero notice tolerance policy so as per suggestion by Andrew Nicols this is a blocker.

      Making these methods abstract was based on the following suggestion raised during the integration review:

      In the abstract class 'handler', where you have a couple of methods defined and returning null, I can't see any case where we're relying on that base implementation. It seems to me we always want the extending class to implement these methods. Therefore, I think these should just be proper abstract methods. This way, we force the extending classes to provide implementations, rather than suggest.

      To fulfill that suggestion while keeping this compatible with PHP 5.6, I propose to remove the abstract keyword from methods and making them throw coding exceptions, so that implementations are forced to provide them.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                5 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  19/Mar/18