From 92453a6c06ace59b111e13ec9735e52ec26783e8 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 14 Dec 2024 07:38:38 +0100 Subject: [PATCH] Update GraphApplication.php --- lib/GraphApplication.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/GraphApplication.php b/lib/GraphApplication.php index 9633084..81cfb6a 100644 --- a/lib/GraphApplication.php +++ b/lib/GraphApplication.php @@ -10,7 +10,11 @@ final class GraphApplication */ public function start(string $jsonGlob): int { - $jsonFiles = glob($jsonGlob); + $jsonFiles = glob($jsonGlob, GLOB_NOSORT); + usort( $jsonFiles, function( string $a, string $b ) { + return filemtime($a) - filemtime($b); + }); + if (!$jsonFiles) { throw new \RuntimeException('No files found for ' . $jsonGlob); }