Code Duplication    Length = 7-7 lines in 2 locations

includes/class-give-cache.php 2 locations

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