requested_link(); } public function highlight( string $content ): string { $link = $this->requested_link(); if ( null === $link ) { return $content; } $marked = $this->place_marker->mark( $content, $link->url, $this->place_label->of( $link->verdict ) ); if ( $this->is_anchored || $marked === $content ) { return $marked; } $this->is_anchored = true; return $this->place_marker->with_anchor( $marked ); } private function requested_link(): Link|null { if ( $this->is_resolved ) { return $this->link; } $link_id = $this->place_request->link_id(); $this->is_resolved = true; $this->link = self::NO_LINK === $link_id ? null : $this->link_lookup->find( $link_id ); return $this->link; } }