mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
Merge branch 'MDL-74965-master' of https://github.com/ssj365/moodle
This commit is contained in:
commit
edb09c61d5
@ -184,9 +184,9 @@ class roles {
|
||||
*
|
||||
* @param string|integer $id
|
||||
*
|
||||
* @return stdClass $role
|
||||
* @return stdClass|null $role
|
||||
*/
|
||||
protected static function get_role($id): stdClass {
|
||||
protected static function get_role($id): ?stdClass {
|
||||
$roles = (array) role_get_names();
|
||||
if (is_numeric($id) && isset($roles[$id])) {
|
||||
return (object) $roles[$id];
|
||||
@ -196,6 +196,7 @@ class roles {
|
||||
return $role;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user