From fb66a05840c8cf2f6260707d63e22c05422ec4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFck=20Piera?= Date: Thu, 21 Mar 2024 12:15:43 +0100 Subject: [PATCH] Fix guard_min_version stacktrace --- src/functions.php | 2 +- .../Generated/VersionGuardMinVersionCheckFailTest.php.err.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/functions.php b/src/functions.php index 96b631ea..0b8f02fa 100644 --- a/src/functions.php +++ b/src/functions.php @@ -1092,7 +1092,7 @@ function guard_min_version(string $minVersion): void $minVersion = u($minVersion)->ensureStart('v')->toString(); if (version_compare($currentVersion, $minVersion, '<')) { - throw new MinimumVersionRequirementNotMetException($minVersion, $currentVersion); + throw fix_exception(new MinimumVersionRequirementNotMetException($minVersion, $currentVersion)); } } diff --git a/tests/Examples/Generated/VersionGuardMinVersionCheckFailTest.php.err.txt b/tests/Examples/Generated/VersionGuardMinVersionCheckFailTest.php.err.txt index 8cfbf985..4dddf571 100644 --- a/tests/Examples/Generated/VersionGuardMinVersionCheckFailTest.php.err.txt +++ b/tests/Examples/Generated/VersionGuardMinVersionCheckFailTest.php.err.txt @@ -1,5 +1,5 @@ -In functions.php line XXXX: +In version-guard.php line 18: This project requires Castor in version v999.0.0 or greater, you are using vX.Y.Z. Please consider upgrading.