MDL-60281 general: function each() is deprecated in PHP7.2
This commit is contained in:
@@ -126,7 +126,8 @@ class workshop_random_allocator implements workshop_allocator {
|
||||
$allreviewers = $reviewers[0];
|
||||
$allreviewersreloaded = false;
|
||||
foreach ($newallocations as $newallocation) {
|
||||
list($reviewerid, $authorid) = each($newallocation);
|
||||
$reviewerid = key($newallocation);
|
||||
$authorid = current($newallocation);
|
||||
$a = new stdClass();
|
||||
if (isset($allreviewers[$reviewerid])) {
|
||||
$a->reviewername = fullname($allreviewers[$reviewerid]);
|
||||
@@ -324,7 +325,8 @@ class workshop_random_allocator implements workshop_allocator {
|
||||
$submissions = $this->workshop->get_submissions($authorids);
|
||||
$submissions = $this->index_submissions_by_authors($submissions);
|
||||
foreach ($newallocations as $newallocation) {
|
||||
list($reviewerid, $authorid) = each($newallocation);
|
||||
$reviewerid = key($newallocation);
|
||||
$authorid = current($newallocation);
|
||||
if (!isset($submissions[$authorid])) {
|
||||
throw new moodle_exception('unabletoallocateauthorwithoutsubmission', 'workshop');
|
||||
}
|
||||
@@ -408,7 +410,8 @@ class workshop_random_allocator implements workshop_allocator {
|
||||
continue;
|
||||
}
|
||||
foreach ($newallocations as $newallocation) {
|
||||
list($nrid, $naid) = each($newallocation);
|
||||
$nrid = key($newallocation);
|
||||
$naid = current($newallocation);
|
||||
if (array($arid, $aaid) == array($nrid, $naid)) {
|
||||
// re-allocation found - let us continue with the next assessment
|
||||
$keepids[$assessmentid] = null;
|
||||
|
||||
Reference in New Issue
Block a user