Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 5, 2023
1 parent c2586d8 commit 18bbfbb
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/Framework/Environment.php
Expand Up @@ -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 {
Expand All @@ -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().
Expand Down

0 comments on commit 18bbfbb

Please sign in to comment.