diff --git a/classes/restriction/info.php b/classes/restriction/info.php index 73ecc7f4..1028a00b 100644 --- a/classes/restriction/info.php +++ b/classes/restriction/info.php @@ -159,12 +159,12 @@ public function get_course_module() { * required for all course-modules, to make the front page and similar * pages work more quickly (works only for current user) * @param int $userid If set, specifies a different user ID to check availability for - * @param \course_modinfo $modinfo Usually leave as null for default. Specify when + * @param \course_modinfo|null $modinfo Usually leave as null for default. Specify when * calling recursively from inside get_fast_modinfo() * @return bool True if this item is available to the user, false otherwise */ public function is_available(&$information, $grabthelot = false, $userid = 0, - \course_modinfo $modinfo = null) { + \course_modinfo|null $modinfo = null) { global $USER, $OUTPUT, $DB; // Default to no information. diff --git a/lib.php b/lib.php index 6847092e..f495832d 100644 --- a/lib.php +++ b/lib.php @@ -402,7 +402,7 @@ public function can_add_instance($courseid) { * @param bool $charge Charge the user to enrol (only false in case of enrol coupons) * @return bool|array true if enrolled else error code and message */ - public function enrol_self(stdClass $instance, \stdClass $user = null, $charge = true) { + public function enrol_self(stdClass $instance, \stdClass|null $user = null, $charge = true) { global $CFG, $DB, $USER; require_once("$CFG->dirroot/enrol/wallet/locallib.php"); if (empty($user)) { @@ -1893,10 +1893,10 @@ public function get_possible_currencies($account = null) { /** * Add new instance of enrol plugin. * @param object $course - * @param array $fields instance fields + * @param array|null $fields instance fields * @return int id of new instance, null if can not be created */ - public function add_instance($course, array $fields = null) { + public function add_instance($course, array|null $fields = null) { offers::parse_data($fields);