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); }