Code Duplication    Length = 8-9 lines in 2 locations

includes/class-wc-order.php 2 locations

@@ 321-328 (lines=8) @@
318
     *
319
     * @return string
320
     */
321
    public function get_cancel_order_url( $redirect = '' ) {
322
        return apply_filters( 'woocommerce_get_cancel_order_url', wp_nonce_url( add_query_arg( array(
323
            'cancel_order' => 'true',
324
            'order'        => $this->get_order_key(),
325
            'order_id'     => $this->get_order_id(),
326
            'redirect'     => $redirect
327
        ), $this->get_cancel_endpoint() ), 'woocommerce-cancel_order' ) );
328
    }
329
330
    /**
331
     * Generates a raw (unescaped) cancel-order URL for use by payment gateways.
@@ 337-345 (lines=9) @@
334
     *
335
     * @return string The unescaped cancel-order URL.
336
     */
337
    public function get_cancel_order_url_raw( $redirect = '' ) {
338
        return apply_filters( 'woocommerce_get_cancel_order_url_raw', add_query_arg( array(
339
            'cancel_order' => 'true',
340
            'order'        => $this->get_order_key(),
341
            'order_id'     => $this->get_order_id(),
342
            'redirect'     => $redirect,
343
            '_wpnonce'     => wp_create_nonce( 'woocommerce-cancel_order' )
344
        ), $this->get_cancel_endpoint() ) );
345
    }
346
347
    /**
348
     * Helper method to return the cancel endpoint.