Skip to content

Commit 18bbfbb

Browse files
committed
x
1 parent c2586d8 commit 18bbfbb

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/Framework/Environment.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,7 @@ public static function setupErrors(): void
111111

112112
set_exception_handler([self::class, 'handleException']);
113113

114-
set_error_handler(static function (int $severity, string $message, string $file, int $line): ?bool {
115-
if (
116-
in_array($severity, [E_RECOVERABLE_ERROR, E_USER_ERROR], true)
117-
|| ($severity & error_reporting()) === $severity
118-
) {
119-
// self::handleException(new \ErrorException($message, 0, $severity, $file, $line));
120-
}
121-
122-
return false;
123-
});
114+
set_error_handler([self::class, 'foo']);
124115

125116
/*
126117
register_shutdown_function(static function (): void {
@@ -142,6 +133,18 @@ public static function setupErrors(): void
142133
});*/
143134
}
144135

136+
public static function foo(int $severity, string $message, string $file, int $line): ?bool
137+
{
138+
if (
139+
in_array($severity, [E_RECOVERABLE_ERROR, E_USER_ERROR], true)
140+
|| ($severity & error_reporting()) === $severity
141+
) {
142+
// self::handleException(new \ErrorException($message, 0, $severity, $file, $line));
143+
}
144+
145+
return false;
146+
}
147+
145148

146149
/**
147150
* Creates global functions test(), testException(), setUp() and tearDown().

0 commit comments

Comments
 (0)