Code Duplication    Length = 11-12 lines in 2 locations

admin_pages/payments/Payments_Admin_Page.core.php 2 locations

@@ 741-752 (lines=12) @@
738
     *
739
     * @global WP_User $current_user
740
     */
741
    protected function _activate_payment_method()
742
    {
743
        if (isset($this->_req_data['payment_method_type'])) {
744
            $payment_method_type = sanitize_text_field($this->_req_data['payment_method_type']);
745
            // see if one exists
746
            EE_Registry::instance()->load_lib('Payment_Method_Manager');
747
            $payment_method = EE_Payment_Method_Manager::instance()
748
                                                       ->activate_a_payment_method_of_type($payment_method_type);
749
            $this->_redirect_after_action(
750
                1,
751
                'Payment Method',
752
                'activated',
753
                array('action' => 'default', 'payment_method' => $payment_method->slug())
754
            );
755
        } else {
@@ 764-774 (lines=11) @@
761
    /**
762
     * Deactivates the payment method with the specified slug, and redirects.
763
     */
764
    protected function _deactivate_payment_method()
765
    {
766
        if (isset($this->_req_data['payment_method'])) {
767
            $payment_method_slug = sanitize_key($this->_req_data['payment_method']);
768
            // deactivate it
769
            EE_Registry::instance()->load_lib('Payment_Method_Manager');
770
            $count_updated = EE_Payment_Method_Manager::instance()->deactivate_payment_method($payment_method_slug);
771
            $this->_redirect_after_action(
772
                $count_updated,
773
                'Payment Method',
774
                'deactivated',
775
                array('action' => 'default', 'payment_method' => $payment_method_slug)
776
            );
777
        } else {