progress->state ) { return $fix; } $places_at_start = $fix->progress->places_handled(); $link_ids = array_slice( $fix->link_ids, $fix->progress->links_done, StepLimits::LINKS_PER_STEP ); foreach ( $link_ids as $link_id ) { $places_used = $fix->progress->places_handled() - $places_at_start; $places_left = StepLimits::POSTS_PER_STEP - $places_used; if ( $places_left < 1 ) { break; } $fix = $this->link_fixer->fix_part( $fix, $link_id, $places_left ); } $is_done = $fix->progress->links_done >= $fix->links_total(); $state = $is_done ? FixState::Done : FixState::Running; $stepped = $fix->with_progress( $fix->progress->with_state( $state ) ); $this->fix_repository->save_progress( $stepped ); $this->data_version->bump(); return $stepped; } }