From 45761788de7ffa2cc18c8f0a6f5f027efd8becc8 Mon Sep 17 00:00:00 2001 From: James C <5689414+james-cnz@users.noreply.github.com> Date: Tue, 30 Dec 2025 17:38:46 +1300 Subject: [PATCH] MDL-85530 course: Improve PHPDoc types for course format code --- .../course/format/classes/activityoverviewbase.php | 4 ++-- public/course/format/classes/base.php | 14 +++++++------- public/course/format/classes/formatactions.php | 2 +- .../output/local/content/basecontrolmenu.php | 6 +++--- .../output/local/content/bulkedittoggler.php | 2 +- .../classes/output/local/content/bulkedittools.php | 2 +- .../classes/output/local/content/cm/cmicon.php | 2 +- .../classes/output/local/content/cm/cmname.php | 2 +- .../output/local/content/cm/controlmenu.php | 2 +- .../classes/output/local/content/cm/title.php | 2 +- .../output/local/content/frontpagesection.php | 2 +- .../output/local/content/section/availability.php | 2 +- .../output/local/content/section/cmlist.php | 4 ++-- .../output/local/content/section/cmsummary.php | 4 ++-- .../output/local/content/section/header.php | 4 ++-- .../output/local/content/section/summary.php | 4 ++-- .../output/local/content/sectionnavigation.php | 2 +- .../format/classes/output/local/state/cm.php | 2 +- .../format/classes/output/local/state/course.php | 2 +- .../format/classes/output/local/state/section.php | 2 +- .../format/classes/output/section_renderer.php | 4 ++-- public/course/format/classes/privacy/provider.php | 2 +- public/course/format/classes/sectiondelegate.php | 2 +- public/course/format/classes/stateupdates.php | 2 +- .../singleactivity/classes/output/renderer.php | 1 + public/course/format/tests/base_test.php | 2 +- .../format/tests/fixtures/format_theunittest.php | 2 ++ ...unittest_output_course_format_invalidoutput.php | 2 +- ...rmat_theunittest_output_course_format_state.php | 4 ++-- .../tests/local/overview/overviewfactory_test.php | 1 + public/course/format/tests/stateactions_test.php | 4 ++-- .../courseformat/content/section/controlmenu.php | 2 +- 32 files changed, 49 insertions(+), 45 deletions(-) diff --git a/public/course/format/classes/activityoverviewbase.php b/public/course/format/classes/activityoverviewbase.php index 69ef2ca4634..ca9231e8b42 100644 --- a/public/course/format/classes/activityoverviewbase.php +++ b/public/course/format/classes/activityoverviewbase.php @@ -38,7 +38,7 @@ use grade_grade; * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ abstract class activityoverviewbase { - /** @var cm_info The course module. */ + /** @var module_context The course module's context */ protected module_context $context; /** @var \stdClass $course */ @@ -297,7 +297,7 @@ abstract class activityoverviewbase { * and provide names for each grade item that want to be displayed. * * @param grade_item[] $items - * @return array the grade item names indexed by item id. + * @return array the grade item names indexed by item id. */ protected function get_grade_item_names(array $items): array { if (count($items) == 1) { diff --git a/public/course/format/classes/base.php b/public/course/format/classes/base.php index 093bea55ca1..ee97f071b09 100644 --- a/public/course/format/classes/base.php +++ b/public/course/format/classes/base.php @@ -213,7 +213,7 @@ abstract class base { * * @param int $courseid */ - final public static function reset_course_cache($courseid = 0) { + final public static function reset_course_cache($courseid = 0): void { if ($courseid) { if (isset(self::$instances[$courseid])) { foreach (self::$instances[$courseid] as $format => $object) { @@ -328,7 +328,7 @@ abstract class base { * Returns a record from course database table plus additional fields * that course format defines * - * @return ?stdClass + * @return stdClass|null */ public function get_course() { global $DB; @@ -479,7 +479,7 @@ abstract class base { * Initially this was created to know if forms should add a button to return to the course page. * So if 'Return to course' does not make sense in your format your should probably return false. * - * @return boolean + * @return bool * @since Moodle 2.6 */ public function has_view_page() { @@ -557,7 +557,7 @@ abstract class base { * * @param int|stdClass $section either section number (field course_section.section) or row from course_section table * @param int $strictness - * @return ?section_info + * @return section_info|null */ final public function get_section($section, $strictness = IGNORE_MISSING) { if (is_object($section)) { @@ -906,7 +906,7 @@ abstract class base { * * Used in course/rest.php * - * @return ?array This will be passed in ajax respose + * @return array|null This will be passed in ajax respose */ public function ajax_section_move() { return null; @@ -1884,7 +1884,7 @@ abstract class base { * * @param section_info $section the section to move * @param section_info $destination the section that should be below the moved section - * @return boolean if the section can be moved or not + * @return bool if the section can be moved or not */ public function move_section_after(section_info $section, section_info $destination): bool { if ($section->section == $destination->section || $section->section == $destination->section + 1) { @@ -1958,7 +1958,7 @@ abstract class base { * @param stdClass $section * @param string $itemtype * @param mixed $newvalue - * @return ?\core\output\inplace_editable + * @return \core\output\inplace_editable|null */ public function inplace_editable_update_section_name($section, $itemtype, $newvalue) { if ($itemtype === 'sectionname' || $itemtype === 'sectionnamenl') { diff --git a/public/course/format/classes/formatactions.php b/public/course/format/classes/formatactions.php index a841a708e8b..ddf6b47c6ac 100644 --- a/public/course/format/classes/formatactions.php +++ b/public/course/format/classes/formatactions.php @@ -64,7 +64,7 @@ use stdClass; */ final class formatactions { /** - * @var courseactions|null courseactions instance. + * @var courseactions courseactions instance. */ public courseactions $course; diff --git a/public/course/format/classes/output/local/content/basecontrolmenu.php b/public/course/format/classes/output/local/content/basecontrolmenu.php index b045852d2b6..f185dde8eb3 100644 --- a/public/course/format/classes/output/local/content/basecontrolmenu.php +++ b/public/course/format/classes/output/local/content/basecontrolmenu.php @@ -96,7 +96,7 @@ abstract class basecontrolmenu implements named_templatable, renderable { * Export this data so it can be used as the context for a mustache template. * * @param renderer_base $output typically, the renderer that's calling this function - * @return null|array data context for a mustache template + * @return stdClass|null data context for a mustache template */ public function export_for_template(renderer_base $output): ?stdClass { $menu = $this->get_action_menu($output); @@ -144,7 +144,7 @@ abstract class basecontrolmenu implements named_templatable, renderable { /** * Format control array into an action_menu. * - * @param \renderer_base $output typically, the renderer that's calling this function + * @param array $controls array of edit control items * @return action_menu|null the action menu */ protected function format_controls(array $controls): ?action_menu { @@ -182,7 +182,7 @@ abstract class basecontrolmenu implements named_templatable, renderable { * * @todo Remove this method in Moodle 6.0 (MDL-83530). * @param array|null $itemdata the item data - * @return void + * @return link_secondary|null */ private function normalize_action_menu_link( array|null $itemdata diff --git a/public/course/format/classes/output/local/content/bulkedittoggler.php b/public/course/format/classes/output/local/content/bulkedittoggler.php index 59450f5ac2b..a679c03a3a1 100644 --- a/public/course/format/classes/output/local/content/bulkedittoggler.php +++ b/public/course/format/classes/output/local/content/bulkedittoggler.php @@ -46,7 +46,7 @@ class bulkedittoggler implements named_templatable, renderable { /** * Export this data so it can be used as the context for a mustache template (core/inplace_editable). * - * @param renderer_base $output typically, the renderer that's calling this function + * @param \renderer_base $output typically, the renderer that's calling this function * @return stdClass data context for a mustache template */ public function export_for_template(\renderer_base $output) { diff --git a/public/course/format/classes/output/local/content/bulkedittools.php b/public/course/format/classes/output/local/content/bulkedittools.php index d453bd4acd1..eb1254c3852 100644 --- a/public/course/format/classes/output/local/content/bulkedittools.php +++ b/public/course/format/classes/output/local/content/bulkedittools.php @@ -48,7 +48,7 @@ class bulkedittools implements named_templatable, renderable { /** * Export this data so it can be used as the context for a mustache template (core/inplace_editable). * - * @param renderer_base $output typically, the renderer that's calling this function + * @param \renderer_base $output typically, the renderer that's calling this function * @return stdClass data context for a mustache template */ public function export_for_template(\renderer_base $output): stdClass { diff --git a/public/course/format/classes/output/local/content/cm/cmicon.php b/public/course/format/classes/output/local/content/cm/cmicon.php index 784b96eb1e6..13cd7595448 100644 --- a/public/course/format/classes/output/local/content/cm/cmicon.php +++ b/public/course/format/classes/output/local/content/cm/cmicon.php @@ -66,7 +66,7 @@ class cmicon implements named_templatable, renderable { * Export this data so it can be used as the context for a mustache template. * * @param \renderer_base $output typically, the renderer that's calling this function - * @return stdClass data context for a mustache template + * @return array data context for a mustache template */ public function export_for_template(\renderer_base $output): array { $mod = $this->mod; diff --git a/public/course/format/classes/output/local/content/cm/cmname.php b/public/course/format/classes/output/local/content/cm/cmname.php index 99e2a448fb7..8638cd172c3 100644 --- a/public/course/format/classes/output/local/content/cm/cmname.php +++ b/public/course/format/classes/output/local/content/cm/cmname.php @@ -95,7 +95,7 @@ class cmname implements named_templatable, renderable { * Export this data so it can be used as the context for a mustache template. * * @param \renderer_base $output typically, the renderer that's calling this function - * @return stdClass data context for a mustache template + * @return array data context for a mustache template */ public function export_for_template(\renderer_base $output): array { $mod = $this->mod; diff --git a/public/course/format/classes/output/local/content/cm/controlmenu.php b/public/course/format/classes/output/local/content/cm/controlmenu.php index 6a841d68f01..4b5b97de493 100644 --- a/public/course/format/classes/output/local/content/cm/controlmenu.php +++ b/public/course/format/classes/output/local/content/cm/controlmenu.php @@ -299,7 +299,7 @@ class controlmenu extends basecontrolmenu { /** * Generates the visibility item for a course module. * - * @return link|null The menu item if applicable, otherwise null. + * @return link_secondary|subpanel|null The menu item if applicable, otherwise null. */ protected function get_cm_visibility_item(): link_secondary|subpanel|null { if (!has_capability('moodle/course:activityvisibility', $this->modcontext)) { diff --git a/public/course/format/classes/output/local/content/cm/title.php b/public/course/format/classes/output/local/content/cm/title.php index 9c8b932b248..546656e5443 100644 --- a/public/course/format/classes/output/local/content/cm/title.php +++ b/public/course/format/classes/output/local/content/cm/title.php @@ -121,7 +121,7 @@ class title extends inplace_editable implements named_templatable, renderable { * Export this data so it can be used as the context for a mustache template. * * @param \renderer_base $output typically, the renderer that's calling this function - * @return stdClass data context for a mustache template + * @return array data context for a mustache template */ public function export_for_template(\renderer_base $output): array { diff --git a/public/course/format/classes/output/local/content/frontpagesection.php b/public/course/format/classes/output/local/content/frontpagesection.php index b9f3b551fd3..5e9035a9cc4 100644 --- a/public/course/format/classes/output/local/content/frontpagesection.php +++ b/public/course/format/classes/output/local/content/frontpagesection.php @@ -72,7 +72,7 @@ class frontpagesection implements named_templatable, renderable { /** * Export this data so it can be used as the context for a mustache template. * - * @param renderer_base $output typically, the renderer that's calling this function + * @param \renderer_base $output typically, the renderer that's calling this function * @return stdClass data context for a mustache template */ public function export_for_template(\renderer_base $output): stdClass { diff --git a/public/course/format/classes/output/local/content/section/availability.php b/public/course/format/classes/output/local/content/section/availability.php index a9b4839aeb2..59ae864c79a 100644 --- a/public/course/format/classes/output/local/content/section/availability.php +++ b/public/course/format/classes/output/local/content/section/availability.php @@ -127,7 +127,7 @@ class availability implements named_templatable, renderable { * activities. * * @param \renderer_base $output typically, the renderer that's calling this function - * @return stdclass data context for a mustache template + * @return array data context for a mustache template */ protected function get_info(\renderer_base $output): array { global $CFG, $USER; diff --git a/public/course/format/classes/output/local/content/section/cmlist.php b/public/course/format/classes/output/local/content/section/cmlist.php index 158b08623f2..b1894019708 100644 --- a/public/course/format/classes/output/local/content/section/cmlist.php +++ b/public/course/format/classes/output/local/content/section/cmlist.php @@ -78,8 +78,8 @@ class cmlist implements named_templatable, renderable { /** * Export this data so it can be used as the context for a mustache template. * - * @param renderer_base $output typically, the renderer that's calling this function - * @return array data context for a mustache template + * @param \renderer_base $output typically, the renderer that's calling this function + * @return stdClass data context for a mustache template */ public function export_for_template(\renderer_base $output): stdClass { global $USER; diff --git a/public/course/format/classes/output/local/content/section/cmsummary.php b/public/course/format/classes/output/local/content/section/cmsummary.php index b98c061b7b3..befcdac7685 100644 --- a/public/course/format/classes/output/local/content/section/cmsummary.php +++ b/public/course/format/classes/output/local/content/section/cmsummary.php @@ -63,8 +63,8 @@ class cmsummary implements named_templatable, renderable { /** * Export this data so it can be used as the context for a mustache template. * - * @param renderer_base $output typically, the renderer that's calling this function - * @return array data context for a mustache template + * @param \renderer_base $output typically, the renderer that's calling this function + * @return stdClass data context for a mustache template */ public function export_for_template(\renderer_base $output): stdClass { diff --git a/public/course/format/classes/output/local/content/section/header.php b/public/course/format/classes/output/local/content/section/header.php index 105adce472f..2fa50c8d096 100644 --- a/public/course/format/classes/output/local/content/section/header.php +++ b/public/course/format/classes/output/local/content/section/header.php @@ -62,8 +62,8 @@ class header implements named_templatable, renderable { /** * Export this data so it can be used as the context for a mustache template. * - * @param renderer_base $output typically, the renderer that's calling this function - * @return array data context for a mustache template + * @param \renderer_base $output typically, the renderer that's calling this function + * @return stdClass data context for a mustache template */ public function export_for_template(\renderer_base $output): stdClass { diff --git a/public/course/format/classes/output/local/content/section/summary.php b/public/course/format/classes/output/local/content/section/summary.php index d381e16ef74..bb7a7de9968 100644 --- a/public/course/format/classes/output/local/content/section/summary.php +++ b/public/course/format/classes/output/local/content/section/summary.php @@ -63,8 +63,8 @@ class summary implements named_templatable, renderable { /** * Export this data so it can be used as the context for a mustache template. * - * @param renderer_base $output typically, the renderer that's calling this function - * @return array data context for a mustache template + * @param \renderer_base $output typically, the renderer that's calling this function + * @return stdClass data context for a mustache template */ public function export_for_template(\renderer_base $output): stdClass { diff --git a/public/course/format/classes/output/local/content/sectionnavigation.php b/public/course/format/classes/output/local/content/sectionnavigation.php index 02f7059009c..4c68231cc10 100644 --- a/public/course/format/classes/output/local/content/sectionnavigation.php +++ b/public/course/format/classes/output/local/content/sectionnavigation.php @@ -65,7 +65,7 @@ class sectionnavigation implements named_templatable, renderable { /** * Export this data so it can be used as the context for a mustache template. * - * @param renderer_base $output typically, the renderer that's calling this function + * @param \renderer_base $output typically, the renderer that's calling this function * @return stdClass data context for a mustache template */ public function export_for_template(\renderer_base $output): stdClass { diff --git a/public/course/format/classes/output/local/state/cm.php b/public/course/format/classes/output/local/state/cm.php index b83995a899c..bbc62073cce 100644 --- a/public/course/format/classes/output/local/state/cm.php +++ b/public/course/format/classes/output/local/state/cm.php @@ -50,7 +50,7 @@ class cm implements renderable { protected cm_info $cm, /** @var bool $exportcontent False if pre-rendered cmitem HTML content must be exported. */ protected bool $exportcontent = false, - /** @var ?bool $istrackeduser If is_tracked_user is pre-computed for this CM's course, it can be provided here. */ + /** @var bool|null $istrackeduser If is_tracked_user is pre-computed for this CM's course, it can be provided here. */ protected ?bool $istrackeduser = null, ) { } diff --git a/public/course/format/classes/output/local/state/course.php b/public/course/format/classes/output/local/state/course.php index 53a427cc6e8..78aa24bea4a 100644 --- a/public/course/format/classes/output/local/state/course.php +++ b/public/course/format/classes/output/local/state/course.php @@ -46,7 +46,7 @@ class course implements renderable { /** * Export this data so it can be used as state object in the course editor. * - * @param renderer_base $output typically, the renderer that's calling this function + * @param \renderer_base $output typically, the renderer that's calling this function * @return stdClass data context for a mustache template */ public function export_for_template(\renderer_base $output): stdClass { diff --git a/public/course/format/classes/output/local/state/section.php b/public/course/format/classes/output/local/state/section.php index 96355dc401f..c3877507489 100644 --- a/public/course/format/classes/output/local/state/section.php +++ b/public/course/format/classes/output/local/state/section.php @@ -53,7 +53,7 @@ class section implements renderable { * Export this data so it can be used as state object in the course editor. * * @param \renderer_base $output typically, the renderer that's calling this function - * @return array data context for a mustache template + * @return stdClass data context for a mustache template */ public function export_for_template(\renderer_base $output): stdClass { $format = $this->format; diff --git a/public/course/format/classes/output/section_renderer.php b/public/course/format/classes/output/section_renderer.php index 80f69f28bfb..1714cf3e0ec 100644 --- a/public/course/format/classes/output/section_renderer.php +++ b/public/course/format/classes/output/section_renderer.php @@ -176,9 +176,9 @@ abstract class section_renderer extends core_course_renderer { * If the format is not compatible with the course index, this method will return an empty string. * * @param course_format $format the course format - * @return String the course index HTML. + * @return string the course index HTML. */ - public function course_index_drawer(course_format $format): ?String { + public function course_index_drawer(course_format $format): ?string { if ($format->uses_course_index()) { include_course_editor($format); return $this->render_from_template('core_courseformat/local/courseindex/drawer', []); diff --git a/public/course/format/classes/privacy/provider.php b/public/course/format/classes/privacy/provider.php index 9481eec65f6..6e0465e75bc 100644 --- a/public/course/format/classes/privacy/provider.php +++ b/public/course/format/classes/privacy/provider.php @@ -31,7 +31,7 @@ class provider implements // This system has some sitewide user preferences to export. \core_privacy\local\request\user_preference_provider { - /** The user preference for the navigation drawer. */ + /** @var string The user preference for the navigation drawer. */ public const SECTION_PREFERENCES_PREFIX = 'coursesectionspreferences'; /** diff --git a/public/course/format/classes/sectiondelegate.php b/public/course/format/classes/sectiondelegate.php index 33887ac4729..9596779533c 100644 --- a/public/course/format/classes/sectiondelegate.php +++ b/public/course/format/classes/sectiondelegate.php @@ -49,7 +49,7 @@ abstract class sectiondelegate { * Get the section info instance if available. * * @param section_info $sectioninfo - * @return section_info|null + * @return sectiondelegate|null */ public static function instance(section_info $sectioninfo): ?self { if (empty($sectioninfo->component)) { diff --git a/public/course/format/classes/stateupdates.php b/public/course/format/classes/stateupdates.php index feed784ed52..eb4978f46c8 100644 --- a/public/course/format/classes/stateupdates.php +++ b/public/course/format/classes/stateupdates.php @@ -64,7 +64,7 @@ class stateupdates implements JsonSerializable { /** * Return the data to serialize the current track in JSON. * - * @return stdClass the statement data structure + * @return array the statement data structure */ public function jsonSerialize(): array { return $this->updates; diff --git a/public/course/format/singleactivity/classes/output/renderer.php b/public/course/format/singleactivity/classes/output/renderer.php index f5d129d34dd..80376efb28e 100644 --- a/public/course/format/singleactivity/classes/output/renderer.php +++ b/public/course/format/singleactivity/classes/output/renderer.php @@ -34,6 +34,7 @@ class renderer extends section_renderer { * @param \stdClass $course record from table course * @param bool $orphaned if false displays the main activity (if present) * if true displays all other activities + * @return string */ public function display($course, $orphaned) { diff --git a/public/course/format/tests/base_test.php b/public/course/format/tests/base_test.php index 5186326bde3..c1911261227 100644 --- a/public/course/format/tests/base_test.php +++ b/public/course/format/tests/base_test.php @@ -782,7 +782,7 @@ final class base_test extends advanced_testcase { * * @param string $action the ajax action name * @param string $expectedparam the expected param to check - * @param string $exception if an exception is expected + * @param bool $exception if an exception is expected */ #[\PHPUnit\Framework\Attributes\DataProvider('get_non_ajax_cm_action_url_provider')] public function test_get_non_ajax_cm_action_url(string $action, string $expectedparam, bool $exception): void { diff --git a/public/course/format/tests/fixtures/format_theunittest.php b/public/course/format/tests/fixtures/format_theunittest.php index cf999f9aaf5..9879aaf8a58 100644 --- a/public/course/format/tests/fixtures/format_theunittest.php +++ b/public/course/format/tests/fixtures/format_theunittest.php @@ -85,6 +85,8 @@ class format_theunittest extends core_courseformat\base { /** * Returns true if this course format uses sections + * + * @return bool */ public function uses_sections() { return true; diff --git a/public/course/format/tests/fixtures/format_theunittest_output_course_format_invalidoutput.php b/public/course/format/tests/fixtures/format_theunittest_output_course_format_invalidoutput.php index f1562164c4b..416cab5ca94 100644 --- a/public/course/format/tests/fixtures/format_theunittest_output_course_format_invalidoutput.php +++ b/public/course/format/tests/fixtures/format_theunittest_output_course_format_invalidoutput.php @@ -32,7 +32,7 @@ class invalidoutput implements renderable, templatable { /** * Export some data. * - * @param renderer_base $output typically, the renderer that's calling this function + * @param \renderer_base $output typically, the renderer that's calling this function * @return stdClass data context for a mustache template */ public function export_for_template(\renderer_base $output): stdClass { diff --git a/public/course/format/tests/fixtures/format_theunittest_output_course_format_state.php b/public/course/format/tests/fixtures/format_theunittest_output_course_format_state.php index 6da29ebe05e..d7d69290b5d 100644 --- a/public/course/format/tests/fixtures/format_theunittest_output_course_format_state.php +++ b/public/course/format/tests/fixtures/format_theunittest_output_course_format_state.php @@ -30,8 +30,8 @@ class course extends course_state { /** * Export this data so it can be used as state object in the course editor. * - * @param renderer_base $output typically, the renderer that's calling this function - * @return stdClass data context for a mustache template + * @param \renderer_base $output typically, the renderer that's calling this function + * @return \stdClass data context for a mustache template */ public function export_for_template(\renderer_base $output): \stdClass { $data = parent::export_for_template($output); diff --git a/public/course/format/tests/local/overview/overviewfactory_test.php b/public/course/format/tests/local/overview/overviewfactory_test.php index 25df066e690..d6e5194733c 100644 --- a/public/course/format/tests/local/overview/overviewfactory_test.php +++ b/public/course/format/tests/local/overview/overviewfactory_test.php @@ -37,6 +37,7 @@ final class overviewfactory_test extends \advanced_testcase { * Test create method on resource activities. * * @param string $resourcetype + * @param string|null $expected */ #[\PHPUnit\Framework\Attributes\DataProvider('create_resource_provider')] public function test_create_resource( diff --git a/public/course/format/tests/stateactions_test.php b/public/course/format/tests/stateactions_test.php index 5f72ecd0684..2f878ea789d 100644 --- a/public/course/format/tests/stateactions_test.php +++ b/public/course/format/tests/stateactions_test.php @@ -175,7 +175,7 @@ final class stateactions_test extends \advanced_testcase { * @param stdClass $course the course data * @param string $rolename the testing role name */ - private function set_test_user_by_role(stdClass $course, string $rolename) { + private function set_test_user_by_role(stdClass $course, string $rolename): void { if ($rolename == 'admin') { $this->setAdminUser(); } else { @@ -655,7 +655,7 @@ final class stateactions_test extends \advanced_testcase { * @param string $role the user role * @param string[] $idrefs the sections or cms id references to be used as method params * @param bool $expectedexception whether the call should throw an exception - * @param int[] $expectedtotal the expected total number of state indexed by put, remove and create + * @param int[] $expectedtotals the expected total number of state indexed by put, remove and create * @param string|null $coursefield the course field to check * @param int|string|null $coursevalue the section field value * @param string|null $sectionfield the section field to check diff --git a/public/course/format/topics/classes/output/courseformat/content/section/controlmenu.php b/public/course/format/topics/classes/output/courseformat/content/section/controlmenu.php index d217a5e3151..1148d9c2a94 100644 --- a/public/course/format/topics/classes/output/courseformat/content/section/controlmenu.php +++ b/public/course/format/topics/classes/output/courseformat/content/section/controlmenu.php @@ -96,7 +96,7 @@ class controlmenu extends controlmenu_base { /** * Retrieves the view item for the section control menu. * - * @return action_menu_link|null The menu item if applicable, otherwise null. + * @return action_menu_link_secondary The menu item if applicable, otherwise null. */ protected function get_section_highlight_item(): action_menu_link_secondary { $format = $this->format;