mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-77400 reportbuilder: Fix enrolment status return type
This commit is contained in:
parent
9ee4f8db8b
commit
aec31e312a
@ -69,13 +69,19 @@ class enrolment {
|
||||
*
|
||||
* @param string $value
|
||||
* @param stdClass $row
|
||||
* @return lang_string|null
|
||||
* @return string|null
|
||||
*/
|
||||
public static function enrolment_status(string $value, stdClass $row): ?lang_string {
|
||||
public static function enrolment_status(string $value, stdClass $row): ?string {
|
||||
if (!$row->userid) {
|
||||
return null;
|
||||
}
|
||||
$statusvalues = self::enrolment_values();
|
||||
return $statusvalues[(int) $value] ?? null;
|
||||
|
||||
$value = (int) $value;
|
||||
if (!array_key_exists($value, $statusvalues)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $statusvalues[$value];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user