Optimised phpdoc and array value use in foreach (#1026)

* use array values by already destructed values in foreach
corrected php docs to use string|array

* use values by already desctructered array values in foreach
This commit is contained in:
Dennis Dudek
2022-04-13 10:37:25 +02:00
committed by GitHub
parent 7a13e4a421
commit d90676a793
2 changed files with 14 additions and 14 deletions

View File

@@ -15,7 +15,7 @@ namespace Froxlor\Cron\Traffic;
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Cron
*
*
*/
use Froxlor\Database\Database;
use Froxlor\Settings;
@@ -898,8 +898,8 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
foreach ($months as $month => $traffic) {
if (! isset($httptrafficlast[$year][$month])) {
$returnval += $traffic;
} elseif ($httptrafficlast[$year][$month] < $httptraffic[$year][$month]) {
$returnval += ($httptraffic[$year][$month] - $httptrafficlast[$year][$month]);
} elseif ($httptrafficlast[$year][$month] < $traffic) {
$returnval += ($traffic - $httptrafficlast[$year][$month]);
}
}
}