Code Duplication    Length = 7-7 lines in 2 locations

includes/class-give-cache.php 2 locations

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