Current Behavior:
The codebase currently treats E_USER_ERROR as a stdErr() level option by internally calling PHP’s trigger_error() function. However, this approach is deprecated as of PHP 8.2. Since E_USER_ERROR is not actively used anywhere in the code, this behavior is unnecessary and should be removed.
Additionally, exception messages are currently converted and output to stderr without actually stopping script execution. This requires additional boilerplate logic to manually exit with code 1, making error handling less reliable and more cumbersome.
Expected Behavior:
Error handling should use proper exception handling mechanisms. An exception handler should be implemented, and all code that converts exception messages to stderr should be removed in favor of throwing and catching exceptions directly.
Additional Context:
Updating to modern exception handling will improve maintainability, make error tracking more reliable, and ensure compatibility with future PHP versions.
Current Behavior:
The codebase currently treats
E_USER_ERRORas astdErr()level option by internally calling PHP’strigger_error()function. However, this approach is deprecated as of PHP 8.2. SinceE_USER_ERRORis not actively used anywhere in the code, this behavior is unnecessary and should be removed.Additionally, exception messages are currently converted and output to stderr without actually stopping script execution. This requires additional boilerplate logic to manually exit with code 1, making error handling less reliable and more cumbersome.
Expected Behavior:
Error handling should use proper exception handling mechanisms. An exception handler should be implemented, and all code that converts exception messages to
stderrshould be removed in favor of throwing and catching exceptions directly.Additional Context:
Updating to modern exception handling will improve maintainability, make error tracking more reliable, and ensure compatibility with future PHP versions.