Code Duplication    Length = 12-14 lines in 2 locations

projects/packages/sync/src/modules/class-full-sync-immediately.php 1 location

@@ 264-277 (lines=14) @@
261
	 *
262
	 * @return array Array of range (min ID, max ID, total items) for all content types.
263
	 */
264
	private function get_content_range() {
265
		$range  = array();
266
		$config = $this->get_status()['config'];
267
		// Add range only when syncing all objects.
268
		if ( true === isset( $config['posts'] ) && $config['posts'] ) {
269
			$range['posts'] = $this->get_range( 'posts' );
270
		}
271
272
		if ( true === isset( $config['comments'] ) && $config['comments'] ) {
273
			$range['comments'] = $this->get_range( 'comments' );
274
		}
275
276
		return $range;
277
	}
278
279
	/**
280
	 * Get the range (min ID, max ID and total items) of items to sync.

projects/packages/sync/src/modules/class-full-sync.php 1 location

@@ 354-365 (lines=12) @@
351
	 * @param array $config Full sync configuration for this all sync modules.
352
	 * @return array Array of range (min ID, max ID, total items) for all content types.
353
	 */
354
	private function get_content_range( $config ) {
355
		$range = array();
356
		// Only when we are sending the whole range do we want to send also the range.
357
		if ( true === isset( $config['posts'] ) && $config['posts'] ) {
358
			$range['posts'] = $this->get_range( 'posts' );
359
		}
360
361
		if ( true === isset( $config['comments'] ) && $config['comments'] ) {
362
			$range['comments'] = $this->get_range( 'comments' );
363
		}
364
		return $range;
365
	}
366
367
	/**
368
	 * Update the progress after sync modules actions have been processed on the server.