Code Duplication    Length = 4-4 lines in 3 locations

includes/libraries/wpinv-euvat/class-wpinv-euvat.php 3 locations

@@ 752-755 (lines=4) @@
749
        $response = array();
750
        $response['success'] = false;
751
        
752
        if ( !current_user_can( 'manage_options' ) ) {
753
            $response['error'] = __( 'Invalid access!', 'invoicing' );
754
            wp_send_json( $response );
755
        }
756
        
757
        $vat_class_name = !empty( $_POST['name'] ) ? sanitize_text_field( $_POST['name'] ) : false;
758
        $vat_class_desc = !empty( $_POST['desc'] ) ? sanitize_text_field( $_POST['desc'] ) : false;
@@ 790-793 (lines=4) @@
787
        $response = array();
788
        $response['success'] = false;
789
        
790
        if ( !current_user_can( 'manage_options' ) || !isset( $_POST['class'] ) ) {
791
            $response['error'] = __( 'Invalid access!', 'invoicing' );
792
            wp_send_json( $response );
793
        }
794
        
795
        $vat_class = isset( $_POST['class'] ) && $_POST['class'] !== '' ? sanitize_text_field( $_POST['class'] ) : false;
796
        $vat_classes = (array)self::get_rate_classes();
@@ 825-828 (lines=4) @@
822
        $response['error']      = null;
823
        $response['data']       = null;
824
        
825
        if ( !current_user_can( 'manage_options' ) ) {
826
            $response['error'] = __( 'Invalid access!', 'invoicing' );
827
            wp_send_json( $response );
828
        }
829
        
830
        $group      = !empty( $_POST['group'] ) ? sanitize_text_field( $_POST['group'] ) : '';
831
        $euvatrates = self::request_euvatrates( $group );