2020class PrepareMiddleware implements MiddlewareInterface
2121{
2222 public function __construct (
23- protected EventDispatcherInterface $ eventDispatcher ,
24- protected HttpPushService $ httpPushService
23+ protected readonly EventDispatcherInterface $ eventDispatcher ,
24+ protected readonly HttpPushService $ httpPushService ,
25+ protected readonly ConfigurationService $ configurationService ,
26+ protected readonly TypoScriptFrontendService $ typoScriptFrontendService ,
27+ protected readonly InlineAssetsService $ inlineAssetsService
2528 ) {}
2629
2730 /**
@@ -42,9 +45,8 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
4245 $ this ->eventDispatcher ->dispatch ($ event );
4346
4447 if (!$ event ->isSkipProcessing ()) {
45- $ cacheTags = GeneralUtility::makeInstance (TypoScriptFrontendService::class)->getTags ();
46- $ configuration = GeneralUtility::makeInstance (ConfigurationService::class);
47- if (false === (bool ) $ configuration ->get ('clearCacheForAllDomains ' )) {
48+ $ cacheTags = $ this ->typoScriptFrontendService ->getTags ();
49+ if (false === $ this ->configurationService ->isBool ('clearCacheForAllDomains ' )) {
4850 $ cacheTags [] = 'sfc_domain_ ' . str_replace ('. ' , '_ ' , $ event ->getRequest ()->getUri ()->getHost ());
4951 }
5052
@@ -63,7 +65,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
6365 }
6466 }
6567
66- $ processedHtml = (string ) GeneralUtility:: makeInstance (InlineAssetsService::class) ->replaceInlineContent ((string ) $ response ->getBody ());
68+ $ processedHtml = (string ) $ this -> inlineAssetsService ->replaceInlineContent ((string ) $ response ->getBody ());
6769 $ responseBody = new Stream ('php://temp ' , 'rw ' );
6870 $ responseBody ->write ($ processedHtml );
6971 $ response = $ response ->withBody ($ responseBody );
0 commit comments