|WP_Error */ public function recheck( mixed $requested_id ): array|WP_Error { $link_id = is_numeric( $requested_id ) ? (int) $requested_id : self::MISSING_LINK_ID; $link = $this->link_lookup->find( $link_id ); if ( null === $link ) { return $this->not_found(); } $this->link_checker->check( $link ); return $this->present_current( $link_id ); } /** @return array|WP_Error */ private function present_current( int $link_id ): array|WP_Error { $checked_link = $this->link_lookup->find( $link_id ); if ( null === $checked_link ) { return $this->not_found(); } return $this->link_detail_presenter->present( $checked_link ); } private function not_found(): WP_Error { return new WP_Error( self::NOT_FOUND_CODE, __( 'This link does not exist any more.', 'aiplaz-link-checkup' ), array( 'status' => self::NOT_FOUND_STATUS ) ); } }