Completed
Push — develop ( f29211...ed262e )
by Remco
10:29 queued 57s
created
classes/Subscriptions/SubscriptionsModule.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -79,15 +79,15 @@  discard block
 block discarded – undo
79 79
 	 * email notifications so users can cancel or renew their subscription.
80 80
 	 */
81 81
 	public function handle_subscription() {
82
-		if ( ! filter_has_var( INPUT_GET, 'subscription' ) ) {
82
+		if ( !filter_has_var( INPUT_GET, 'subscription' ) ) {
83 83
 			return;
84 84
 		}
85 85
 
86
-		if ( ! filter_has_var( INPUT_GET, 'action' ) ) {
86
+		if ( !filter_has_var( INPUT_GET, 'action' ) ) {
87 87
 			return;
88 88
 		}
89 89
 
90
-		if ( ! filter_has_var( INPUT_GET, 'key' ) ) {
90
+		if ( !filter_has_var( INPUT_GET, 'key' ) ) {
91 91
 			return;
92 92
 		}
93 93
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 		$key = filter_input( INPUT_GET, 'key', FILTER_SANITIZE_STRING );
100 100
 
101 101
 		// Check if subscription is valid.
102
-		if ( ! $subscription ) {
102
+		if ( !$subscription ) {
103 103
 			return;
104 104
 		}
105 105
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 				if ( Statuses::SUCCESS !== $subscription->get_status() ) {
129 129
 					$payment = $this->start_recurring( $subscription, $gateway, true );
130 130
 
131
-					if ( ! $gateway->has_error() ) {
131
+					if ( !$gateway->has_error() ) {
132 132
 						// Redirect.
133 133
 						$gateway->redirect( $payment );
134 134
 					}
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 			return;
158 158
 		}
159 159
 
160
-		if ( ! empty( $subscription->end_date ) && $subscription->end_date <= $subscription->next_payment ) {
160
+		if ( !empty( $subscription->end_date ) && $subscription->end_date <= $subscription->next_payment ) {
161 161
 			$subscription->next_payment = null;
162 162
 			$subscription->status       = Statuses::COMPLETED;
163 163
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 		$payment->start_date       = $start_date;
200 200
 		$payment->end_date         = $end_date;
201 201
 		$payment->recurring_type   = 'recurring';
202
-		$payment->recurring        = ! $renewal;
202
+		$payment->recurring        = !$renewal;
203 203
 
204 204
 		// Start payment.
205 205
 		$payment = Plugin::start_payment( $payment, $gateway );
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
 	 * @return array
243 243
 	 */
244 244
 	public function exclude_subscription_comment_notes( $clauses, $query ) {
245
-		$type = $query->query_vars['type'];
245
+		$type = $query->query_vars[ 'type' ];
246 246
 
247 247
 		// Ignore subscription notes comments if it's not specifically requested.
248 248
 		if ( 'subscription_note' !== $type ) {
249
-			$clauses['where'] .= " AND comment_type != 'subscription_note'";
249
+			$clauses[ 'where' ] .= " AND comment_type != 'subscription_note'";
250 250
 		}
251 251
 
252 252
 		return $clauses;
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 		// Check if there is already subscription attached to the payment.
273 273
 		$subscription_id = $payment->get_subscription_id();
274 274
 
275
-		if ( ! empty( $subscription_id ) ) {
275
+		if ( !empty( $subscription_id ) ) {
276 276
 			// Subscription already created.
277 277
 			return;
278 278
 		}
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 				delete_post_meta( $post->ID, '_pronamic_subscription_renewal_sent_1week' );
476 476
 			}
477 477
 
478
-			do_action( 'pronamic_subscription_renewal_notice_' . $subscription->get_source(), $subscription );
478
+			do_action( 'pronamic_subscription_renewal_notice_'.$subscription->get_source(), $subscription );
479 479
 
480 480
 			update_post_meta( $post->ID, '_pronamic_subscription_renewal_sent_1week', $start_date->format( DateTime::MYSQL ) );
481 481
 		}
Please login to merge, or discard this patch.