Code Duplication    Length = 7-13 lines in 2 locations

includes/wpinv-subscription.php 1 location

@@ 103-115 (lines=13) @@
100
	 *
101
	 * @since 1.0.0
102
	 */
103
	public function __get( $key ) {
104
105
		if( method_exists( $this, 'get_' . $key ) ) {
106
107
			return call_user_func( array( $this, 'get_' . $key ) );
108
109
		} else {
110
111
			return new WP_Error( 'wpinv-subscription-invalid-property', sprintf( __( 'Can\'t get property %s', 'invoicing' ), $key ) );
112
113
		}
114
115
	}
116
117
	/**
118
	 * Creates a subscription

includes/class-wpinv-item.php 1 location

@@ 81-87 (lines=7) @@
78
        return true;
79
    }
80
81
    public function __get( $key ) {
82
        if ( method_exists( $this, 'get_' . $key ) ) {
83
            return call_user_func( array( $this, 'get_' . $key ) );
84
        } else {
85
            return new WP_Error( 'wpinv-item-invalid-property', sprintf( __( 'Can\'t get property %s', 'invoicing' ), $key ) );
86
        }
87
    }
88
89
    public function create( $data = array(), $wp_error = false ) {
90
        if ( $this->ID != 0 ) {