From 4d90aa803ae98ee39745dd7c7328726ad8eb1cd2 Mon Sep 17 00:00:00 2001 From: Irina Hoppe Date: Tue, 30 Jul 2024 11:25:43 +0200 Subject: [PATCH] codestyle fixes --- classes/completion/custom_completion.php | 6 +++--- lib.php | 2 +- locallib.php | 2 +- mod_form.php | 6 ++++++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/classes/completion/custom_completion.php b/classes/completion/custom_completion.php index 9e2a35d2..25a129a4 100644 --- a/classes/completion/custom_completion.php +++ b/classes/completion/custom_completion.php @@ -73,7 +73,7 @@ public function get_state(string $rule): int { public static function get_defined_custom_rules(): array { return [ 'completionvote', - 'completionallocation' + 'completionallocation', ]; } @@ -85,7 +85,7 @@ public static function get_defined_custom_rules(): array { public function get_custom_rule_descriptions(): array { return [ 'completionvote' => get_string('completionvote_desc', RATINGALLOCATE_MOD_NAME), - 'completionallocation' => get_string('completionallocation_desc', RATINGALLOCATE_MOD_NAME) + 'completionallocation' => get_string('completionallocation_desc', RATINGALLOCATE_MOD_NAME), ]; } @@ -98,7 +98,7 @@ public function get_sort_order(): array { return [ 'completionview', 'completionvote', - 'completionallocation' + 'completionallocation', ]; } } diff --git a/lib.php b/lib.php index 21c0f1b9..8842ff44 100644 --- a/lib.php +++ b/lib.php @@ -765,8 +765,8 @@ function ratingallocate_reset_course_form_defaults($course) { * @param stdClass $coursemodule The coursemodule object (record). * @return cached_cm_info An object on information that the courses * will know about (most noticeably, an icon). + * @throws dml_exception */ - function ratingallocate_get_coursemodule_info($coursemodule) { global $DB; diff --git a/locallib.php b/locallib.php index a99fae92..e91c19ee 100644 --- a/locallib.php +++ b/locallib.php @@ -187,7 +187,7 @@ class ratingallocate { /** * Returns all users enrolled in the course the ratingallocate is in, who were able to access the activity - * @returns Array of user records + * @return Array of user records * @throws moodle_exception */ public function get_raters_in_course(): array { diff --git a/mod_form.php b/mod_form.php index df4e716c..07943e79 100644 --- a/mod_form.php +++ b/mod_form.php @@ -344,6 +344,12 @@ public function add_completion_rules() { return [$this->get_suffixed_name('vote'), $this->get_suffixed_name('allocation')]; } + /** + * Returns the suffixed name for custom completion elements. + * + * @param string $fieldname + * @return string + */ protected function get_suffixed_name(string $fieldname): string { // Replace _ratingallocate with $this->get_suffix() for Moodle 4.3 or later. return 'completion' . $fieldname . '_ratingallocate';