From a31190422a7b3be745d1114e8c86bba071dd7636 Mon Sep 17 00:00:00 2001 From: fogelito Date: Thu, 11 Sep 2025 09:41:17 +0300 Subject: [PATCH] formatting --- .../Platform/Workers/StatsResources.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Appwrite/Platform/Workers/StatsResources.php b/src/Appwrite/Platform/Workers/StatsResources.php index daecabf16a..0c8f11c07b 100644 --- a/src/Appwrite/Platform/Workers/StatsResources.php +++ b/src/Appwrite/Platform/Workers/StatsResources.php @@ -440,25 +440,31 @@ class StatsResources extends Action usort($this->documents, function ($a, $b) { // Metric DESC $cmp = strcmp($b['metric'], $a['metric']); - if ($cmp !== 0) return $cmp; + if ($cmp !== 0) { + return $cmp; + } // Period ASC $cmp = strcmp($a['period'], $b['period']); - if ($cmp !== 0) return $cmp; + if ($cmp !== 0) { + return $cmp; + } // Time ASC, NULLs first - if ($a['time'] === null) return ($b['time'] === null) ? 0 : -1; - if ($b['time'] === null) return 1; + if ($a['time'] === null) { + return ($b['time'] === null) ? 0 : -1; + } + if ($b['time'] === null) { + return 1; + } return strcmp($a['time'], $b['time']); }); - var_dump($this->documents); try { $dbForLogs->createOrUpdateDocuments( 'stats', $this->documents, - 10 // See if this make an effect ); Console::success($message . ' | Documents: ' . count($this->documents));