diff --git a/src/Framework/Environment.php b/src/Framework/Environment.php index 32932193..ada93e8d 100644 --- a/src/Framework/Environment.php +++ b/src/Framework/Environment.php @@ -111,16 +111,7 @@ public static function setupErrors(): void set_exception_handler([self::class, 'handleException']); - set_error_handler(static function (int $severity, string $message, string $file, int $line): ?bool { - if ( - in_array($severity, [E_RECOVERABLE_ERROR, E_USER_ERROR], true) - || ($severity & error_reporting()) === $severity - ) { -// self::handleException(new \ErrorException($message, 0, $severity, $file, $line)); - } - - return false; - }); + set_error_handler([self::class, 'foo']); /* register_shutdown_function(static function (): void { @@ -142,6 +133,18 @@ public static function setupErrors(): void });*/ } + public static function foo(int $severity, string $message, string $file, int $line): ?bool + { + if ( + in_array($severity, [E_RECOVERABLE_ERROR, E_USER_ERROR], true) + || ($severity & error_reporting()) === $severity + ) { +// self::handleException(new \ErrorException($message, 0, $severity, $file, $line)); + } + + return false; + } + /** * Creates global functions test(), testException(), setUp() and tearDown().