Skip to content

Commit

Permalink
Refactor for MOODLE41 & PHP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
luukverhoeven committed Dec 29, 2023
1 parent 19998dd commit 43ef30e
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions components/plot/line/plugin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,10 @@ public function execute($id, $data, $finalreport) {

if ($finalreport) {
foreach ($finalreport as $r) {

$val = 0;
$hash = null;
$hashkeyexists = isset($r[$data->serieid]);
$yaxiskeyexists = isset($r[$data->yaxis]);

if ($hashkeyexists) {
$hash = md5(strtolower($r[$data->serieid]));
$sname[$hash] = $r[$data->serieid];
}

if ($yaxiskeyexists && is_numeric($r[$data->yaxis])) {
$val = $r[$data->yaxis];
}

if ($hash !== null) {
$series[$hash][] = $val;
}

$hash = md5(strtolower($r[$data->serieid] ?? ''));
$sname[$hash] = $r[$data->serieid] ?? null;
$val = (isset($r[$data->yaxis]) && is_numeric($r[$data->yaxis])) ? $r[$data->yaxis] : 0;
$series[$hash][] = $val;
$minvalue = ($val < $minvalue) ? $val : $minvalue;
$maxvalue = ($val > $maxvalue) ? $val : $maxvalue;
}
Expand Down

0 comments on commit 43ef30e

Please sign in to comment.