Code Duplication    Length = 14-15 lines in 2 locations

class.jetpack-sync-options.php 1 location

@@ 47-61 (lines=15) @@
44
		return self::values( self::get_options_to_sync() );
45
	}
46
47
	static function sync_sometimes() {
48
49
		// Since there are option in the sync we know that things have changed.
50
		if( ! empty ( self::$sync ) ) {
51
			return self::sync_all();
52
		}
53
54
		$values           = self::values( self::$options );
55
		$check_sum        = self::get_check_sum( $values );
56
57
		if ( Jetpack_Options::get_option( 'options_check_sum' ) !== $check_sum ) {
58
			return self::sync_all( $values, $check_sum );
59
		}
60
		return null;
61
	}
62
63
	static function sync_all( $values = null, $check_sum = null ) {
64
		if ( is_null( $values ) ) {

class.jetpack-sync-functions.php 1 location

@@ 40-53 (lines=14) @@
37
		self::$sync[] = $key;
38
	}
39
40
	static function sync_sometimes() {
41
		// Since there are option in the sync we know that things have changed.
42
		if ( ! empty ( self::$sync ) ) {
43
			return self::sync_all();
44
		}
45
46
		$values    = self::values( self::$functions );
47
		$check_sum = self::get_check_sum( $values );
48
49
		if ( Jetpack_Options::get_option( 'function_check_sum' ) !== $check_sum ) {
50
			return self::sync_all( $values, $check_sum );
51
		}
52
53
		return array();
54
	}
55
56
	static function sync_all( $values = null, $check_sum = null ) {