From e2dba602ce47343202e1a2382a0ede76878c1003 Mon Sep 17 00:00:00 2001 From: Stephan Robotta Date: Mon, 9 Feb 2026 09:02:55 +0100 Subject: [PATCH] Adapt signature of frontend methods. --- classes/frontend.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/frontend.php b/classes/frontend.php index 2791a1d..f9c18eb 100644 --- a/classes/frontend.php +++ b/classes/frontend.php @@ -34,8 +34,8 @@ protected function get_javascript_strings(): array { return ['label_state', 'label_question', 'ajaxerror']; } - protected function get_javascript_init_params($course, \cm_info $cm = null, - \section_info $section = null): array { + protected function get_javascript_init_params($course, ?\cm_info $cm = null, + ?\section_info $section = null): array { // Get all quizzes for course. $quizzes = $this->get_all_quizzes($course->id); @@ -74,8 +74,8 @@ protected function get_all_quizzes(int $courseid): array { return $this->allquizzes; } - protected function allow_add($course, \cm_info $cm = null, - \section_info $section = null): bool { + protected function allow_add($course, ?\cm_info $cm = null, + ?\section_info $section = null): bool { // Only show this option if there are some quizzes in the course. return !empty($this->get_all_quizzes($course->id));