From 915a2533f3ef0a520a41132cd810f78458f6ae04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Lochm=C3=BCller?= Date: Sun, 27 Oct 2024 21:32:58 +0100 Subject: [PATCH] Cleanup --- Classes/Middleware/GenerateMiddleware.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Classes/Middleware/GenerateMiddleware.php b/Classes/Middleware/GenerateMiddleware.php index 80be74dec24..269479cdf09 100644 --- a/Classes/Middleware/GenerateMiddleware.php +++ b/Classes/Middleware/GenerateMiddleware.php @@ -6,6 +6,7 @@ use Psr\Http\Message\RequestInterface; use TYPO3\CMS\Backend\Utility\BackendUtility; +use TYPO3\CMS\Core\Cache\CacheDataCollector; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Context\Context; use Psr\EventDispatcher\EventDispatcherInterface; @@ -18,6 +19,7 @@ use SFC\Staticfilecache\Service\ConfigurationService; use SFC\Staticfilecache\Service\CookieService; use SFC\Staticfilecache\Service\DateTimeService; +use TYPO3\CMS\Core\Http\ServerRequest; use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; @@ -87,10 +89,11 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface */ protected function calculateLifetime(RequestInterface $request, ResponseInterface $response, TypoScriptFrontendController $tsfe): int { - /** @var $request \TYPO3\CMS\Core\Http\ServerRequest */ if ($this->typo3Version->getMajorVersion() >= 13) { - /** @var \TYPO3\CMS\Core\Cache\CacheDataCollector $frontendCacheCollector */ + /** @var ServerRequest $request */ + /** @var CacheDataCollector $frontendCacheCollector */ + /* @phpstan-ignore-next-line */ $frontendCacheCollector = $request->getAttribute('frontend.cache.collector'); return $frontendCacheCollector->resolveLifetime(); }