Passed
Push — develop ( 04c4f1...d1cf82 )
by Remco
07:05
created
classes/Payments/Payment.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -345,15 +345,15 @@  discard block
 block discarded – undo
345 345
 	 *
346 346
 	 * @param int $post_id A payment post ID or null.
347 347
 	 */
348
-	public function __construct( $post_id = null ) {
348
+	public function __construct($post_id = null) {
349 349
 		$this->id   = $post_id;
350 350
 		$this->date = new \DateTime();
351 351
 		$this->meta = array();
352 352
 
353
-		if ( null !== $post_id ) {
353
+		if (null !== $post_id) {
354 354
 			global $pronamic_ideal;
355 355
 
356
-			$pronamic_ideal->payments_data_store->read( $this );
356
+			$pronamic_ideal->payments_data_store->read($this);
357 357
 		}
358 358
 	}
359 359
 
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 	 *
372 372
 	 * @param string $id Unique ID.
373 373
 	 */
374
-	public function set_id( $id ) {
374
+	public function set_id($id) {
375 375
 		$this->id = $id;
376 376
 	}
377 377
 
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 	 *
381 381
 	 * @param string $note The note to add.
382 382
 	 */
383
-	public function add_note( $note ) {
383
+	public function add_note($note) {
384 384
 		$commentdata = array(
385 385
 			'comment_post_ID'      => $this->id,
386 386
 			'comment_author'       => 'admin',
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 			'comment_approved'     => 1,
394 394
 		);
395 395
 
396
-		$comment_id = wp_insert_comment( $commentdata );
396
+		$comment_id = wp_insert_comment($commentdata);
397 397
 
398 398
 		return $comment_id;
399 399
 	}
@@ -424,8 +424,8 @@  discard block
 block discarded – undo
424 424
 	public function get_source_text() {
425 425
 		$text = $this->get_source() . '<br />' . $this->get_source_id();
426 426
 
427
-		$text = apply_filters( 'pronamic_payment_source_text_' . $this->get_source(), $text, $this );
428
-		$text = apply_filters( 'pronamic_payment_source_text', $text, $this );
427
+		$text = apply_filters('pronamic_payment_source_text_' . $this->get_source(), $text, $this);
428
+		$text = apply_filters('pronamic_payment_source_text', $text, $this);
429 429
 
430 430
 		return $text;
431 431
 	}
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 	 * @return string|null
464 464
 	 */
465 465
 	public function get_currency_numeric_code() {
466
-		return Currency::transform_code_to_number( $this->get_currency() );
466
+		return Currency::transform_code_to_number($this->get_currency());
467 467
 	}
468 468
 
469 469
 	/**
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 	 *
518 518
 	 * @param string $transaction_id Transaction ID.
519 519
 	 */
520
-	public function set_transaction_id( $transaction_id ) {
520
+	public function set_transaction_id($transaction_id) {
521 521
 		$this->transaction_id = $transaction_id;
522 522
 	}
523 523
 
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 	 *
546 546
 	 * @param string $status Status.
547 547
 	 */
548
-	public function set_status( $status ) {
548
+	public function set_status($status) {
549 549
 		$this->status = $status;
550 550
 	}
551 551
 
@@ -555,10 +555,10 @@  discard block
 block discarded – undo
555 555
 	 * @param string $key Meta key.
556 556
 	 * @return mixed
557 557
 	 */
558
-	public function get_meta( $key ) {
558
+	public function get_meta($key) {
559 559
 		$key = '_pronamic_payment_' . $key;
560 560
 
561
-		return get_post_meta( $this->id, $key, true );
561
+		return get_post_meta($this->id, $key, true);
562 562
 	}
563 563
 
564 564
 	/**
@@ -567,8 +567,8 @@  discard block
 block discarded – undo
567 567
 	 * @param string $key   Meta key.
568 568
 	 * @param string $value Meta value.
569 569
 	 */
570
-	public function set_meta( $key, $value ) {
571
-		$this->meta[ $key ] = $value;
570
+	public function set_meta($key, $value) {
571
+		$this->meta[$key] = $value;
572 572
 	}
573 573
 
574 574
 	/**
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 	 * @return string
578 578
 	 */
579 579
 	public function get_pay_redirect_url() {
580
-		return add_query_arg( 'payment_redirect', $this->id, home_url( '/' ) );
580
+		return add_query_arg('payment_redirect', $this->id, home_url('/'));
581 581
 	}
582 582
 
583 583
 	/**
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 				'payment' => $this->id,
593 593
 				'key'     => $this->key,
594 594
 			),
595
-			home_url( '/' )
595
+			home_url('/')
596 596
 		);
597 597
 
598 598
 		return $url;
@@ -604,8 +604,8 @@  discard block
 block discarded – undo
604 604
 	 * @return string
605 605
 	 */
606 606
 	public function get_action_url() {
607
-		if ( '' === $this->get_amount() || 0.0 === $this->get_amount() ) {
608
-			$this->set_status( Statuses::SUCCESS );
607
+		if ('' === $this->get_amount() || 0.0 === $this->get_amount()) {
608
+			$this->set_status(Statuses::SUCCESS);
609 609
 
610 610
 			return $this->get_return_redirect_url();
611 611
 		}
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 	 *
619 619
 	 * @param string $action_url Action URL.
620 620
 	 */
621
-	public function set_action_url( $action_url ) {
621
+	public function set_action_url($action_url) {
622 622
 		$this->action_url = $action_url;
623 623
 	}
624 624
 
@@ -630,10 +630,10 @@  discard block
 block discarded – undo
630 630
 	 * @return string
631 631
 	 */
632 632
 	public function get_return_redirect_url() {
633
-		$url = home_url( '/' );
633
+		$url = home_url('/');
634 634
 
635
-		$url = apply_filters( 'pronamic_payment_redirect_url', $url, $this );
636
-		$url = apply_filters( 'pronamic_payment_redirect_url_' . $this->source, $url, $this );
635
+		$url = apply_filters('pronamic_payment_redirect_url', $url, $this);
636
+		$url = apply_filters('pronamic_payment_redirect_url_' . $this->source, $url, $this);
637 637
 
638 638
 		return $url;
639 639
 	}
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 	 * @return string
646 646
 	 */
647 647
 	public function get_redirect_url() {
648
-		_deprecated_function( __FUNCTION__, '4.1.2', 'get_return_redirect_url()' );
648
+		_deprecated_function(__FUNCTION__, '4.1.2', 'get_return_redirect_url()');
649 649
 
650 650
 		return $this->get_return_redirect_url();
651 651
 	}
@@ -658,8 +658,8 @@  discard block
 block discarded – undo
658 658
 	public function get_source_description() {
659 659
 		$description = $this->source;
660 660
 
661
-		$description = apply_filters( 'pronamic_payment_source_description', $description, $this );
662
-		$description = apply_filters( 'pronamic_payment_source_description_' . $this->source, $description, $this );
661
+		$description = apply_filters('pronamic_payment_source_description', $description, $this);
662
+		$description = apply_filters('pronamic_payment_source_description_' . $this->source, $description, $this);
663 663
 
664 664
 		return $description;
665 665
 	}
@@ -672,8 +672,8 @@  discard block
 block discarded – undo
672 672
 	public function get_source_link() {
673 673
 		$url = null;
674 674
 
675
-		$url = apply_filters( 'pronamic_payment_source_url', $url, $this );
676
-		$url = apply_filters( 'pronamic_payment_source_url_' . $this->source, $url, $this );
675
+		$url = apply_filters('pronamic_payment_source_url', $url, $this);
676
+		$url = apply_filters('pronamic_payment_source_url_' . $this->source, $url, $this);
677 677
 
678 678
 		return $url;
679 679
 	}
@@ -686,11 +686,11 @@  discard block
 block discarded – undo
686 686
 	public function get_provider_link() {
687 687
 		$url = null;
688 688
 
689
-		$config_id  = get_post_meta( $this->id, '_pronamic_payment_config_id', true );
690
-		$gateway_id = get_post_meta( $config_id, '_pronamic_gateway_id', true );
689
+		$config_id  = get_post_meta($this->id, '_pronamic_payment_config_id', true);
690
+		$gateway_id = get_post_meta($config_id, '_pronamic_gateway_id', true);
691 691
 
692
-		$url = apply_filters( 'pronamic_payment_provider_url', $url, $this );
693
-		$url = apply_filters( 'pronamic_payment_provider_url_' . $gateway_id, $url, $this );
692
+		$url = apply_filters('pronamic_payment_provider_url', $url, $this);
693
+		$url = apply_filters('pronamic_payment_provider_url_' . $gateway_id, $url, $this);
694 694
 
695 695
 		return $url;
696 696
 	}
@@ -701,15 +701,15 @@  discard block
 block discarded – undo
701 701
 	 * @return Subscription
702 702
 	 */
703 703
 	public function get_subscription() {
704
-		if ( is_object( $this->subscription ) ) {
704
+		if (is_object($this->subscription)) {
705 705
 			return $this->subscription;
706 706
 		}
707 707
 
708
-		if ( empty( $this->subscription_id ) ) {
708
+		if (empty($this->subscription_id)) {
709 709
 			return false;
710 710
 		}
711 711
 
712
-		$this->subscription = new Subscription( $this->subscription_id );
712
+		$this->subscription = new Subscription($this->subscription_id);
713 713
 
714 714
 		return $this->subscription;
715 715
 	}
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
 	 * @param string $string The string to format.
723 723
 	 * @return string
724 724
 	 */
725
-	public function format_string( $string ) {
725
+	public function format_string($string) {
726 726
 		// Replacements definition.
727 727
 		$replacements = array(
728 728
 			'{order_id}'   => $this->get_order_id(),
@@ -731,15 +731,15 @@  discard block
 block discarded – undo
731 731
 
732 732
 		// Find and replace.
733 733
 		$string = str_replace(
734
-			array_keys( $replacements ),
735
-			array_values( $replacements ),
734
+			array_keys($replacements),
735
+			array_values($replacements),
736 736
 			$string,
737 737
 			$count
738 738
 		);
739 739
 
740 740
 		// Make sure there is an dynamic part in the order ID.
741 741
 		// @see https://secure.ogone.com/ncol/param_cookbook.asp.
742
-		if ( 0 === $count ) {
742
+		if (0 === $count) {
743 743
 			$string .= $this->get_id();
744 744
 		}
745 745
 
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 	 *
752 752
 	 * @param string $name Name.
753 753
 	 */
754
-	public function set_consumer_name( $name ) {
754
+	public function set_consumer_name($name) {
755 755
 		$this->consumer_name = $name;
756 756
 	}
757 757
 
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
 	 *
761 761
 	 * @param string $account_number Account number.
762 762
 	 */
763
-	public function set_consumer_account_number( $account_number ) {
763
+	public function set_consumer_account_number($account_number) {
764 764
 		$this->consumer_account_number = $account_number;
765 765
 	}
766 766
 
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
 	 *
770 770
 	 * @param string $iban IBAN.
771 771
 	 */
772
-	public function set_consumer_iban( $iban ) {
772
+	public function set_consumer_iban($iban) {
773 773
 		$this->consumer_iban = $iban;
774 774
 	}
775 775
 
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
 	 *
779 779
 	 * @param string $bic BIC.
780 780
 	 */
781
-	public function set_consumer_bic( $bic ) {
781
+	public function set_consumer_bic($bic) {
782 782
 		$this->consumer_bic = $bic;
783 783
 	}
784 784
 
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 	 *
788 788
 	 * @param string $city City.
789 789
 	 */
790
-	public function set_consumer_city( $city ) {
790
+	public function set_consumer_city($city) {
791 791
 		$this->consumer_city = $city;
792 792
 	}
793 793
 
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
 	 *
896 896
 	 * @param CreditCard $credit_card Credit Card.
897 897
 	 */
898
-	public function set_credit_card( $credit_card ) {
898
+	public function set_credit_card($credit_card) {
899 899
 		$this->credit_card = $credit_card;
900 900
 	}
901 901
 
Please login to merge, or discard this patch.
classes/Payments/AbstractPaymentData.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	 * @return string|null
221 221
 	 */
222 222
 	public function get_currency_numeric_code() {
223
-		return Currency::transform_code_to_number( $this->get_currency_alphabetic_code() );
223
+		return Currency::transform_code_to_number($this->get_currency_alphabetic_code());
224 224
 	}
225 225
 
226 226
 	/**
@@ -267,8 +267,8 @@  discard block
 block discarded – undo
267 267
 	 * @param string $payment_method Payment method identifier.
268 268
 	 * @return string
269 269
 	 */
270
-	public function get_issuer( $payment_method = null ) {
271
-		if ( PaymentMethods::CREDIT_CARD === $payment_method ) {
270
+	public function get_issuer($payment_method = null) {
271
+		if (PaymentMethods::CREDIT_CARD === $payment_method) {
272 272
 			return $this->get_credit_card_issuer_id();
273 273
 		}
274 274
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 	 * @return string
282 282
 	 */
283 283
 	public function get_issuer_id() {
284
-		return filter_input( INPUT_POST, 'pronamic_ideal_issuer_id', FILTER_SANITIZE_STRING );
284
+		return filter_input(INPUT_POST, 'pronamic_ideal_issuer_id', FILTER_SANITIZE_STRING);
285 285
 	}
286 286
 
287 287
 	/**
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 	 * @return string
291 291
 	 */
292 292
 	public function get_credit_card_issuer_id() {
293
-		return filter_input( INPUT_POST, 'pronamic_credit_card_issuer_id', FILTER_SANITIZE_STRING );
293
+		return filter_input(INPUT_POST, 'pronamic_credit_card_issuer_id', FILTER_SANITIZE_STRING);
294 294
 	}
295 295
 
296 296
 	/**
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 	 *
333 333
 	 * @param boolean $recurring Boolean flag which indicates recurring.
334 334
 	 */
335
-	public function set_recurring( $recurring ) {
335
+	public function set_recurring($recurring) {
336 336
 		$this->recurring = $recurring;
337 337
 	}
338 338
 }
Please login to merge, or discard this patch.