SiteStats: Use the null coalescing assignment operator

Available since PHP 7.4. Follows up 43a93d9782.

Change-Id: I1460645b5e04f18df55167ce6b60bce57a1006e7
This commit is contained in:
Kevin Israel 2022-10-21 16:48:41 -04:00
parent c7110ae098
commit 0227699422

View file

@ -250,7 +250,7 @@ class SiteStats {
$finalRow = new stdClass();
foreach ( $rows as $row ) {
foreach ( $fields as $field ) {
$finalRow->$field = $finalRow->$field ?? 0;
$finalRow->$field ??= 0;
if ( $row->$field ) {
$finalRow->$field += $row->$field;
}