query_runner; $tables = $shared->tables; $json_columns = new FixJsonColumns(); $presenter = new FixPresenter( $shared->iso_time ); $places = new FixPlaces( $query_runner, $tables ); $repository = new FixRepository( $query_runner, $tables, new FixRowMapper( $json_columns ), $json_columns ); $outcome_store = new LinkOutcomeStore( $query_runner, $tables, $shared->link_lookup ); $writer = new PostContentWriter( $this->content_rewriter( $shared ), $shared->post_link_sync, $shared->page_builders ); $runner = new FixRunner( new LinkFixer( $outcome_store, $places, $writer, $repository ), $repository, $shared->data_version ); $undoer = new FixUndoer( $writer, $outcome_store, $repository, $shared->data_version ); $this->feature = new FixesFeature( $shared->rest_routes, new CreateFixEndpoint( new FixRequestReader( $shared->address_rules ), new FixTargets( $query_runner, $tables, $shared->link_row_mapper ), $places, $repository, $runner, $presenter, $shared->clock ), new FixStepEndpoint( $runner, $repository, $presenter ), new FixStepEndpoint( $undoer, $repository, $presenter ), new ListFixesEndpoint( $repository, $presenter ), new RedirectServer( $query_runner, $tables, $shared->address_rules ) ); } private function content_rewriter( SharedServices $shared ): ContentRewriter { $address_match = $shared->address_match; $block_attributes = new BlockAttributes( $address_match ); return new ContentRewriter( new HtmlAddressReplacer( $address_match ), new BlockAddressReplacer( $block_attributes ), new AddressRemover( $address_match, $block_attributes ) ); } }