Code Duplication    Length = 7-7 lines in 2 locations

includes/class-give-cache.php 2 locations

@@ 131-137 (lines=7) @@
128
	 */
129
130
	public static function get( $cache_key, $custom_key = false, $query_args = array() ) {
131
		if ( ! self::is_valid_cache_key( $cache_key ) ) {
132
			if ( ! $custom_key ) {
133
				return new WP_Error( 'give_invalid_cache_key', __( 'Cache key format should be give_cache_*', 'give' ) );
134
			}
135
136
			$cache_key = self::get_key( $cache_key, $query_args );
137
		}
138
139
		$option = get_option( $cache_key );
140
@@ 173-179 (lines=7) @@
170
	 */
171
172
	public static function set( $cache_key, $data, $expiration = null, $custom_key = false, $query_args = array() ) {
173
		if ( ! self::is_valid_cache_key( $cache_key ) ) {
174
			if ( ! $custom_key ) {
175
				return new WP_Error( 'give_invalid_cache_key', __( 'Cache key format should be give_cache_*', 'give' ) );
176
			}
177
178
			$cache_key = self::get_key( $cache_key, $query_args );
179
		}
180
181
		$option_value = array(
182
			'data'       => $data,