diff --git a/mod/data/classes/search/entry.php b/mod/data/classes/search/entry.php index 35b5ec89d9a..47ae9d9f895 100644 --- a/mod/data/classes/search/entry.php +++ b/mod/data/classes/search/entry.php @@ -373,7 +373,7 @@ class entry extends \core_search\base_mod { * @param string $fieldtype * @return string|null It will return the class name or null if the field type is not available. */ - protected function get_field_class_name($fieldtype) { + protected function get_field_class_name(string $fieldtype) : ?string { global $CFG; $fieldtype = trim($fieldtype); diff --git a/mod/data/lib.php b/mod/data/lib.php index 3dd07890cea..ae6bdd2b4f2 100644 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -1027,7 +1027,7 @@ function data_get_field_new($type, $data) { * @param stdClass|null $cm optional course module data * @return data_field_base the field object instance or data_field_base if unkown type */ -function data_get_field($field, $data, $cm=null) { +function data_get_field(stdClass $field, stdClass $data, ?stdClass $cm=null): data_field_base { global $CFG; if (!isset($field->type)) { return new data_field_base($field);