Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lochmueller committed Oct 27, 2024
1 parent 4bf87fc commit 915a253
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Classes/Middleware/GenerateMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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();

Check failure on line 98 in Classes/Middleware/GenerateMiddleware.php

View workflow job for this annotation

GitHub Actions / build (8.1, 12)

Call to method resolveLifetime() on an unknown class TYPO3\CMS\Core\Cache\CacheDataCollector.

Check failure on line 98 in Classes/Middleware/GenerateMiddleware.php

View workflow job for this annotation

GitHub Actions / build (8.2, 12)

Call to method resolveLifetime() on an unknown class TYPO3\CMS\Core\Cache\CacheDataCollector.

Check failure on line 98 in Classes/Middleware/GenerateMiddleware.php

View workflow job for this annotation

GitHub Actions / build (8.3, 12)

Call to method resolveLifetime() on an unknown class TYPO3\CMS\Core\Cache\CacheDataCollector.
}
Expand Down

0 comments on commit 915a253

Please sign in to comment.