Code Duplication    Length = 7-7 lines in 2 locations

includes/class-give-cache.php 2 locations

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