Skip to content

Commit 9b67497

Browse files
committed
Fix PossiblyNullArrayOffset in Mapper::getFieldMap
Add explicit null check on the result of fixFieldName before using it as an array offset, satisfying Psalm's type narrowing requirements.
1 parent 56f26a8 commit 9b67497

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Mapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ public function getFieldMap(?string $property = null): array|FieldMapping|null
334334

335335
$property = $this->fixFieldName($property);
336336

337-
if (!isset($this->fieldMap[$property])) {
337+
if ($property === null || !isset($this->fieldMap[$property])) {
338338
return null;
339339
}
340340

0 commit comments

Comments
 (0)