Merge branch 'MDL-81634-main' of https://github.com/andrewnicols/moodle
This commit is contained in:
@@ -93,7 +93,7 @@ trait form_trait {
|
||||
* @throws \coding_exception If the form is not moodleform_mod and $modname is null.
|
||||
*/
|
||||
protected function add_completion_elements(
|
||||
string $modname = null,
|
||||
?string $modname = null,
|
||||
bool $supportviews = false,
|
||||
bool $supportgrades = false,
|
||||
bool $rating = false,
|
||||
|
||||
@@ -232,7 +232,7 @@ class provider implements
|
||||
* @param int $courseid The course id. Provide this if you want course completion and activity completion deleted.
|
||||
* @param int $cmid The course module id. Provide this if you only want activity completion deleted.
|
||||
*/
|
||||
public static function delete_completion(\stdClass $user = null, int $courseid = null, int $cmid = null) {
|
||||
public static function delete_completion(?\stdClass $user = null, ?int $courseid = null, ?int $cmid = null) {
|
||||
global $DB;
|
||||
|
||||
if (isset($cmid)) {
|
||||
@@ -285,7 +285,7 @@ class provider implements
|
||||
* @param int $courseid The course id. Provide this if you want course completion and activity completion deleted.
|
||||
* @param int $cmid The course module id. Provide this if you only want activity completion deleted.
|
||||
*/
|
||||
public static function delete_completion_by_approved_userlist(approved_userlist $userlist, int $courseid = null, int $cmid = null) {
|
||||
public static function delete_completion_by_approved_userlist(approved_userlist $userlist, ?int $courseid = null, ?int $cmid = null) {
|
||||
global $DB;
|
||||
$userids = $userlist->get_userids();
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ abstract class completion_criteria extends data_object {
|
||||
* @param array $attributes html attributes
|
||||
* @return pix_icon
|
||||
*/
|
||||
public function get_icon($alt, array $attributes = null) {
|
||||
public function get_icon($alt, ?array $attributes = null) {
|
||||
global $COMPLETION_CRITERIA_TYPES;
|
||||
|
||||
$criteriatype = $COMPLETION_CRITERIA_TYPES[$this->criteriatype];
|
||||
|
||||
@@ -260,7 +260,7 @@ class completion_criteria_activity extends completion_criteria {
|
||||
* @param array $attributes html attributes
|
||||
* @return pix_icon
|
||||
*/
|
||||
public function get_icon($alt, array $attributes = null) {
|
||||
public function get_icon($alt, ?array $attributes = null) {
|
||||
return new pix_icon('monologo', $alt, "mod_{$this->module}", $attributes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ class completion_criteria_date extends completion_criteria {
|
||||
* @param array $attributes html attributes
|
||||
* @return pix_icon
|
||||
*/
|
||||
public function get_icon($alt, array $attributes = null) {
|
||||
public function get_icon($alt, ?array $attributes = null) {
|
||||
return new pix_icon('i/calendar', $alt, 'moodle', $attributes);
|
||||
}
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ class completion_criteria_grade extends completion_criteria {
|
||||
* @param array $attributes html attributes
|
||||
* @return pix_icon
|
||||
*/
|
||||
public function get_icon($alt, array $attributes = null) {
|
||||
public function get_icon($alt, ?array $attributes = null) {
|
||||
return new pix_icon('i/grades', $alt, 'moodle', $attributes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ class completion_criteria_self extends completion_criteria {
|
||||
* @param array $attributes html attributes
|
||||
* @return pix_icon
|
||||
*/
|
||||
public function get_icon($alt, array $attributes = null) {
|
||||
public function get_icon($alt, ?array $attributes = null) {
|
||||
return new pix_icon('i/completion_self', $alt, 'moodle', $attributes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ class completion_criteria_unenrol extends completion_criteria {
|
||||
* @param array $attributes html attributes
|
||||
* @return pix_icon
|
||||
*/
|
||||
public function get_icon($alt, array $attributes = null) {
|
||||
public function get_icon($alt, ?array $attributes = null) {
|
||||
return new pix_icon('i/user', $alt, 'moodle', $attributes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ class cm_completion_details_test extends advanced_testcase {
|
||||
* @return cm_completion_details
|
||||
*/
|
||||
protected function setup_data(?int $completion, array $completionoptions = [],
|
||||
object $mockcompletiondata = null, $modname = 'somenonexistentmod'): cm_completion_details {
|
||||
?object $mockcompletiondata = null, $modname = 'somenonexistentmod'): cm_completion_details {
|
||||
if (is_null($completion)) {
|
||||
$completion = COMPLETION_TRACKING_AUTOMATIC;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user