mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-19 23:05:36 +08:00
Refactor exception handler to v3, use standard shell exitcode
This commit is contained in:
@@ -4,8 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace StaticPHP\Exception;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
|
||||
/**
|
||||
* Exception thrown for validation errors in SPC.
|
||||
*
|
||||
@@ -23,12 +21,6 @@ class ValidationException extends SPCException
|
||||
// init validation module
|
||||
if ($validation_module === null) {
|
||||
foreach ($this->getTrace() as $trace) {
|
||||
// Extension validate() => "Extension validator"
|
||||
if (is_a($trace['class'] ?? null, Extension::class, true) && $trace['function'] === 'validate') {
|
||||
$this->validation_module = 'Extension validator';
|
||||
break;
|
||||
}
|
||||
|
||||
// Other => "ClassName::functionName"
|
||||
$this->validation_module = [
|
||||
'class' => $trace['class'] ?? null,
|
||||
|
||||
Reference in New Issue
Block a user