Skip to content

Commit

Permalink
MDL-71439 core_grades: remove returning null when not possible
Browse files Browse the repository at this point in the history
The method explicitly declares 'stdClass' as the return type.
  • Loading branch information
mdjnelson committed Oct 27, 2021
1 parent 2b2897b commit 2e1c282
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions grade/classes/component_gradeitem.php
Expand Up @@ -377,9 +377,7 @@ abstract public function create_empty_grade(stdClass $gradeduser, stdClass $grad
public function get_grade(int $gradeid): stdClass {
global $DB;

$grade = $DB->get_record($this->get_table_name(), ['id' => $gradeid]);

return $grade ?: null;
return $DB->get_record($this->get_table_name(), ['id' => $gradeid]);
}

/**
Expand Down

0 comments on commit 2e1c282

Please sign in to comment.