From 85c547ffeab1a2e9eb5c928007c53f8751f08cf4 Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Tue, 28 Oct 2025 22:56:40 +0100 Subject: [PATCH 01/10] Add Conditionable traits & phpdoc --- src/Alert.php | 3 +++ src/App.php | 5 ++++- src/AutoUpdater.php | 3 +++ src/ChildProcess.php | 3 +++ src/Clipboard.php | 3 +++ src/Dock.php | 5 ++++- src/Facades/Alert.php | 2 ++ src/Facades/App.php | 2 ++ src/Facades/AutoUpdater.php | 2 ++ src/Facades/ChildProcess.php | 2 ++ src/Facades/Clipboard.php | 2 ++ src/Facades/Dock.php | 2 ++ src/Facades/Menu.php | 2 ++ src/Facades/Notification.php | 2 ++ src/Notification.php | 3 +++ 15 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/Alert.php b/src/Alert.php index c1586581..a6e5da84 100644 --- a/src/Alert.php +++ b/src/Alert.php @@ -3,9 +3,12 @@ namespace Native\Desktop; use Native\Desktop\Client\Client; +use Illuminate\Support\Traits\Conditionable; class Alert { + use Conditionable; + protected ?string $type = null; protected ?string $title = null; diff --git a/src/App.php b/src/App.php index c3905e8a..65375795 100644 --- a/src/App.php +++ b/src/App.php @@ -2,11 +2,14 @@ namespace Native\Desktop; -use Native\Desktop\Client\Client; use Phar; +use Native\Desktop\Client\Client; +use Illuminate\Support\Traits\Conditionable; class App { + use Conditionable; + public function __construct(protected Client $client) {} public function quit(): void diff --git a/src/AutoUpdater.php b/src/AutoUpdater.php index 477cc6ac..8b0885dc 100644 --- a/src/AutoUpdater.php +++ b/src/AutoUpdater.php @@ -3,9 +3,12 @@ namespace Native\Desktop; use Native\Desktop\Client\Client; +use Illuminate\Support\Traits\Conditionable; class AutoUpdater { + use Conditionable; + public function __construct(protected Client $client) {} public function checkForUpdates(): void diff --git a/src/ChildProcess.php b/src/ChildProcess.php index eac73553..b06bddaa 100644 --- a/src/ChildProcess.php +++ b/src/ChildProcess.php @@ -3,10 +3,13 @@ namespace Native\Desktop; use Native\Desktop\Client\Client; +use Illuminate\Support\Traits\Conditionable; use Native\Desktop\Contracts\ChildProcess as ChildProcessContract; class ChildProcess implements ChildProcessContract { + use Conditionable; + public readonly int $pid; public readonly string $alias; diff --git a/src/Clipboard.php b/src/Clipboard.php index ab023447..3a8a9a63 100644 --- a/src/Clipboard.php +++ b/src/Clipboard.php @@ -3,9 +3,12 @@ namespace Native\Desktop; use Native\Desktop\Client\Client; +use Illuminate\Support\Traits\Conditionable; class Clipboard { + use Conditionable; + public function __construct(protected Client $client) {} public function clear() diff --git a/src/Dock.php b/src/Dock.php index 9f6bf9c2..af0ff681 100644 --- a/src/Dock.php +++ b/src/Dock.php @@ -2,11 +2,14 @@ namespace Native\Desktop; -use Native\Desktop\Client\Client; use Native\Desktop\Menu\Menu; +use Native\Desktop\Client\Client; +use Illuminate\Support\Traits\Conditionable; class Dock { + use Conditionable; + public function __construct(protected Client $client) {} public function menu(Menu $menu) diff --git a/src/Facades/Alert.php b/src/Facades/Alert.php index 8801da00..7eaefed8 100644 --- a/src/Facades/Alert.php +++ b/src/Facades/Alert.php @@ -14,6 +14,8 @@ * @method static static cancelId(int $cancelId) * @method static int show(string $message) * @method static bool error(string $title, string $message) + * @method static static when($value = null, ?callable $callback = null, ?callable $default = null) + * @method static static unless($value = null, ?callable $callback = null, ?callable $default = null) */ class Alert extends Facade { diff --git a/src/Facades/App.php b/src/Facades/App.php index ababdc5a..42d8c8e8 100644 --- a/src/Facades/App.php +++ b/src/Facades/App.php @@ -22,6 +22,8 @@ * @method static bool openAtLogin(?bool $open = null) * @method static bool isEmojiPanelSupported() * @method static void showEmojiPanel() + * @method static static when($value = null, ?callable $callback = null, ?callable $default = null) + * @method static static unless($value = null, ?callable $callback = null, ?callable $default = null) */ class App extends Facade { diff --git a/src/Facades/AutoUpdater.php b/src/Facades/AutoUpdater.php index c1e8d07f..43b9ff17 100644 --- a/src/Facades/AutoUpdater.php +++ b/src/Facades/AutoUpdater.php @@ -8,6 +8,8 @@ * @method static void checkForUpdates() * @method static void quitAndInstall() * @method static void downloadUpdate() + * @method static static when($value = null, ?callable $callback = null, ?callable $default = null) + * @method static static unless($value = null, ?callable $callback = null, ?callable $default = null) */ class AutoUpdater extends Facade { diff --git a/src/Facades/ChildProcess.php b/src/Facades/ChildProcess.php index 6fe73811..6a12bebf 100644 --- a/src/Facades/ChildProcess.php +++ b/src/Facades/ChildProcess.php @@ -16,6 +16,8 @@ * @method static \Native\Desktop\ChildProcess php(string|array $cmd, string $alias, array $env = null, bool $persistent = false, ?array $iniSettings = null) * @method static \Native\Desktop\ChildProcess artisan(string|array $cmd, string $alias, array $env = null, bool $persistent = false, ?array $iniSettings = null) * @method static void stop(string $alias = null) + * @method static static when($value = null, ?callable $callback = null, ?callable $default = null) + * @method static static unless($value = null, ?callable $callback = null, ?callable $default = null) */ class ChildProcess extends Facade { diff --git a/src/Facades/Clipboard.php b/src/Facades/Clipboard.php index 5d866303..132909a7 100644 --- a/src/Facades/Clipboard.php +++ b/src/Facades/Clipboard.php @@ -9,6 +9,8 @@ * @method static string text($text = null) * @method static string html($html = null) * @method static string|null image($image = null) + * @method static static when($value = null, ?callable $callback = null, ?callable $default = null) + * @method static static unless($value = null, ?callable $callback = null, ?callable $default = null) */ class Clipboard extends Facade { diff --git a/src/Facades/Dock.php b/src/Facades/Dock.php index 69d1518f..43fa7034 100644 --- a/src/Facades/Dock.php +++ b/src/Facades/Dock.php @@ -13,6 +13,8 @@ * @method static void icon(string $Path) * @method static void menu(Menu $menu) * @method static void show() + * @method static static when($value = null, ?callable $callback = null, ?callable $default = null) + * @method static static unless($value = null, ?callable $callback = null, ?callable $default = null) */ class Dock extends Facade { diff --git a/src/Facades/Menu.php b/src/Facades/Menu.php index 4a540f6c..53e162e1 100644 --- a/src/Facades/Menu.php +++ b/src/Facades/Menu.php @@ -41,6 +41,8 @@ * @method static Role hide(?string $label = null) * @method static void create(MenuItem ...$items) * @method static void default() + * @method static static when($value = null, ?callable $callback = null, ?callable $default = null) + * @method static static unless($value = null, ?callable $callback = null, ?callable $default = null) */ class Menu extends Facade { diff --git a/src/Facades/Notification.php b/src/Facades/Notification.php index 2f2ae116..d6e81b2f 100644 --- a/src/Facades/Notification.php +++ b/src/Facades/Notification.php @@ -12,6 +12,8 @@ * @method static static hasReply(string $placeholder = '') * @method static static addAction(string $label) * @method static void show() + * @method static static when($value = null, ?callable $callback = null, ?callable $default = null) + * @method static static unless($value = null, ?callable $callback = null, ?callable $default = null) */ class Notification extends Facade { diff --git a/src/Notification.php b/src/Notification.php index c46a387e..d989a869 100644 --- a/src/Notification.php +++ b/src/Notification.php @@ -3,9 +3,12 @@ namespace Native\Desktop; use Native\Desktop\Client\Client; +use Illuminate\Support\Traits\Conditionable; class Notification { + use Conditionable; + public ?string $reference = null; protected string $title; From 63c7f67f96e271772ed767d0d48850191c9c41bf Mon Sep 17 00:00:00 2001 From: gwleuverink <17123491+gwleuverink@users.noreply.github.com> Date: Tue, 28 Oct 2025 22:00:15 +0000 Subject: [PATCH 02/10] Fix styling --- src/Alert.php | 2 +- src/App.php | 4 ++-- src/AutoUpdater.php | 2 +- src/ChildProcess.php | 2 +- src/Clipboard.php | 2 +- src/Dock.php | 4 ++-- src/Notification.php | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Alert.php b/src/Alert.php index a6e5da84..35d26fcd 100644 --- a/src/Alert.php +++ b/src/Alert.php @@ -2,8 +2,8 @@ namespace Native\Desktop; -use Native\Desktop\Client\Client; use Illuminate\Support\Traits\Conditionable; +use Native\Desktop\Client\Client; class Alert { diff --git a/src/App.php b/src/App.php index 65375795..7633e308 100644 --- a/src/App.php +++ b/src/App.php @@ -2,9 +2,9 @@ namespace Native\Desktop; -use Phar; -use Native\Desktop\Client\Client; use Illuminate\Support\Traits\Conditionable; +use Native\Desktop\Client\Client; +use Phar; class App { diff --git a/src/AutoUpdater.php b/src/AutoUpdater.php index 8b0885dc..a74bfb45 100644 --- a/src/AutoUpdater.php +++ b/src/AutoUpdater.php @@ -2,8 +2,8 @@ namespace Native\Desktop; -use Native\Desktop\Client\Client; use Illuminate\Support\Traits\Conditionable; +use Native\Desktop\Client\Client; class AutoUpdater { diff --git a/src/ChildProcess.php b/src/ChildProcess.php index b06bddaa..9c691b80 100644 --- a/src/ChildProcess.php +++ b/src/ChildProcess.php @@ -2,8 +2,8 @@ namespace Native\Desktop; -use Native\Desktop\Client\Client; use Illuminate\Support\Traits\Conditionable; +use Native\Desktop\Client\Client; use Native\Desktop\Contracts\ChildProcess as ChildProcessContract; class ChildProcess implements ChildProcessContract diff --git a/src/Clipboard.php b/src/Clipboard.php index 3a8a9a63..4e7d6dc8 100644 --- a/src/Clipboard.php +++ b/src/Clipboard.php @@ -2,8 +2,8 @@ namespace Native\Desktop; -use Native\Desktop\Client\Client; use Illuminate\Support\Traits\Conditionable; +use Native\Desktop\Client\Client; class Clipboard { diff --git a/src/Dock.php b/src/Dock.php index af0ff681..6ac67e05 100644 --- a/src/Dock.php +++ b/src/Dock.php @@ -2,9 +2,9 @@ namespace Native\Desktop; -use Native\Desktop\Menu\Menu; -use Native\Desktop\Client\Client; use Illuminate\Support\Traits\Conditionable; +use Native\Desktop\Client\Client; +use Native\Desktop\Menu\Menu; class Dock { diff --git a/src/Notification.php b/src/Notification.php index d989a869..f9a95a65 100644 --- a/src/Notification.php +++ b/src/Notification.php @@ -2,8 +2,8 @@ namespace Native\Desktop; -use Native\Desktop\Client\Client; use Illuminate\Support\Traits\Conditionable; +use Native\Desktop\Client\Client; class Notification { From 219b74cf2b21b565137a365fa4931a5bf3a9ec07 Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Tue, 28 Oct 2025 23:00:40 +0100 Subject: [PATCH 03/10] codestyle --- src/Alert.php | 2 +- src/App.php | 4 ++-- src/AutoUpdater.php | 2 +- src/ChildProcess.php | 2 +- src/Clipboard.php | 2 +- src/Dock.php | 4 ++-- src/Notification.php | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Alert.php b/src/Alert.php index a6e5da84..35d26fcd 100644 --- a/src/Alert.php +++ b/src/Alert.php @@ -2,8 +2,8 @@ namespace Native\Desktop; -use Native\Desktop\Client\Client; use Illuminate\Support\Traits\Conditionable; +use Native\Desktop\Client\Client; class Alert { diff --git a/src/App.php b/src/App.php index 65375795..7633e308 100644 --- a/src/App.php +++ b/src/App.php @@ -2,9 +2,9 @@ namespace Native\Desktop; -use Phar; -use Native\Desktop\Client\Client; use Illuminate\Support\Traits\Conditionable; +use Native\Desktop\Client\Client; +use Phar; class App { diff --git a/src/AutoUpdater.php b/src/AutoUpdater.php index 8b0885dc..a74bfb45 100644 --- a/src/AutoUpdater.php +++ b/src/AutoUpdater.php @@ -2,8 +2,8 @@ namespace Native\Desktop; -use Native\Desktop\Client\Client; use Illuminate\Support\Traits\Conditionable; +use Native\Desktop\Client\Client; class AutoUpdater { diff --git a/src/ChildProcess.php b/src/ChildProcess.php index b06bddaa..9c691b80 100644 --- a/src/ChildProcess.php +++ b/src/ChildProcess.php @@ -2,8 +2,8 @@ namespace Native\Desktop; -use Native\Desktop\Client\Client; use Illuminate\Support\Traits\Conditionable; +use Native\Desktop\Client\Client; use Native\Desktop\Contracts\ChildProcess as ChildProcessContract; class ChildProcess implements ChildProcessContract diff --git a/src/Clipboard.php b/src/Clipboard.php index 3a8a9a63..4e7d6dc8 100644 --- a/src/Clipboard.php +++ b/src/Clipboard.php @@ -2,8 +2,8 @@ namespace Native\Desktop; -use Native\Desktop\Client\Client; use Illuminate\Support\Traits\Conditionable; +use Native\Desktop\Client\Client; class Clipboard { diff --git a/src/Dock.php b/src/Dock.php index af0ff681..6ac67e05 100644 --- a/src/Dock.php +++ b/src/Dock.php @@ -2,9 +2,9 @@ namespace Native\Desktop; -use Native\Desktop\Menu\Menu; -use Native\Desktop\Client\Client; use Illuminate\Support\Traits\Conditionable; +use Native\Desktop\Client\Client; +use Native\Desktop\Menu\Menu; class Dock { diff --git a/src/Notification.php b/src/Notification.php index d989a869..f9a95a65 100644 --- a/src/Notification.php +++ b/src/Notification.php @@ -2,8 +2,8 @@ namespace Native\Desktop; -use Native\Desktop\Client\Client; use Illuminate\Support\Traits\Conditionable; +use Native\Desktop\Client\Client; class Notification { From 7b40c38bc786fc69b8890202e7f6966c30f71e42 Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Wed, 5 Nov 2025 14:28:16 +0100 Subject: [PATCH 04/10] make WindowManager conditionable --- src/Windows/Window.php | 2 ++ src/Windows/WindowManager.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Windows/Window.php b/src/Windows/Window.php index 133bb687..cfea9515 100644 --- a/src/Windows/Window.php +++ b/src/Windows/Window.php @@ -2,6 +2,7 @@ namespace Native\Desktop\Windows; +use Illuminate\Support\Traits\Conditionable; use Native\Desktop\Client\Client; use Native\Desktop\Concerns\HasDimensions; use Native\Desktop\Concerns\HasUrl; @@ -10,6 +11,7 @@ class Window { + use Conditionable; use HasDimensions; use HasUrl { HasUrl::url as defaultUrl; diff --git a/src/Windows/WindowManager.php b/src/Windows/WindowManager.php index ca2e80d9..5f2ac275 100644 --- a/src/Windows/WindowManager.php +++ b/src/Windows/WindowManager.php @@ -2,12 +2,14 @@ namespace Native\Desktop\Windows; +use Illuminate\Support\Traits\Conditionable; use Native\Desktop\Client\Client; use Native\Desktop\Concerns\DetectsWindowId; use Native\Desktop\Contracts\WindowManager as WindowManagerContract; class WindowManager implements WindowManagerContract { + use Conditionable; use DetectsWindowId; public function __construct(protected Client $client) {} From 89d0abe469c6920d2980804cd0e56092a8609300 Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Wed, 5 Nov 2025 14:29:06 +0100 Subject: [PATCH 05/10] make fakes conditionable too - so tests are predictable --- src/Fakes/ChildProcessFake.php | 3 +++ src/Fakes/WindowManagerFake.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Fakes/ChildProcessFake.php b/src/Fakes/ChildProcessFake.php index 324c0921..b850eb7b 100644 --- a/src/Fakes/ChildProcessFake.php +++ b/src/Fakes/ChildProcessFake.php @@ -3,11 +3,14 @@ namespace Native\Desktop\Fakes; use Closure; +use Illuminate\Support\Traits\Conditionable; use Native\Desktop\Contracts\ChildProcess as ChildProcessContract; use PHPUnit\Framework\Assert as PHPUnit; class ChildProcessFake implements ChildProcessContract { + use Conditionable; + /** * @var array */ diff --git a/src/Fakes/WindowManagerFake.php b/src/Fakes/WindowManagerFake.php index 0cb80edc..377d37fc 100644 --- a/src/Fakes/WindowManagerFake.php +++ b/src/Fakes/WindowManagerFake.php @@ -4,6 +4,7 @@ use Closure; use Illuminate\Support\Arr; +use Illuminate\Support\Traits\Conditionable; use Native\Desktop\Client\Client; use Native\Desktop\Contracts\WindowManager as WindowManagerContract; use Native\Desktop\Windows\Window; @@ -12,6 +13,8 @@ class WindowManagerFake implements WindowManagerContract { + use Conditionable; + public array $opened = []; public array $closed = []; From 800f055050d3428ab227c101819275fd464438aa Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Wed, 5 Nov 2025 14:30:30 +0100 Subject: [PATCH 06/10] add regression test so these classes stay conditionable in the future @PeteBishwhip --- tests/Architecture/ConditionableTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/Architecture/ConditionableTest.php diff --git a/tests/Architecture/ConditionableTest.php b/tests/Architecture/ConditionableTest.php new file mode 100644 index 00000000..1a6f6264 --- /dev/null +++ b/tests/Architecture/ConditionableTest.php @@ -0,0 +1,20 @@ +expect([ + Native\Desktop\Alert::class, + Native\Desktop\App::class, + Native\Desktop\AutoUpdater::class, + Native\Desktop\ChildProcess::class, + Native\Desktop\Clipboard::class, + Native\Desktop\Dock::class, + Native\Desktop\Menu\Menu::class, + Native\Desktop\Notification::class, + Native\Desktop\Windows\Window::class, + Native\Desktop\Windows\WindowManager::class, + + Native\Desktop\Fakes\ChildProcessFake::class, + Native\Desktop\Fakes\WindowManagerFake::class, + ])->each->toUseTrait(Conditionable::class); From 4af30ef2c761aaa22bfb061f33fb28572664f128 Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Wed, 5 Nov 2025 14:33:12 +0100 Subject: [PATCH 07/10] fix prefer-lowest test matrix --- tests/Architecture/ConditionableTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Architecture/ConditionableTest.php b/tests/Architecture/ConditionableTest.php index 1a6f6264..9cc86d36 100644 --- a/tests/Architecture/ConditionableTest.php +++ b/tests/Architecture/ConditionableTest.php @@ -2,7 +2,7 @@ use Illuminate\Support\Traits\Conditionable; -arch() +arch('ensure api is conditionable') ->expect([ Native\Desktop\Alert::class, Native\Desktop\App::class, From 41523234f5ff5994bdbefa5d338e9b2ee959962d Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Wed, 5 Nov 2025 15:22:16 +0100 Subject: [PATCH 08/10] test - only run architecture tests when pest has at least version 3 --- tests/Architecture/ConditionableTest.php | 45 ++++++++++++++++-------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/tests/Architecture/ConditionableTest.php b/tests/Architecture/ConditionableTest.php index 9cc86d36..f5c708fe 100644 --- a/tests/Architecture/ConditionableTest.php +++ b/tests/Architecture/ConditionableTest.php @@ -1,20 +1,35 @@ expect([ - Native\Desktop\Alert::class, - Native\Desktop\App::class, - Native\Desktop\AutoUpdater::class, - Native\Desktop\ChildProcess::class, - Native\Desktop\Clipboard::class, - Native\Desktop\Dock::class, - Native\Desktop\Menu\Menu::class, - Native\Desktop\Notification::class, - Native\Desktop\Windows\Window::class, - Native\Desktop\Windows\WindowManager::class, +describe('architecture', function () { - Native\Desktop\Fakes\ChildProcessFake::class, - Native\Desktop\Fakes\WindowManagerFake::class, - ])->each->toUseTrait(Conditionable::class); + arch('ensure api is conditionable') + ->expect([ + Desktop\App::class, + Desktop\Dock::class, + Desktop\Alert::class, + Desktop\Clipboard::class, + Desktop\AutoUpdater::class, + Desktop\ChildProcess::class, + Desktop\Notification::class, + Desktop\Menu\Menu::class, + Desktop\Windows\Window::class, + Desktop\Windows\WindowManager::class, + + Desktop\Fakes\ChildProcessFake::class, + Desktop\Fakes\WindowManagerFake::class, + ])->each->toUseTrait(Conditionable::class); + +})->skip(function () { + $version = Process::run('vendor/bin/pest --version')->throw()->output(); + + // Cleanup output + $version = preg_replace('/\e\[[0-9;]*m/', '', $version); + $version = trim(preg_replace('/[^\d.]/', '', $version)); + + // Only run test when pest version is at least 3 + return version_compare($version, '3.0.0', '<'); +}, 'Test not supporten on Pest < v3'); From 7ce670782663b55fb37b84654bcdc0f4ddaf6735 Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Wed, 5 Nov 2025 15:26:22 +0100 Subject: [PATCH 09/10] wip - fix CI --- tests/Architecture/ConditionableTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Architecture/ConditionableTest.php b/tests/Architecture/ConditionableTest.php index f5c708fe..5c517a5b 100644 --- a/tests/Architecture/ConditionableTest.php +++ b/tests/Architecture/ConditionableTest.php @@ -24,7 +24,7 @@ ])->each->toUseTrait(Conditionable::class); })->skip(function () { - $version = Process::run('vendor/bin/pest --version')->throw()->output(); + $version = Process::run('./vendor/bin/pest --version')->throw()->output(); // Cleanup output $version = preg_replace('/\e\[[0-9;]*m/', '', $version); From 1219b94051ad884d5b34e38f3d3dfbd210a3179b Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Wed, 5 Nov 2025 15:36:33 +0100 Subject: [PATCH 10/10] fix CI --- tests/Architecture/ConditionableTest.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/Architecture/ConditionableTest.php b/tests/Architecture/ConditionableTest.php index 5c517a5b..1102af2d 100644 --- a/tests/Architecture/ConditionableTest.php +++ b/tests/Architecture/ConditionableTest.php @@ -1,9 +1,10 @@ each->toUseTrait(Conditionable::class); })->skip(function () { - $version = Process::run('./vendor/bin/pest --version')->throw()->output(); - - // Cleanup output - $version = preg_replace('/\e\[[0-9;]*m/', '', $version); - $version = trim(preg_replace('/[^\d.]/', '', $version)); - // Only run test when pest version is at least 3 - return version_compare($version, '3.0.0', '<'); + return version_compare(version(), '3.0.0', '<'); }, 'Test not supporten on Pest < v3');