Files
FOSSBilling/src/library
Adam Daley d7f0ed20a5 Refactor HTTP helpers and centralize response handling (#3877)
* Refactor API request/response HTTP helpers

* Centralize exception and response handling

* Use ResponseEmitter in installer entrypoints

* Add HTTP ResponseFactory and refactor Box_App

* Extract route matching into HTTP matcher

* Fix route param parsing and remove UrlHelper

* Fix exception status code crash and clean up refactor leftovers

ApiResponseFactory::getStatusCode() required an int code, but
Throwable::getCode() can return a string (e.g. PDOException's SQLSTATE),
so any non-FOSSBilling exception with a non-integer code crashed API
error handling with a TypeError instead of returning a JSON error.
Numeric-string codes are normalized to int to preserve prior loose-
comparison behavior; non-numeric codes fall back to the default status.

Also removes now-dead ErrorPage::generatePage(), redundant manual
requires of ResponseEmitter (already covered by composer's classmap
autoload), and duplicate emitResponse() calls in exceptionHandler().
2026-07-02 22:20:10 +01:00
..