Passed
Push — master ( 7cd2a4...d60565 )
by Brian
04:57
created
includes/gateways/class-getpaid-manual-gateway.php 2 patches
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -13,30 +13,30 @@  discard block
 block discarded – undo
13 13
 class GetPaid_Manual_Gateway extends GetPaid_Payment_Gateway {
14 14
 
15 15
     /**
16
-	 * Payment method id.
17
-	 *
18
-	 * @var string
19
-	 */
16
+     * Payment method id.
17
+     *
18
+     * @var string
19
+     */
20 20
     public $id = 'manual';
21 21
 
22 22
     /**
23
-	 * An array of features that this gateway supports.
24
-	 *
25
-	 * @var array
26
-	 */
23
+     * An array of features that this gateway supports.
24
+     *
25
+     * @var array
26
+     */
27 27
     protected $supports = array( 'subscription', 'addons' );
28 28
 
29 29
     /**
30
-	 * Payment method order.
31
-	 *
32
-	 * @var int
33
-	 */
34
-	public $order = 11;
30
+     * Payment method order.
31
+     *
32
+     * @var int
33
+     */
34
+    public $order = 11;
35 35
 
36 36
     /**
37
-	 * Class constructor.
38
-	 */
39
-	public function __construct() {
37
+     * Class constructor.
38
+     */
39
+    public function __construct() {
40 40
         parent::__construct();
41 41
 
42 42
         $this->title        = __( 'Test Gateway', 'invoicing' );
@@ -46,15 +46,15 @@  discard block
 block discarded – undo
46 46
     }
47 47
 
48 48
     /**
49
-	 * Process Payment.
50
-	 *
51
-	 *
52
-	 * @param WPInv_Invoice $invoice Invoice.
53
-	 * @param array $submission_data Posted checkout fields.
54
-	 * @param GetPaid_Payment_Form_Submission $submission Checkout submission.
55
-	 * @return array
56
-	 */
57
-	public function process_payment( $invoice, $submission_data, $submission ) {
49
+     * Process Payment.
50
+     *
51
+     *
52
+     * @param WPInv_Invoice $invoice Invoice.
53
+     * @param array $submission_data Posted checkout fields.
54
+     * @param GetPaid_Payment_Form_Submission $submission Checkout submission.
55
+     * @return array
56
+     */
57
+    public function process_payment( $invoice, $submission_data, $submission ) {
58 58
 
59 59
         // Mark it as paid.
60 60
         $invoice->mark_paid();
@@ -68,13 +68,13 @@  discard block
 block discarded – undo
68 68
     }
69 69
 
70 70
     /**
71
-	 * (Maybe) renews a manual subscription profile.
72
-	 *
73
-	 *
74
-	 * @param bool $should_expire
71
+     * (Maybe) renews a manual subscription profile.
72
+     *
73
+     *
74
+     * @param bool $should_expire
75 75
      * @param WPInv_Subscription $subscription
76
-	 */
77
-	public function maybe_renew_subscription( $should_expire, $subscription ) {
76
+     */
77
+    public function maybe_renew_subscription( $should_expire, $subscription ) {
78 78
 
79 79
         // Ensure its our subscription && it's active.
80 80
         if ( 'manual' != $subscription->get_gateway() || ! $subscription->has_status( 'active trialling' ) ) {
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
     }
103 103
 
104 104
     /**
105
-	 * Processes invoice addons.
106
-	 *
107
-	 * @param WPInv_Invoice $invoice
108
-	 * @param GetPaid_Form_Item[] $items
109
-	 * @return WPInv_Invoice
110
-	 */
111
-	public function process_addons( $invoice, $items ) {
105
+     * Processes invoice addons.
106
+     *
107
+     * @param WPInv_Invoice $invoice
108
+     * @param GetPaid_Form_Item[] $items
109
+     * @return WPInv_Invoice
110
+     */
111
+    public function process_addons( $invoice, $items ) {
112 112
 
113 113
         foreach ( $items as $item ) {
114 114
             $invoice->add_item( $item );
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  *
5 5
  */
6 6
 
7
-defined( 'ABSPATH' ) || exit;
7
+defined('ABSPATH') || exit;
8 8
 
9 9
 /**
10 10
  * Manual Payment Gateway class.
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	 *
25 25
 	 * @var array
26 26
 	 */
27
-    protected $supports = array( 'subscription', 'addons' );
27
+    protected $supports = array('subscription', 'addons');
28 28
 
29 29
     /**
30 30
 	 * Payment method order.
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
 	public function __construct() {
40 40
         parent::__construct();
41 41
 
42
-        $this->title        = __( 'Test Gateway', 'invoicing' );
43
-        $this->method_title = __( 'Test Gateway', 'invoicing' );
42
+        $this->title        = __('Test Gateway', 'invoicing');
43
+        $this->method_title = __('Test Gateway', 'invoicing');
44 44
 
45
-        add_filter( 'getpaid_daily_maintenance_should_expire_subscription', array( $this, 'maybe_renew_subscription' ), 10, 2 );
45
+        add_filter('getpaid_daily_maintenance_should_expire_subscription', array($this, 'maybe_renew_subscription'), 10, 2);
46 46
     }
47 47
 
48 48
     /**
@@ -54,16 +54,16 @@  discard block
 block discarded – undo
54 54
 	 * @param GetPaid_Payment_Form_Submission $submission Checkout submission.
55 55
 	 * @return array
56 56
 	 */
57
-	public function process_payment( $invoice, $submission_data, $submission ) {
57
+	public function process_payment($invoice, $submission_data, $submission) {
58 58
 
59 59
         // Mark it as paid.
60 60
         $invoice->mark_paid();
61 61
 
62 62
         // (Maybe) activate subscription.
63
-        getpaid_activate_invoice_subscription( $invoice );
63
+        getpaid_activate_invoice_subscription($invoice);
64 64
 
65 65
         // Send to the success page.
66
-        wpinv_send_to_success_page( array( 'invoice_key' => $invoice->get_key() ) );
66
+        wpinv_send_to_success_page(array('invoice_key' => $invoice->get_key()));
67 67
 
68 68
     }
69 69
 
@@ -74,15 +74,15 @@  discard block
 block discarded – undo
74 74
 	 * @param bool $should_expire
75 75
      * @param WPInv_Subscription $subscription
76 76
 	 */
77
-	public function maybe_renew_subscription( $should_expire, $subscription ) {
77
+	public function maybe_renew_subscription($should_expire, $subscription) {
78 78
 
79 79
         // Ensure its our subscription && it's active.
80
-        if ( 'manual' != $subscription->get_gateway() || ! $subscription->has_status( 'active trialling' ) ) {
80
+        if ('manual' != $subscription->get_gateway() || !$subscription->has_status('active trialling')) {
81 81
             return $should_expire;
82 82
         }
83 83
 
84 84
         // If this is the last renewal, complete the subscription.
85
-        if ( $subscription->is_last_renewal() ) {
85
+        if ($subscription->is_last_renewal()) {
86 86
             $subscription->complete();
87 87
             return false;
88 88
         }
@@ -108,10 +108,10 @@  discard block
 block discarded – undo
108 108
 	 * @param GetPaid_Form_Item[] $items
109 109
 	 * @return WPInv_Invoice
110 110
 	 */
111
-	public function process_addons( $invoice, $items ) {
111
+	public function process_addons($invoice, $items) {
112 112
 
113
-        foreach ( $items as $item ) {
114
-            $invoice->add_item( $item );
113
+        foreach ($items as $item) {
114
+            $invoice->add_item($item);
115 115
         }
116 116
 
117 117
         $invoice->recalculate_total();
Please login to merge, or discard this patch.