Code Duplication    Length = 7-7 lines in 2 locations

includes/class-wpinv-item.php 1 location

@@ 65-71 (lines=7) @@
62
        return true;
63
    }
64
65
    public function __get( $key ) {
66
        if ( method_exists( $this, 'get_' . $key ) ) {
67
            return call_user_func( array( $this, 'get_' . $key ) );
68
        } else {
69
            return new WP_Error( 'wpinv-item-invalid-property', sprintf( __( 'Can\'t get property %s', 'invoicing' ), $key ) );
70
        }
71
    }
72
73
    public function create( $data = array(), $wp_error = false ) {
74
        if ( $this->ID != 0 ) {

includes/class-wpinv-subscription.php 1 location

@@ 74-80 (lines=7) @@
71
        return $this;
72
    }
73
74
    public function __get( $key ) {
75
        if ( method_exists( $this, 'get_' . $key ) ) {
76
            return call_user_func( array( $this, 'get_' . $key ) );
77
        } else {
78
            return new WP_Error( 'wpinv-subscription-invalid-property', sprintf( __( 'Can\'t get property %s', 'invoicing' ), $key ) );
79
        }
80
    }
81
82
    public function create( $data = array() ) {
83
        if ( $this->id != 0 ) {