mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-76034 mod_data: Add type definitions and return values
Type definitions and return values for methods get_field_class_name() and data_get_field()
This commit is contained in:
parent
cccc00954d
commit
d6b8dd892c
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user