Skip to content

Commit 8515857

Browse files
committed
fix: correct error handler callback signature in IntegrationValidator
Updated the dummy error handler in `checkHandlers()` to use a fully typed callable matching PHP's expected signature for `set_error_handler()` (int $errno, string $errstr, string $errfile, int $errline): bool. This resolves the PHPStan error: “Parameter #1 $callback of function set_error_handler expects (callable(int, string, string, int): bool)|null, Closure(): null given.” The handler now returns a boolean and no longer violates the callable contract.
1 parent d89f849 commit 8515857

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Core/IntegrationValidator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ public static function checkTimezone(): bool
8686
*/
8787
public static function checkHandlers(): bool
8888
{
89-
return is_callable(set_error_handler(fn () => null));
89+
$handler = static function (int $errno, string $errstr, string $errfile, int $errline): bool {
90+
return true;
91+
};
92+
93+
return is_callable(set_error_handler($handler));
9094
}
9195

9296
/**

0 commit comments

Comments
 (0)