Make dependency injection possible for errorPhpClassFQCN
Because TYPO3\CMS\Core\Site\Entity\Site::getErrorHandler() passes two arguments to the constructor of classes declared as errorPhpClassFQCN, dependency injection is not possible.
I guess, the solution should be to change the method PageErrorHandlerInterface::handlePageError() to accept the $statusCode and $errorHandlerConfiguration. Or add a new interface method for compatibility/deprecation reasons.
Additionally, a new method Site::getErrorHandlerConfiguration(int $status) could remove the binding of creating and configuring an errorPhpClassFQCN.
What are your thoughts? I'd also be happy to provide some code for this.