Browse Source

Fixed codechecker flagged errors

40-behatfixes
Peter Rundqvist 3 years ago
parent
commit
7721cce204
  1. 2
      classes/attendance_webservices_handler.php
  2. 11
      tests/externallib_test.php

2
classes/attendance_webservices_handler.php

@ -172,7 +172,7 @@ class attendance_handler {
$sessionsinfo = array(); $sessionsinfo = array();
foreach($sessions as $session) { foreach ($sessions as $session) {
$sessionsinfo[$session->id] = self::get_session($session->id); $sessionsinfo[$session->id] = self::get_session($session->id);
} }

11
tests/externallib_test.php

@ -479,21 +479,21 @@ class mod_attendance_external_testcase extends externallib_advanced_testcase {
$courseswithsessions = external_api::clean_returnvalue(mod_attendance_external::get_courses_with_today_sessions_returns(), $courseswithsessions = external_api::clean_returnvalue(mod_attendance_external::get_courses_with_today_sessions_returns(),
$courseswithsessions); $courseswithsessions);
foreach($courseswithsessions as $course) { foreach ($courseswithsessions as $course) {
$attendanceinstances = $course['attendance_instances']; $attendanceinstances = $course['attendance_instances'];
foreach($attendanceinstances as $attendanceinstance) { foreach ($attendanceinstances as $attendanceinstance) {
$sessionsinfo = $attendanceinstance['today_sessions']; $sessionsinfo = $attendanceinstance['today_sessions'];
foreach($sessionsinfo as $sessioninfo) { foreach ($sessionsinfo as $sessioninfo) {
$sessions = attendance_handler::get_sessions($sessioninfo['attendanceid']); $sessions = attendance_handler::get_sessions($sessioninfo['attendanceid']);
$sessions = external_api::clean_returnvalue(mod_attendance_external::get_sessions_returns(), $sessions = external_api::clean_returnvalue(mod_attendance_external::get_sessions_returns(),
$sessions); $sessions);
foreach($sessions as $session) { foreach ($sessions as $session) {
$sessiontocompareagainst = attendance_handler::get_session($session['id']); $sessiontocompareagainst = attendance_handler::get_session($session['id']);
$sessiontocompareagainst = external_api::clean_returnvalue(mod_attendance_external::get_session_returns(), $sessiontocompareagainst = external_api::clean_returnvalue(mod_attendance_external::get_session_returns(),
$sessiontocompareagainst); $sessiontocompareagainst);
@ -504,7 +504,6 @@ class mod_attendance_external_testcase extends externallib_advanced_testcase {
} }
} }
} }
} }
} }
} }

Loading…
Cancel
Save