Skip to content

Commit 69ffaba

Browse files
committed
[TASK] Add PHP 8.5 to version matrix on TYPO3 13
TYPO3 13 supports PHP 8.5 as well. Following changes are required for PHP 8.5: - Classes/Domain/Index/IndexService.php: - Add null check for $rootPageId before array offset access - Classes/Domain/Search/ResultSet/Facets/OptionBased/Hierarchy/HierarchyFacet.php: - Add null check for $parentKey before array offset access - Tests/Unit/GarbageCollectorTest.php: - Remove deprecated setAccessible(true) call (no effect since PHP 8.1)
1 parent 53ed7e5 commit 69ffaba

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/ci-matrix.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"release-13.1.x": {
3-
"PHP": [ "8.2", "8.3", "8.4" ],
3+
"PHP": [ "8.2", "8.3", "8.4", "8.5" ],
44
"TYPO3": [ "13" ,"13.4.x-dev" ]
55
}
66
}

Classes/Domain/Index/IndexService.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ protected function initializeHttpServerEnvironment(Item $item): void
237237
{
238238
static $hosts = [];
239239
$rootPageId = $item->getRootPageUid();
240+
if ($rootPageId === null) {
241+
return;
242+
}
243+
240244
$hostFound = !empty($hosts[$rootPageId]);
241245

242246
if (!$hostFound) {

Classes/Domain/Search/ResultSet/Facets/OptionBased/Hierarchy/HierarchyFacet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function createNode(
6565
bool $selected,
6666
): void {
6767
/** @var Node|null $parentNode */
68-
$parentNode = $this->nodesByKey[$parentKey] ?? null;
68+
$parentNode = $parentKey !== null ? ($this->nodesByKey[$parentKey] ?? null) : null;
6969
/** @var Node $node */
7070
$node = GeneralUtility::makeInstance(
7171
Node::class,

Tests/Unit/GarbageCollectorTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ public function processDatamap_preProcessFieldArrayStoresRecordData(): void
167167

168168
$objectReflection = new ReflectionObject($this->garbageCollector);
169169
$property = $objectReflection->getProperty('trackedRecords');
170-
$property->setAccessible(true);
171170
$trackedRecords = $property->getValue($this->garbageCollector);
172171

173172
self::assertEquals($dummyRecord, $trackedRecords['tx_foo_bar'][123]);

0 commit comments

Comments
 (0)