-
-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Labels
Type: BugAn issue causing unintended or problematic behavior.An issue causing unintended or problematic behavior.
Description
Description
I have this Code snippet:
return [
'name' => t($field->getName(), true),
'format' => $field->getFieldType()
? DBFieldExportMapping::MAPPING[$field->getFieldType()->getInternCode()]
: ExportGenerator::FORMAT_TEXT,
];This results in this error:
error[possible-method-access-on-null]: Attempting to call a method on `null`.
┌─ system/src/Domain/Group/Export/GroupExportDataProvider.php:68:53
│
68 │ ? DBFieldExportMapping::MAPPING[$field->getFieldType()->getInternCode()]
│ ^^^^^^^^^^^^^^^^^^^^^^ This expression can be `null`
│
= Help: Use the nullsafe operator (`?->`) if `null` is an expected value.
$field->getFieldType() cannot be null because of the check before.
Metadata
Metadata
Assignees
Labels
Type: BugAn issue causing unintended or problematic behavior.An issue causing unintended or problematic behavior.