File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -295,14 +295,14 @@ private function parseRules(array $shared_extensions = []): int
295295 $ rule |= ($ this ->getOption ('build-micro ' ) ? BUILD_TARGET_MICRO : BUILD_TARGET_NONE );
296296 $ rule |= ($ this ->getOption ('build-fpm ' ) ? BUILD_TARGET_FPM : BUILD_TARGET_NONE );
297297 $ embed = $ this ->getOption ('build-embed ' );
298- $ embed = $ embed === null ? true : $ embed ;
299- if (!$ embed && !empty ($ shared_extensions )) {
300- $ embed = true ;
301- }
298+ $ embed = match ($ embed ) {
299+ null => getenv ('SPC_CMD_VAR_PHP_EMBED_TYPE ' ) ?: 'static ' ,
300+ 'static ' => 'static ' ,
301+ 'shared ' => 'shared ' ,
302+ false => false ,
303+ default => throw new WrongUsageException ('Invalid --build-embed option, please use --build-embed[=static|shared] ' ),
304+ };
302305 if ($ embed ) {
303- if ($ embed === true ) {
304- $ embed = getenv ('SPC_CMD_VAR_PHP_EMBED_TYPE ' ) ?: 'static ' ;
305- }
306306 $ rule |= BUILD_TARGET_EMBED ;
307307 f_putenv ('SPC_CMD_VAR_PHP_EMBED_TYPE= ' . ($ embed === 'static ' ? 'static ' : 'shared ' ));
308308 }
You can’t perform that action at this time.
0 commit comments