post_id_of( $url ); if ( self::NOT_FOUND === $post_id ) { return $this->http_probe->judge( $url ); } $is_trashed = self::TRASH_STATUS === get_post_status( $post_id ); return new Judgement( $is_trashed ? Reason::Trashed : Reason::Ok, null, null ); } private function post_id_of( string $url ): int { $post_id = url_to_postid( $url ); return self::NOT_FOUND === $post_id ? attachment_url_to_postid( $url ) : $post_id; } }