Skip to content

Commit

Permalink
Coding style fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Sep 25, 2023
1 parent 00c92f3 commit d39d7e3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
16 changes: 8 additions & 8 deletions classes/repository/instance_repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ public static function get_by_id(int $id, bool $withstrings = true) : instance {
$sortedstrings = [];
$dboheaders = $DB->get_records(tables::LOCALIZED_STRING_TABLE);
foreach ($dboheaders as $dboheader) {
$dbo_obj = new db_localized_string;
$dbo_obj->id = $dboheader->id;
$dbo_obj->languageid = $dboheader->languageid;
$dbo_obj->string = $dboheader->string;
$dbo_obj->type = $dboheader->type;
$dbo_obj->foreignkey = $dboheader->foreignkey;

$sortedstrings[$dbo_obj->type][$dbo_obj->foreignkey][$dbo_obj->languageid] = $dbo_obj;
$dboobj = new db_localized_string;
$dboobj->id = $dboheader->id;
$dboobj->languageid = $dboheader->languageid;
$dboobj->string = $dboheader->string;
$dboobj->type = $dboheader->type;
$dboobj->foreignkey = $dboheader->foreignkey;

$sortedstrings[$dboobj->type][$dboobj->foreignkey][$dboobj->languageid] = $dboobj;
}

foreach ($dbocategories as $dbocategory) {
Expand Down
4 changes: 2 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function verbalfeedback_delete_instance($id) {
*/
function verbalfeedback_supports($feature) {
if (defined('FEATURE_MOD_PURPOSE') && defined('MOD_PURPOSE_ASSESSMENT')) {
// Moodle ≥ 4.0.
// Moodle ≥ 4.0.
switch ($feature) {
case FEATURE_MOD_INTRO:
return true;
Expand All @@ -209,7 +209,7 @@ function verbalfeedback_supports($feature) {
return null;
}
} else {
// Moodle ≤ 3.11.
// Moodle ≤ 3.11.
switch ($feature) {
case FEATURE_MOD_INTRO:
return true;
Expand Down
8 changes: 6 additions & 2 deletions tests/verbalfeedback_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_verbalfeedback\test;

defined('MOODLE_INTERNAL') || die();

use core_analytics\model;
use mod_verbalfeedback\model\instance;

Expand Down Expand Up @@ -104,7 +108,7 @@ protected function create_and_enrol_users() {
/**
* Test a verbalfeedback instance
*
* @covers ::instance
* @covers verbalfeedback::instance
*/
public function test_verbalfeedback() {
$this->resetAfterTest(true);
Expand All @@ -122,4 +126,4 @@ public function test_verbalfeedback_get_user_grade() {
$this->resetAfterTest(true);
$this->assertEquals([], verbalfeedback_get_user_grades($this->verbalfeedback));
}
}
}

0 comments on commit d39d7e3

Please sign in to comment.