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

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




      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 dobedobedoh 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.


        Issue Links



              mudrd8mz David Mudrák (@mudrd8mz)
              mudrd8mz David Mudrák (@mudrd8mz)
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Andrew Lyons, Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              5 Vote for this issue
              8 Start watching this issue