identifierType = $identifierType; $this->domain = $domain; $this->candidateProviders = array_values($candidateProviders); $this->confidence = max(0.0, min(1.0, $confidence)); $this->reasoning = array_values($reasoning); $this->evidence = array_values($evidence); $this->alternativeDomains = array_values($alternativeDomains); } public function getIdentifierType(): string { return $this->identifierType; } public function getDomain(): string { return $this->domain; } public function getCandidateProviders(): array { return $this->candidateProviders; } public function getConfidence(): float { return $this->confidence; } public function getReasoning(): array { return $this->reasoning; } public function getEvidence(): array { return $this->evidence; } public function getAlternativeDomains(): array { return $this->alternativeDomains; } public function toArray(): array { return [ 'identifier_type' => $this->identifierType, 'domain' => $this->domain, 'candidate_providers' => $this->candidateProviders, 'confidence' => $this->confidence, 'reasoning' => $this->reasoning, 'evidence' => array_map( static fn ($evidence): array => $evidence instanceof DomainEvidence ? $evidence->toArray() : (array) $evidence, $this->evidence ), 'alternative_domains' => $this->alternativeDomains, ]; } }