From 78210014f9fe9f28b85d40d0f128be5f13e6631f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Mon, 25 Sep 2023 08:16:09 +0200 Subject: [PATCH] Coding style fixes. --- classes/repository/instance_repository.php | 16 ++++++++-------- lib.php | 4 ++-- tests/verbalfeedback_test.php | 8 ++++++-- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/classes/repository/instance_repository.php b/classes/repository/instance_repository.php index 526cf10..c19c34d 100644 --- a/classes/repository/instance_repository.php +++ b/classes/repository/instance_repository.php @@ -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) { diff --git a/lib.php b/lib.php index 72bbd7c..6bd0514 100644 --- a/lib.php +++ b/lib.php @@ -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; @@ -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; diff --git a/tests/verbalfeedback_test.php b/tests/verbalfeedback_test.php index b57c3ec..5fd04d6 100644 --- a/tests/verbalfeedback_test.php +++ b/tests/verbalfeedback_test.php @@ -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; @@ -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); @@ -122,4 +126,4 @@ public function test_verbalfeedback_get_user_grade() { $this->resetAfterTest(true); $this->assertEquals([], verbalfeedback_get_user_grades($this->verbalfeedback)); } -} \ No newline at end of file +}