MDL-82393 mod_assign: Remove the null default value from $course

Removes the default null value from the deprecated parameter $course,
which was introduced as part of its deprecation. Since PHP 8.0, it
is deprecated to declare functions where an optional parameter is
followed by a required parameter, as is the case here. Therefore,
the default value needs to be removed.
This commit is contained in:
Mihail Geshoski 2024-08-08 16:57:58 +08:00 committed by Jun Pataleta
parent 587f65f34f
commit 594750e157
No known key found for this signature in database
GPG Key ID: F83510526D99E2C7

View File

@ -39,7 +39,7 @@ class group_selector extends comboboxsearch {
* @param null|stdClass $course This parameter has been deprecated since Moodle 4.5 and should not be used anymore.
* @param stdClass $context The context object.
*/
public function __construct(null|stdClass $course = null, stdClass $context) {
public function __construct(?stdClass $course, stdClass $context) {
if ($course !== null) {
debugging(
'The course argument has been deprecated. Please remove it from your group_selector class instances.',