MDL-68388 grade: Tidy comments and whitespace

This commit is contained in:
Andrew Nicols 2020-05-26 10:15:52 +08:00
parent a7aaf91855
commit 17238ab079
2 changed files with 3 additions and 7 deletions

View file

@ -229,11 +229,8 @@ if (!$edit) {
} }
} }
// Cache the changed letters.
if (!empty($letters)) { if (!empty($letters)) {
// Ensure that the letters are correctly sorted.
// For some reason, the cache saves it in the order in which they were entered
// but we really want to order them in descending order so we sort it here.
krsort($letters); krsort($letters);
$cache->set($context->id, $letters); $cache->set($context->id, $letters);
} }

View file

@ -250,8 +250,7 @@ class core_gradelib_testcase extends advanced_testcase {
/** /**
* Test the caching of grade letters. * Test the caching of grade letters.
*/ */
public function test_get_grade_letters() { public function test_get_grade_letters(): void {
$this->resetAfterTest(); $this->resetAfterTest();
// Setup some basics. // Setup some basics.
@ -275,7 +274,7 @@ class core_gradelib_testcase extends advanced_testcase {
/** /**
* Test custom letters. * Test custom letters.
*/ */
public function test_get_grade_letters_custom() { public function test_get_grade_letters_custom(): void {
global $DB; global $DB;
$this->resetAfterTest(); $this->resetAfterTest();