Code Duplication    Length = 11-13 lines in 3 locations

includes/class-wpinv-item.php 3 locations

@@ 198-210 (lines=13) @@
195
        return apply_filters( 'wpinv_get_item_price', $this->price, $this->ID );
196
    }
197
    
198
    public function get_vat_rule() {
199
        global $wpinv_euvat;
200
        
201
        if( !isset( $this->vat_rule ) ) {
202
            $this->vat_rule = get_post_meta( $this->ID, '_wpinv_vat_rule', true );
203
204
            if ( empty( $this->vat_rule ) ) {        
205
                $this->vat_rule = $wpinv_euvat->allow_vat_rules() ? 'digital' : 'physical';
206
            }
207
        }
208
        
209
        return apply_filters( 'wpinv_get_item_vat_rule', $this->vat_rule, $this->ID );
210
    }
211
    
212
    public function get_vat_class() {
213
        if( !isset( $this->vat_class ) ) {
@@ 212-222 (lines=11) @@
209
        return apply_filters( 'wpinv_get_item_vat_rule', $this->vat_rule, $this->ID );
210
    }
211
    
212
    public function get_vat_class() {
213
        if( !isset( $this->vat_class ) ) {
214
            $this->vat_class = get_post_meta( $this->ID, '_wpinv_vat_class', true );
215
216
            if ( empty( $this->vat_class ) ) {        
217
                $this->vat_class = '_standard';
218
            }
219
        }
220
        
221
        return apply_filters( 'wpinv_get_item_vat_class', $this->vat_class, $this->ID );
222
    }
223
224
    public function get_type() {
225
        if( ! isset( $this->type ) ) {
@@ 224-234 (lines=11) @@
221
        return apply_filters( 'wpinv_get_item_vat_class', $this->vat_class, $this->ID );
222
    }
223
224
    public function get_type() {
225
        if( ! isset( $this->type ) ) {
226
            $this->type = get_post_meta( $this->ID, '_wpinv_type', true );
227
228
            if ( empty( $this->type ) ) {
229
                $this->type = 'custom';
230
            }
231
        }
232
233
        return apply_filters( 'wpinv_get_item_type', $this->type, $this->ID );
234
    }
235
    
236
    public function get_custom_id() {
237
        $custom_id = get_post_meta( $this->ID, '_wpinv_custom_id', true );