From 5570f07e6920dcb99551b26955a9d42db8b9cdd3 Mon Sep 17 00:00:00 2001 From: Jonathan Champ Date: Fri, 21 Jul 2023 13:29:52 -0400 Subject: [PATCH] phpcs: small cleanups --- classes/task/get_meeting_reports.php | 10 ++++------ tests/get_meeting_reports_test.php | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/classes/task/get_meeting_reports.php b/classes/task/get_meeting_reports.php index c65328cd..df5a8093 100644 --- a/classes/task/get_meeting_reports.php +++ b/classes/task/get_meeting_reports.php @@ -461,7 +461,7 @@ public function debugmsg($msg) { * @return boolean */ public function process_meeting_reports($meeting) { - global $DB, $CFG; + global $DB; $this->debugmsg(sprintf('Processing meeting %s|%s that occurred at %s', $meeting->meeting_id, $meeting->uuid, $meeting->start_time)); @@ -532,7 +532,7 @@ public function process_meeting_reports($meeting) { 'detailsid' => $participant['detailsid'], 'zoomuserid' => $participant['zoomuserid'], 'join_time' => $participant['join_time'], - 'leave_time' => $participant['leave_time'] + 'leave_time' => $participant['leave_time'], ]; // Check if the record already exists. @@ -623,7 +623,7 @@ public function grading_participant_upon_duration($zoomrecord, $detailsid) { // Check if there is old duration stored for this user. if (!empty($durations[$userid])) { - $old = new \stdClass; + $old = new \stdClass(); $old->duration = $durations[$userid]; $old->join_time = $join[$userid]; $old->leave_time = $leave[$userid]; @@ -700,7 +700,6 @@ public function grading_participant_upon_duration($zoomrecord, $detailsid) { } else { $notenrolled[$userid] = fullname(\core_user::get_user($userid)); } - } else { // This means that this user was not identified. // Provide information about participants that need to be graded manually. @@ -800,7 +799,7 @@ public function notify_teachers($data) { $needgradenumber = count($data['needgrade']); // List of users need grading. $needstring = get_string('grading_needgrade', 'mod_zoom'); - $needgrade = (!empty($data['needgrade'])) ? $needstring.implode('
', $data['needgrade'])."\n" : ''; + $needgrade = (!empty($data['needgrade'])) ? $needstring . implode('
', $data['needgrade']) . "\n" : ''; $zoomid = $data['zoomid']; $itemid = $data['itemid']; @@ -974,7 +973,6 @@ public function get_users_clicked_join($zoomrecord) { foreach ($events as $event) { if ($event->other['meetingid'] == $zoomrecord->meeting_id && !in_array($event->userid, $userids)) { - $userids[] = $event->userid; } } diff --git a/tests/get_meeting_reports_test.php b/tests/get_meeting_reports_test.php index 9c6389dd..89cc1636 100644 --- a/tests/get_meeting_reports_test.php +++ b/tests/get_meeting_reports_test.php @@ -438,7 +438,7 @@ public function test_grading_method() { $context = \context_course::instance($course->id); $graders = get_users_by_capability($context, 'moodle/grade:edit'); $this->assertEquals(1, count($graders)); - $firstkey = array_key_first($graders); + $firstkey = key($graders); $this->assertEquals($graders[$firstkey]->id, $teacher->id); // Now fake the meeting details. $meeting = new stdClass(); @@ -684,7 +684,7 @@ public function test_grading_method() { // The user need grading. $needgradestr = get_string('grading_needgrade', 'mod_zoom'); $needgrade[] = '(Name: Farouk, grade: 55)'; - $needgrade = $needgradestr.implode('
', $needgrade)."\n"; + $needgrade = $needgradestr . implode('
', $needgrade) . "\n"; $a = (object)[ 'name' => $zoomrecord->name,