Code Duplication    Length = 11-13 lines in 3 locations

includes/class-wpinv-item.php 3 locations

@@ 179-191 (lines=13) @@
176
        return apply_filters( 'wpinv_get_the_item_price', $item_price, $this->ID );
177
    }
178
    
179
    public function get_vat_rule() {
180
        global $wpinv_euvat;
181
        
182
        if( !isset( $this->vat_rule ) ) {
183
            $this->vat_rule = get_post_meta( $this->ID, '_wpinv_vat_rule', true );
184
185
            if ( empty( $this->vat_rule ) ) {        
186
                $this->vat_rule = $wpinv_euvat->allow_vat_rules() ? 'digital' : 'physical';
187
            }
188
        }
189
        
190
        return apply_filters( 'wpinv_get_item_vat_rule', $this->vat_rule, $this->ID );
191
    }
192
    
193
    public function get_vat_class() {
194
        if( !isset( $this->vat_class ) ) {
@@ 193-203 (lines=11) @@
190
        return apply_filters( 'wpinv_get_item_vat_rule', $this->vat_rule, $this->ID );
191
    }
192
    
193
    public function get_vat_class() {
194
        if( !isset( $this->vat_class ) ) {
195
            $this->vat_class = get_post_meta( $this->ID, '_wpinv_vat_class', true );
196
197
            if ( empty( $this->vat_class ) ) {        
198
                $this->vat_class = '_standard';
199
            }
200
        }
201
        
202
        return apply_filters( 'wpinv_get_item_vat_class', $this->vat_class, $this->ID );
203
    }
204
205
    public function get_type() {
206
        if( ! isset( $this->type ) ) {
@@ 205-215 (lines=11) @@
202
        return apply_filters( 'wpinv_get_item_vat_class', $this->vat_class, $this->ID );
203
    }
204
205
    public function get_type() {
206
        if( ! isset( $this->type ) ) {
207
            $this->type = get_post_meta( $this->ID, '_wpinv_type', true );
208
209
            if ( empty( $this->type ) ) {
210
                $this->type = 'custom';
211
            }
212
        }
213
214
        return apply_filters( 'wpinv_get_item_type', $this->type, $this->ID );
215
    }
216
    
217
    public function get_custom_id() {
218
        $custom_id = get_post_meta( $this->ID, '_wpinv_custom_id', true );