Code Duplication    Length = 7-7 lines in 2 locations

includes/class-give-cache.php 2 locations

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