fallbackLabel; $primaryLabel = is_string($primaryLabel) && trim($primaryLabel) !== '' ? trim($primaryLabel) : 'Unresolved reference'; $state = $descriptor->fallbackLabel !== null ? ReferenceResolutionState::PartiallyResolved : ReferenceResolutionState::Unresolved; return new ResolvedReference( referenceClass: $descriptor->referenceClass, rawIdentifier: $descriptor->rawIdentifier, primaryLabel: $primaryLabel, secondaryLabel: $descriptor->contextValue('secondary_label'), state: $state, stateLabel: null, linkTarget: null, technicalDetail: ReferenceTechnicalDetail::forIdentifier( fullId: $descriptor->rawIdentifier, sourceHint: is_string($descriptor->contextValue('source_hint')) ? $descriptor->contextValue('source_hint') : null, ), meta: [ 'state_description' => $descriptor->contextValue('state_description'), ], ); } }