1515use OCP \EventDispatcher \IEventDispatcher ;
1616use OCP \IRequest ;
1717use OCP \Server ;
18+ use OCP \Template \ITemplate ;
1819use Psr \Log \LoggerInterface ;
1920
2021class TemplateManager {
@@ -24,6 +25,9 @@ public function __construct(
2425 ) {
2526 }
2627
28+ /**
29+ * @param TemplateResponse::RENDER_AS_* $renderAs
30+ */
2731 public function getTemplate (string $ app , string $ name , string $ renderAs = TemplateResponse::RENDER_AS_BLANK , bool $ registerCall = true ): ITemplate {
2832 return new Template ($ app , $ name , $ renderAs , $ registerCall );
2933 }
@@ -105,7 +109,7 @@ public function printExceptionErrorPage(\Throwable $exception, int $statusCode =
105109 $ debug = false ;
106110 http_response_code ($ statusCode );
107111 try {
108- $ debug = Server::get (\OC \SystemConfig::class)->getValue ('debug ' , false );
112+ $ debug = ( bool ) Server::get (\OC \SystemConfig::class)->getValue ('debug ' , false );
109113 $ serverLogsDocumentation = Server::get (\OC \SystemConfig::class)->getValue ('documentation_url.server_logs ' , '' );
110114 $ request = Server::get (IRequest::class);
111115 $ content = new Template ('' , 'exception ' , 'error ' , false );
@@ -122,7 +126,7 @@ public function printExceptionErrorPage(\Throwable $exception, int $statusCode =
122126 $ content ->printPage ();
123127 } catch (\Exception $ e ) {
124128 try {
125- $ logger = \ OCP \ Server::get (LoggerInterface::class);
129+ $ logger = Server::get (LoggerInterface::class);
126130 $ logger ->error ($ exception ->getMessage (), ['app ' => 'core ' , 'exception ' => $ exception ]);
127131 $ logger ->error ($ e ->getMessage (), ['app ' => 'core ' , 'exception ' => $ e ]);
128132 } catch (\Throwable $ e ) {
0 commit comments