requestedURL !== $requestedURL) { $this->requestedURL = $requestedURL; $this->best = null; } if ($this->best === null || $score > $this->best->getScore()) { $this->best = ABJ_404_Solution_NearMissMatch::create($score, $engineName); } } /** * The best near miss recorded for this exact URL, or null when none was * recorded for it (automatic matching off, no candidate at all, or a * record that belongs to a different URL). * * @param string $requestedURL * @return ABJ_404_Solution_NearMissMatch|null */ public function getBestFor(string $requestedURL): ?ABJ_404_Solution_NearMissMatch { if ($this->requestedURL !== $requestedURL) { return null; } return $this->best; } /** * @param float $score * @return bool */ public static function isRecordableScore(float $score): bool { return $score > self::MIN_RECORDABLE_SCORE && $score <= self::MAX_RECORDABLE_SCORE; } }