Code Duplication    Length = 14-14 lines in 2 locations

includes/class-give-donate-form.php 1 location

@@ 397-410 (lines=14) @@
394
	 *
395
	 * @return mixed
396
	 */
397
	public function __get( $key ) {
398
399
		if ( method_exists( $this, 'get_' . $key ) ) {
400
401
			return call_user_func( array( $this, 'get_' . $key ) );
402
403
		} else {
404
405
			/* translators: %s: property key */
406
			return new WP_Error( 'give-form-invalid-property', sprintf( esc_html__( 'Can\'t get property %s.', 'give' ), $key ) );
407
408
		}
409
410
	}
411
412
	/**
413
	 * Creates a donation form

includes/class-give-donor.php 1 location

@@ 290-303 (lines=14) @@
287
	 *
288
	 * @return mixed|\WP_Error
289
	 */
290
	public function __get( $key ) {
291
292
		if ( method_exists( $this, 'get_' . $key ) ) {
293
294
			return call_user_func( array( $this, 'get_' . $key ) );
295
296
		} else {
297
298
			/* translators: %s: property key */
299
			return new WP_Error( 'give-donor-invalid-property', sprintf( esc_html__( 'Can\'t get property %s.', 'give' ), $key ) );
300
301
		}
302
303
	}
304
305
	/**
306
	 * Creates a donor.