Passed
Push — develop ( b22d4f...d536a8 )
by Remco
07:23 queued 03:08
created
src/PaymentData.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 *
66 66
 	 * @param MeprTransaction $txn MemberPress transaction object.
67 67
 	 */
68
-	public function __construct( MeprTransaction $transaction ) {
68
+	public function __construct(MeprTransaction $transaction) {
69 69
 		parent::__construct();
70 70
 
71 71
 		$this->transaction  = $transaction;
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
 		$items = new Items();
130 130
 
131 131
 		$item = new Item();
132
-		$item->setNumber( $this->get_order_id() );
133
-		$item->setDescription( $this->get_description() );
134
-		$item->setPrice( $this->transaction->total );
135
-		$item->setQuantity( 1 );
132
+		$item->setNumber($this->get_order_id());
133
+		$item->setDescription($this->get_description());
134
+		$item->setPrice($this->transaction->total);
135
+		$item->setQuantity(1);
136 136
 
137
-		$items->addItem( $item );
137
+		$items->addItem($item);
138 138
 
139 139
 		return $items;
140 140
 	}
@@ -210,9 +210,9 @@  discard block
 block discarded – undo
210 210
 	 * @return string|null
211 211
 	 */
212 212
 	public function get_address() {
213
-		$value = $this->user->address( 'one', false );
213
+		$value = $this->user->address('one', false);
214 214
 
215
-		if ( false === $value ) {
215
+		if (false === $value) {
216 216
 			return null;
217 217
 		}
218 218
 
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
 	 * @return string|null
228 228
 	 */
229 229
 	public function get_city() {
230
-		$value = $this->user->address( 'city', false );
230
+		$value = $this->user->address('city', false);
231 231
 
232
-		if ( false === $value ) {
232
+		if (false === $value) {
233 233
 			return null;
234 234
 		}
235 235
 
@@ -244,9 +244,9 @@  discard block
 block discarded – undo
244 244
 	 * @return string|null
245 245
 	 */
246 246
 	public function get_zip() {
247
-		$value = $this->user->address( 'zip', false );
247
+		$value = $this->user->address('zip', false);
248 248
 
249
-		if ( false === $value ) {
249
+		if (false === $value) {
250 250
 			return null;
251 251
 		}
252 252
 
@@ -261,9 +261,9 @@  discard block
 block discarded – undo
261 261
 	 * @return string|null
262 262
 	 */
263 263
 	public function get_country() {
264
-		$value = $this->user->address( 'country', false );
264
+		$value = $this->user->address('country', false);
265 265
 
266
-		if ( false === $value ) {
266
+		if (false === $value) {
267 267
 			return null;
268 268
 		}
269 269
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 		$mepr_options = MeprOptions::fetch();
282 282
 
283 283
 		// @link https://gitlab.com/pronamic/memberpress/blob/1.2.4/app/models/MeprOptions.php#L768-782
284
-		return $mepr_options->thankyou_page_url( 'trans_num=' . $this->transaction->id );
284
+		return $mepr_options->thankyou_page_url('trans_num=' . $this->transaction->id);
285 285
 	}
286 286
 
287 287
 	/**
@@ -321,36 +321,36 @@  discard block
 block discarded – undo
321 321
 	public function get_subscription() {
322 322
 		$product = $this->transaction->product();
323 323
 
324
-		if ( $product->is_one_time_payment() ) {
324
+		if ($product->is_one_time_payment()) {
325 325
 			return false;
326 326
 		}
327 327
 
328 328
 		$mp_subscription = $this->transaction->subscription();
329 329
 
330
-		if ( ! $mp_subscription ) {
330
+		if ( ! $mp_subscription) {
331 331
 			return false;
332 332
 		}
333 333
 
334 334
 		$frequency = '';
335 335
 
336
-		if ( $mp_subscription->limit_cycles ) {
336
+		if ($mp_subscription->limit_cycles) {
337 337
 			$frequency = $mp_subscription->limit_cycles;
338 338
 		}
339 339
 
340 340
 		$subscription                  = new Subscription();
341 341
 		$subscription->frequency       = $frequency;
342 342
 		$subscription->interval        = $product->period;
343
-		$subscription->interval_period = Core_Util::to_period( $product->period_type );
343
+		$subscription->interval_period = Core_Util::to_period($product->period_type);
344 344
 		$subscription->description     = sprintf(
345 345
 			'Order #%s - %s',
346 346
 			$this->get_source_id(),
347 347
 			$this->get_description()
348 348
 		);
349 349
 
350
-		$subscription->set_amount( new Money(
350
+		$subscription->set_amount(new Money(
351 351
 			$this->transaction->total,
352 352
 			$this->get_currency_alphabetic_code()
353
-		) );
353
+		));
354 354
 
355 355
 		return $subscription;
356 356
 	}
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 	public function get_subscription_source_id() {
365 365
 		$subscription = $this->get_subscription();
366 366
 
367
-		if ( ! $subscription ) {
367
+		if ( ! $subscription) {
368 368
 			return false;
369 369
 		}
370 370
 
Please login to merge, or discard this patch.