Skip to content

Commit 9435e73

Browse files
committed
[BUGFIX] Bring back support for random hash base in TYPO3 v12 (fix)
This commit resolve PHPStan errors caused by @phpstan-ignore-next-line ``` No error to ignore is reported on line 19. No error to ignore is reported on line 26. No error to ignore is reported on line 28. ```
1 parent 92359ba commit 9435e73

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Classes/EventListener/EnrichPageCacheIdentifierParametersEventListener.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@
1515
*/
1616
class EnrichPageCacheIdentifierParametersEventListener
1717
{
18-
/** @phpstan-ignore-next-line @todo Remove this comment when support for TYPO3 v12 is dropped */
1918
public function __invoke(BeforePageCacheIdentifierIsHashedEvent $beforePageCacheIdentifierIsHashedEvent): void
2019
{
2120
if (!RouteService::routeHasT3ApiResourceEnhancerQueryParam()) {
2221
return;
2322
}
2423

25-
/** @phpstan-ignore-next-line @todo Remove this comment when support for TYPO3 v12 is dropped */
2624
$beforePageCacheIdentifierIsHashedEvent->setPageCacheIdentifierParameters([
27-
/** @phpstan-ignore-next-line @todo Remove this comment when support for TYPO3 v12 is dropped */
2825
...$beforePageCacheIdentifierIsHashedEvent->getPageCacheIdentifierParameters(),
2926
't3api_hash_base_random' => microtime(),
3027
]);

phpstan.neon

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ parameters:
1111
- Classes
1212
- Configuration
1313
- Tests
14+
15+
ignoreErrors:
16+
# @todo This ignoreError can be removed when support for TYPO3 v12 is dropped
17+
- message: "#Parameter \\$beforePageCacheIdentifierIsHashedEvent of method SourceBroker\\\\T3api\\\\EventListener\\\\EnrichPageCacheIdentifierParametersEventListener::__invoke\\(\\) has invalid type TYPO3\\\\CMS\\\\Frontend\\\\Event\\\\BeforePageCacheIdentifierIsHashedEvent#"
18+
# @todo This ignoreError can be removed when support for TYPO3 v12 is dropped
19+
- message: "#Call to method setPageCacheIdentifierParameters\\(\\) on an unknown class TYPO3\\\\CMS\\\\Frontend\\\\Event\\\\BeforePageCacheIdentifierIsHashedEvent#"
20+
# @todo This ignoreError can be removed when support for TYPO3 v12 is dropped
21+
- message: "#Call to method getPageCacheIdentifierParameters\\(\\) on an unknown class TYPO3\\\\CMS\\\\Frontend\\\\Event\\\\BeforePageCacheIdentifierIsHashedEvent#"

0 commit comments

Comments
 (0)