mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-05 07:45:39 +08:00
Enhance exception handling by binding builder and extra info to ExceptionHandler
This commit is contained in:
@@ -8,6 +8,7 @@ use SPC\builder\freebsd\BSDBuilder;
|
||||
use SPC\builder\linux\LinuxBuilder;
|
||||
use SPC\builder\macos\MacOSBuilder;
|
||||
use SPC\builder\windows\WindowsBuilder;
|
||||
use SPC\exception\ExceptionHandler;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
|
||||
@@ -29,6 +30,10 @@ class BuilderProvider
|
||||
'BSD' => new BSDBuilder($input->getOptions()),
|
||||
default => throw new WrongUsageException('Current OS "' . PHP_OS_FAMILY . '" is not supported yet'),
|
||||
};
|
||||
|
||||
// bind the builder to ExceptionHandler
|
||||
ExceptionHandler::$bind_builder = self::$builder;
|
||||
|
||||
return self::$builder;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user