identifierType = $identifierType; $this->normalizedValue = $normalizedValue; $this->checksumValid = $checksumValid; $this->countryPrefix = $countryPrefix; $this->gs1Prefix = $gs1Prefix; $this->expectedDomains = array_values($expectedDomains); $this->confidence = max(0.0, min(1.0, $confidence)); $this->notes = array_values(array_unique($notes)); $this->convertedValue = $convertedValue; } public function getIdentifierType(): string { return $this->identifierType; } public function getNormalizedValue(): string { return $this->normalizedValue; } public function isChecksumValid(): ?bool { return $this->checksumValid; } public function getChecksumValidation(): ?bool { return $this->checksumValid; } public function getChecksumValid(): ?bool { return $this->checksumValid; } public function getCountryPrefix(): ?string { return $this->countryPrefix; } public function getGs1Prefix(): ?string { return $this->gs1Prefix; } public function getExpectedDomains(): array { return $this->expectedDomains; } public function getConfidence(): float { return $this->confidence; } public function getNotes(): array { return $this->notes; } public function getConvertedValue(): ?string { return $this->convertedValue; } public function toArray(): array { return [ 'identifier_type' => $this->identifierType, 'normalized_value' => $this->normalizedValue, 'checksum_valid' => $this->checksumValid, 'country_prefix' => $this->countryPrefix, 'gs1_prefix' => $this->gs1Prefix, 'expected_domains' => $this->expectedDomains, 'confidence' => $this->confidence, 'notes' => $this->notes, 'converted_value' => $this->convertedValue, ]; } }