registerErrorHandler($this->errorHandler); $this->registerExceptionHandler($this->exceptionHandler); $this->registerShutdownHandler($this->shutdownHandler); } /** * Create ExceptionHandlerManager with basic handlers for early registration * * This factory method creates a manager with minimal handlers that don't * require full dependencies. Useful for registering handlers before Discovery. */ public static function createWithBasicHandlers(): self { return new self( new BasicErrorHandler(), new BasicGlobalExceptionHandler(), new BasicShutdownHandler() ); } public function registerExceptionHandler(ExceptionHandler $handler): void { set_exception_handler($handler->handle(...)); } private function registerErrorHandler(ErrorHandlerInterface $handler): void { set_error_handler($handler->handle(...), E_ALL); } public function registerShutdownHandler(ShutdownHandlerInterface $handler): void { register_shutdown_function($handler->handle(...)); } }