Explanation: Response headers are modified in handle_response().
Explanation: Response headers are modified in handle_response().
Explanation: Docs say avoid termination unless necessary.
Explanation: Middleware is backend processing, not UI.
Explanation: Middleware can modify both.
Explanation: Receives Request object.
Explanation: Receives Response object.
Explanation: Returning objects is mandatory.
Explanation: Security reasons like auth failure can stop execution.
Explanation: DB class provides PDO database connection.
Explanation: It returns the same PDO instance (singleton).