@@ -16,7 +16,7 @@ |
||
16 | 16 | |
17 | 17 | wp_register_style( |
18 | 18 | 'pronamic-pay-redirect', |
19 | - plugins_url( 'css/redirect' . $min . '.css', Plugin::$file ), |
|
19 | + plugins_url( 'css/redirect'.$min.'.css', Plugin::$file ), |
|
20 | 20 | array(), |
21 | 21 | $pronamic_ideal->get_version() |
22 | 22 | ); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$data = file_get_contents( __DIR__ . '/../providers.json' ); |
|
3 | +$data = file_get_contents( __DIR__.'/../providers.json' ); |
|
4 | 4 | $data = json_decode( $data ); |
5 | 5 | |
6 | 6 | $providers = array(); |
@@ -8,14 +8,14 @@ discard block |
||
8 | 8 | $providers[ $provider->slug ] = $provider; |
9 | 9 | } |
10 | 10 | |
11 | -$data = file_get_contents( __DIR__ . '/../gateways.json' ); |
|
11 | +$data = file_get_contents( __DIR__.'/../gateways.json' ); |
|
12 | 12 | $gateways = json_decode( $data ); |
13 | 13 | |
14 | 14 | foreach ( $gateways as $gateway ) { |
15 | 15 | if ( isset( $providers[ $gateway->provider ] ) ) { |
16 | 16 | $provider = $providers[ $gateway->provider ]; |
17 | 17 | |
18 | - if ( ! isset( $provider->gateways ) ) { |
|
18 | + if ( !isset( $provider->gateways ) ) { |
|
19 | 19 | $provider->gateways = array(); |
20 | 20 | } |
21 | 21 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | * @package Pronamic\WordPress\Pay |
9 | 9 | */ |
10 | 10 | |
11 | -if ( ! defined( 'WPINC' ) ) { |
|
11 | +if ( !defined( 'WPINC' ) ) { |
|
12 | 12 | die; |
13 | 13 | } |
14 | 14 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | public function test_construct() { |
26 | 26 | $credit_card = new CreditCard(); |
27 | 27 | |
28 | - $this->assertInstanceOf( __NAMESPACE__ . '\CreditCard', $credit_card ); |
|
28 | + $this->assertInstanceOf( __NAMESPACE__.'\CreditCard', $credit_card ); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $post_status = $this->get_post_status( $payment, null ); |
112 | 112 | |
113 | 113 | if ( null !== $post_status ) { |
114 | - $data['post_status'] = $post_status; |
|
114 | + $data[ 'post_status' ] = $post_status; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | wp_update_post( $data ); |
@@ -238,8 +238,8 @@ discard block |
||
238 | 238 | if ( $previous_status !== $payment->status ) { |
239 | 239 | $can_redirect = false; |
240 | 240 | |
241 | - do_action( 'pronamic_payment_status_update_' . $payment->source . '_' . $previous_status . '_to_' . $payment->status, $payment, $can_redirect ); |
|
242 | - do_action( 'pronamic_payment_status_update_' . $payment->source, $payment, $can_redirect ); |
|
241 | + do_action( 'pronamic_payment_status_update_'.$payment->source.'_'.$previous_status.'_to_'.$payment->status, $payment, $can_redirect ); |
|
242 | + do_action( 'pronamic_payment_status_update_'.$payment->source, $payment, $can_redirect ); |
|
243 | 243 | do_action( 'pronamic_payment_status_update', $payment, $can_redirect ); |
244 | 244 | } |
245 | 245 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | * @return string |
37 | 37 | */ |
38 | 38 | private function get_meta_key( $key ) { |
39 | - return $this->meta_key_prefix . $key; |
|
39 | + return $this->meta_key_prefix.$key; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $post_status = $this->get_post_status( $subscription->get_status(), null ); |
97 | 97 | |
98 | 98 | if ( null !== $post_status ) { |
99 | - $data['post_status'] = $post_status; |
|
99 | + $data[ 'post_status' ] = $post_status; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | wp_update_post( $data ); |
@@ -245,8 +245,8 @@ discard block |
||
245 | 245 | if ( $previous_status !== $subscription->status ) { |
246 | 246 | $can_redirect = false; |
247 | 247 | |
248 | - do_action( 'pronamic_subscription_status_update_' . $subscription->source . '_' . strtolower( $previous_status ) . '_to_' . strtolower( $subscription->status ), $subscription, $can_redirect ); |
|
249 | - do_action( 'pronamic_subscription_status_update_' . $subscription->source, $subscription, $can_redirect ); |
|
248 | + do_action( 'pronamic_subscription_status_update_'.$subscription->source.'_'.strtolower( $previous_status ).'_to_'.strtolower( $subscription->status ), $subscription, $can_redirect ); |
|
249 | + do_action( 'pronamic_subscription_status_update_'.$subscription->source, $subscription, $can_redirect ); |
|
250 | 250 | do_action( 'pronamic_subscription_status_update', $subscription, $can_redirect ); |
251 | 251 | } |
252 | 252 | } |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | * @throws \Exception Throws an Exception when the `interval_spec` cannot be parsed as an interval. |
381 | 381 | */ |
382 | 382 | public function get_date_interval() { |
383 | - $interval_spec = 'P' . $this->interval . $this->interval_period; |
|
383 | + $interval_spec = 'P'.$this->interval.$this->interval_period; |
|
384 | 384 | |
385 | 385 | $interval = new DateInterval( $interval_spec ); |
386 | 386 | |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | * @return string |
510 | 510 | */ |
511 | 511 | public function get_meta( $key ) { |
512 | - $key = '_pronamic_subscription_' . $key; |
|
512 | + $key = '_pronamic_subscription_'.$key; |
|
513 | 513 | |
514 | 514 | return get_post_meta( $this->id, $key, true ); |
515 | 515 | } |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | * @return boolean True on successful update, false on failure. |
524 | 524 | */ |
525 | 525 | public function set_meta( $key, $value = false ) { |
526 | - $key = '_pronamic_subscription_' . $key; |
|
526 | + $key = '_pronamic_subscription_'.$key; |
|
527 | 527 | |
528 | 528 | if ( $value instanceof DateTime ) { |
529 | 529 | $value = $value->format( 'Y-m-d H:i:s' ); |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | |
549 | 549 | if ( $payment ) { |
550 | 550 | $description = apply_filters( 'pronamic_payment_source_description', $description, $payment ); |
551 | - $description = apply_filters( 'pronamic_payment_source_description_' . $this->source, $description, $payment ); |
|
551 | + $description = apply_filters( 'pronamic_payment_source_description_'.$this->source, $description, $payment ); |
|
552 | 552 | } |
553 | 553 | |
554 | 554 | return $description; |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | |
567 | 567 | if ( $payment ) { |
568 | 568 | $url = apply_filters( 'pronamic_payment_source_url', $url, $payment ); |
569 | - $url = apply_filters( 'pronamic_payment_source_url_' . $this->source, $url, $payment ); |
|
569 | + $url = apply_filters( 'pronamic_payment_source_url_'.$this->source, $url, $payment ); |
|
570 | 570 | } |
571 | 571 | |
572 | 572 | return $url; |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | $payments = $this->get_payments(); |
642 | 642 | |
643 | 643 | if ( count( $payments ) > 0 ) { |
644 | - return $payments[0]; |
|
644 | + return $payments[ 0 ]; |
|
645 | 645 | } |
646 | 646 | |
647 | 647 | return null; |
@@ -897,7 +897,7 @@ discard block |
||
897 | 897 | * @param array $meta The meta data to update. |
898 | 898 | */ |
899 | 899 | public function update_meta( $meta ) { |
900 | - if ( ! is_array( $meta ) || count( $meta ) === 0 ) { |
|
900 | + if ( !is_array( $meta ) || count( $meta ) === 0 ) { |
|
901 | 901 | return; |
902 | 902 | } |
903 | 903 |
@@ -29,13 +29,13 @@ discard block |
||
29 | 29 | |
30 | 30 | $inputs = array(); |
31 | 31 | |
32 | - foreach ( $payment_methods['choices'][0]['options'] as $payment_method => $method_name ) { |
|
32 | + foreach ( $payment_methods[ 'choices' ][ 0 ][ 'options' ] as $payment_method => $method_name ) { |
|
33 | 33 | $gateway->set_payment_method( $payment_method ); |
34 | 34 | |
35 | 35 | // Payment method input HTML. |
36 | 36 | $html = $gateway->get_input_html(); |
37 | 37 | |
38 | - if ( ! empty( $html ) ) { |
|
38 | + if ( !empty( $html ) ) { |
|
39 | 39 | $inputs[ $payment_method ] = array( |
40 | 40 | 'label' => $method_name, |
41 | 41 | 'html' => $html, |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | if ( $gateway->has_error() ) { |
47 | - $pronamic_ideal_errors[] = $gateway->get_error(); |
|
47 | + $pronamic_ideal_errors[ ] = $gateway->get_error(); |
|
48 | 48 | } |
49 | 49 | |
50 | - include Plugin::$dirname . '/views/errors.php'; |
|
50 | + include Plugin::$dirname.'/views/errors.php'; |
|
51 | 51 | |
52 | 52 | ?> |
53 | 53 | <table class="form-table"> |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | <select id="pronamic-pay-test-payment-methods" name="pronamic_pay_test_payment_method"> |
62 | 62 | <?php |
63 | 63 | |
64 | - foreach ( $payment_methods['choices'][0]['options'] as $payment_method => $method_name ) { |
|
64 | + foreach ( $payment_methods[ 'choices' ][ 0 ][ 'options' ] as $payment_method => $method_name ) { |
|
65 | 65 | printf( |
66 | 66 | '<option value="%s" data-is-recurring="%d">%s</option>', |
67 | 67 | esc_attr( $payment_method ), |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | |
80 | 80 | <tr class="pronamic-pay-cloack pronamic-pay-test-payment-method <?php echo esc_attr( $method ); ?>"> |
81 | 81 | <th scope="row"> |
82 | - <?php echo esc_html( $input['label'] ); ?> |
|
82 | + <?php echo esc_html( $input[ 'label' ] ); ?> |
|
83 | 83 | </th> |
84 | 84 | <td> |
85 | 85 | <?php |
86 | 86 | |
87 | - echo $input['html']; // WPCS: XSS ok. |
|
87 | + echo $input[ 'html' ]; // WPCS: XSS ok. |
|
88 | 88 | |
89 | 89 | ?> |
90 | 90 | </td> |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | <?php |
297 | 297 | |
298 | 298 | if ( $is_ideal || $gateway instanceof \Pronamic\WordPress\Pay\Gateways\OmniKassa2\Gateway ) { |
299 | - include Plugin::$dirname . '/views/ideal-test-cases.php'; |
|
299 | + include Plugin::$dirname.'/views/ideal-test-cases.php'; |
|
300 | 300 | } |
301 | 301 | } else { |
302 | 302 | printf( |