mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-05 15:55:39 +08:00
Refactor patching logic for Alpine Linux and macOS in attr.php
This commit is contained in:
@@ -320,17 +320,6 @@ function get_display_path(string $path): string
|
||||
throw new WrongUsageException("Cannot convert path: {$path}");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the global DI container instance.
|
||||
*
|
||||
* @deprecated Use ApplicationContext::getContainer() or dependency injection instead.
|
||||
* This function is kept for backward compatibility during the migration period.
|
||||
*/
|
||||
function spc_container(): DI\Container
|
||||
{
|
||||
return \StaticPHP\DI\ApplicationContext::getContainer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Skip the current operation if the condition is true.
|
||||
* You should ALWAYS use this function inside an attribute callback.
|
||||
@@ -345,6 +334,18 @@ function spc_skip_if(bool $condition, string $message = ''): void
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Skip the current operation unless the condition is true.
|
||||
* You should ALWAYS use this function inside an attribute callback.
|
||||
*
|
||||
* @param bool $condition Condition to evaluate
|
||||
* @param string $message Optional message for the skip exception
|
||||
*/
|
||||
function spc_skip_unless(bool $condition, string $message = ''): void
|
||||
{
|
||||
spc_skip_if(!$condition, $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse extension list from string, replace alias and filter internal extensions.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user