Code Duplication    Length = 10-12 lines in 2 locations

class.jetpack-options.php 1 location

@@ 130-139 (lines=10) @@
127
	 *
128
	 * @return mixed|void
129
	 */
130
	public static function get_option_and_ensure_autoload( $name, $default ) {
131
		$value = get_option( $name );
132
		
133
		if ( $value === false && $default !== false ) {
134
			update_option( $name, $default );
135
			$value = $default;
136
		}
137
138
		return $value;
139
	}
140
141
	private static function update_grouped_option( $group, $name, $value ) {
142
		$options = get_option( self::$grouped_options[ $group ] );

sync/class.jetpack-sync-module-full-sync.php 1 location

@@ 173-184 (lines=12) @@
170
		$listener->get_full_sync_queue()->reset();
171
	}
172
173
	private function get_status_option( $option, $default = null ) {
174
		$prefix = self::STATUS_OPTION_PREFIX;
175
176
		$value = get_option( "{$prefix}_{$option}", $default );
177
		
178
		if ( ! $value ) {
179
			// don't cast to int if we didn't find a value - we want to preserve null or false as sentinals
180
			return $default;
181
		}
182
183
		return intval( $value );
184
	}
185
186
	private function update_status_option( $name, $value ) {
187
		$prefix = self::STATUS_OPTION_PREFIX;