Code Duplication    Length = 7-7 lines in 2 locations

includes/class-give-cache.php 2 locations

@@ 100-106 (lines=7) @@
97
	 */
98
99
	public static function get( $cache_key, $custom_key = false, $query_args = array() ) {
100
		if ( ! self::is_valid_cache_key( $cache_key ) ) {
101
			if ( ! $custom_key ) {
102
				return new WP_Error( 'give_invalid_cache_key', __( 'Cache key format should be give_cache_*', 'give' ) );
103
			}
104
105
			$cache_key = self::get_key( $cache_key, $query_args );
106
		}
107
108
		$option = get_option( $cache_key );
109
@@ 142-148 (lines=7) @@
139
	 */
140
141
	public static function set( $cache_key, $data, $expiration = null, $custom_key = false, $query_args = array() ) {
142
		if ( ! self::is_valid_cache_key( $cache_key ) ) {
143
			if ( ! $custom_key ) {
144
				return new WP_Error( 'give_invalid_cache_key', __( 'Cache key format should be give_cache_*', 'give' ) );
145
			}
146
147
			$cache_key = self::get_key( $cache_key, $query_args );
148
		}
149
150
		$option_value = array(
151
			'data'       => $data,