From a39cdd90f401e1c20b9e831bb01f5721edf4a921 Mon Sep 17 00:00:00 2001 From: lotyp Date: Fri, 10 May 2024 17:49:45 +0300 Subject: [PATCH] fix: return experimental, if version is not found --- src/Info.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Info.php b/src/Info.php index bb6913e0..5d076900 100644 --- a/src/Info.php +++ b/src/Info.php @@ -26,19 +26,20 @@ class Info CONSOLE; public const TRAP_ROOT = __DIR__ . '/..'; + private const VERSION = 'experimental'; public static function version(): string { $versionPath = self::TRAP_ROOT . '/src/version.json'; if (!file_exists($versionPath)) { - throw new \RuntimeException('Version file not found.'); + return self::VERSION; } /** @var array $versionData */ $versionData = json_decode(file_get_contents($versionPath), true); if (!isset($versionData['.']) || !is_string($versionData['.'])) { - throw new \RuntimeException('Version key not found or is not a string in JSON.'); + return self::VERSION; } return $versionData['.']; }