From d14fd7b901337c54c3a74f5bb571c86b5feb8c71 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 9 Sep 2024 18:41:48 +0200 Subject: [PATCH] code quality fixes --- classes/external/get_question_details.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/classes/external/get_question_details.php b/classes/external/get_question_details.php index cb2c2f1..3792593 100644 --- a/classes/external/get_question_details.php +++ b/classes/external/get_question_details.php @@ -8,12 +8,14 @@ use coding_exception; use context_module; use core_external\restricted_context_exception; +use dml_exception; use external_api; use external_function_parameters; use external_value; use external_single_structure; use invalid_parameter_exception; use mod_adleradaptivity\local\helpers; +use moodle_exception; class get_question_details extends external_api { public static function execute_parameters(): external_function_parameters { @@ -49,8 +51,11 @@ public static function execute_returns(): external_function_parameters { /** * @param array $module [int $module_id, string $instance_id] - * @throws invalid_parameter_exception If neither module_id nor instance_id are set + * @return array + * @throws dml_exception + * @throws moodle_exception * @throws coding_exception If the module could not be found + * @throws invalid_parameter_exception If neither module_id nor instance_id are set * @throws restricted_context_exception If the user does not have the required context to view the module */ public static function execute(array $module): array { @@ -60,7 +65,6 @@ public static function execute(array $module): array { $module = external_helpers::validate_module_params_and_get_module($module); $module_id = $module->id; - $instance_id = $module->instance; // default validation stuff with context $context = context_module::instance($module_id);