Code Duplication    Length = 7-7 lines in 2 locations

includes/class-give-cache.php 2 locations

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