Code Duplication    Length = 14-15 lines in 2 locations

class.jetpack-sync-functions.php 1 location

@@ 17-30 (lines=14) @@
14
		return self::values( self::get_function_to_sync() );
15
	}
16
17
	static function sync_sometimes() {
18
		// Since there are option in the sync we know that things have changed.
19
		if ( ! empty ( self::$sync ) ) {
20
			return self::sync_all();
21
		}
22
23
		$values           = self::values( self::$functions );
24
		$check_sum        = self::get_check_sum( $values );
25
26
		if ( Jetpack_Options::get_option( 'options_check_sum' ) !== $check_sum ) {
27
			return self::sync_all( $values, $check_sum );
28
		}
29
		return array();
30
	}
31
32
	static function sync_all( $values = null, $check_sum = null ) {
33
		if ( is_null( $values ) ) {

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 ) ) {