From 719bde87b77e59316797e1fe62643d3007fbdcfb Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Tue, 1 Jul 2025 23:31:54 +0700 Subject: [PATCH] allow compilation with empty target --- src/SPC/util/SPCTarget.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/SPC/util/SPCTarget.php b/src/SPC/util/SPCTarget.php index 8dd640a0..f7d8372e 100644 --- a/src/SPC/util/SPCTarget.php +++ b/src/SPC/util/SPCTarget.php @@ -86,16 +86,13 @@ class SPCTarget */ public static function getTargetOS(): string { - $target = getenv('SPC_TARGET'); - if ($target === false) { - return PHP_OS_FAMILY; - } + $target = (string) getenv('SPC_TARGET'); return match (true) { str_contains($target, '-linux') => 'Linux', str_contains($target, '-macos') => 'Darwin', str_contains($target, '-windows') => 'Windows', str_contains($target, '-native') => PHP_OS_FAMILY, - default => throw new WrongUsageException('Cannot parse target.'), + default => PHP_OS_FAMILY, }; } }