value : $state; return BadgeRenderer::spec(BadgeDomain::ReferenceResolutionState, $normalized); } public function description(ResolvedReference $reference, string $typeLabel): ?string { $description = $reference->meta['state_description'] ?? null; if (is_string($description) && trim($description) !== '') { return trim($description); } $subject = mb_strtolower($typeLabel); return match ($reference->state) { ReferenceResolutionState::Resolved => null, ReferenceResolutionState::PartiallyResolved => "Showing the best {$subject} label available from local context.", ReferenceResolutionState::Unresolved => "Only the preserved technical identifier is available for this {$subject}.", ReferenceResolutionState::DeletedOrMissing => "The referenced {$subject} is no longer available locally.", ReferenceResolutionState::Inaccessible => "The referenced {$subject} is not available in the current scope.", ReferenceResolutionState::ExternalLimitedContext => "This {$subject} comes from provider evidence and only limited cached context is available.", }; } }