checked_posts->ids_after( $state->last_read_post_id, $this->settings_store->load() ); if ( array() === $post_ids ) { $checking_state = $this->transitions->checking( $state ); $this->scan_state_store->save( $checking_state ); return self::NO_POSTS_READ; } foreach ( $post_ids as $post_id ) { $this->post_link_sync->sync( $post_id ); } $advanced_state = $this->transitions->advanced( $state, max( $post_ids ), count( $post_ids ) ); $this->scan_state_store->save( $advanced_state ); return count( $post_ids ); } }