@@ -6,77 +6,77 @@ discard block |
||
6 | 6 | use Pronamic\WordPress\Pay\Plugin; |
7 | 7 | use Pronamic\WordPress\Pay\Util; |
8 | 8 | |
9 | -$config_id = get_post_meta( $id, '_pronamic_payment_form_config_id', true ); |
|
9 | +$config_id = get_post_meta($id, '_pronamic_payment_form_config_id', true); |
|
10 | 10 | |
11 | -$button_text = get_post_meta( $id, '_pronamic_payment_form_button_text', true ); |
|
12 | -$button_text = empty( $button_text ) ? __( 'Pay Now', 'pronamic_ideal' ) : $button_text; |
|
11 | +$button_text = get_post_meta($id, '_pronamic_payment_form_button_text', true); |
|
12 | +$button_text = empty($button_text) ? __('Pay Now', 'pronamic_ideal') : $button_text; |
|
13 | 13 | |
14 | -$amount_method = get_post_meta( $id, '_pronamic_payment_form_amount_method', true ); |
|
15 | -$amount_choices = get_post_meta( $id, '_pronamic_payment_form_amount_choices', true ); |
|
14 | +$amount_method = get_post_meta($id, '_pronamic_payment_form_amount_method', true); |
|
15 | +$amount_choices = get_post_meta($id, '_pronamic_payment_form_amount_choices', true); |
|
16 | 16 | |
17 | 17 | $methods_with_choices = array( |
18 | 18 | \Pronamic\WordPress\Pay\Forms\FormPostType::AMOUNT_METHOD_CHOICES_ONLY, |
19 | 19 | \Pronamic\WordPress\Pay\Forms\FormPostType::AMOUNT_METHOD_CHOICES_AND_INPUT, |
20 | 20 | ); |
21 | 21 | |
22 | -$gateway = Plugin::get_gateway( $config_id ); |
|
22 | +$gateway = Plugin::get_gateway($config_id); |
|
23 | 23 | |
24 | 24 | $amount_value = ''; |
25 | 25 | |
26 | -if ( filter_has_var( INPUT_GET, 'amount' ) ) { |
|
27 | - $amount_value = filter_input( INPUT_GET, 'amount', FILTER_SANITIZE_STRING ); |
|
26 | +if (filter_has_var(INPUT_GET, 'amount')) { |
|
27 | + $amount_value = filter_input(INPUT_GET, 'amount', FILTER_SANITIZE_STRING); |
|
28 | 28 | } |
29 | 29 | |
30 | -if ( $gateway ) : ?> |
|
30 | +if ($gateway) : ?> |
|
31 | 31 | |
32 | 32 | <div class="pronamic-pay-form-wrap"> |
33 | 33 | |
34 | - <?php if ( ! is_singular( 'pronamic_pay_form' ) ) : ?> |
|
34 | + <?php if ( ! is_singular('pronamic_pay_form')) : ?> |
|
35 | 35 | |
36 | - <h2 class="pronamic-pay-form-title"><?php echo esc_html( get_the_title( $id ) ); ?></h2> |
|
36 | + <h2 class="pronamic-pay-form-title"><?php echo esc_html(get_the_title($id)); ?></h2> |
|
37 | 37 | |
38 | 38 | <?php endif; ?> |
39 | 39 | |
40 | - <form id="pronamic-pay-form-<?php echo esc_attr( $id ); ?>" class="pronamic-pay-form" method="post"> |
|
41 | - <?php if ( in_array( $amount_method, $methods_with_choices, true ) ) : ?> |
|
40 | + <form id="pronamic-pay-form-<?php echo esc_attr($id); ?>" class="pronamic-pay-form" method="post"> |
|
41 | + <?php if (in_array($amount_method, $methods_with_choices, true)) : ?> |
|
42 | 42 | |
43 | 43 | <fieldset> |
44 | - <legend><?php esc_html_e( 'Amount', 'pronamic_ideal' ); ?></legend> |
|
44 | + <legend><?php esc_html_e('Amount', 'pronamic_ideal'); ?></legend> |
|
45 | 45 | |
46 | 46 | <?php endif; ?> |
47 | 47 | |
48 | 48 | <div class="pronamic-pay-amount pronamic-pay-form-row-wide"> |
49 | - <?php if ( in_array( $amount_method, $methods_with_choices, true ) ) : ?> |
|
49 | + <?php if (in_array($amount_method, $methods_with_choices, true)) : ?> |
|
50 | 50 | |
51 | - <?php foreach ( $amount_choices as $amount ) : ?> |
|
51 | + <?php foreach ($amount_choices as $amount) : ?> |
|
52 | 52 | |
53 | 53 | <?php |
54 | 54 | |
55 | - $input_id = 'pronamic-pay-amount-' . esc_attr( $amount ); |
|
55 | + $input_id = 'pronamic-pay-amount-' . esc_attr($amount); |
|
56 | 56 | |
57 | - $decimals = ( $amount % 100 > 0 ? 2 : 0 ); |
|
57 | + $decimals = ($amount % 100 > 0 ? 2 : 0); |
|
58 | 58 | |
59 | - $amount_formatted = number_format( ( $amount / 100 ), $decimals, pronamic_pay_get_decimal_separator(), pronamic_pay_get_thousands_separator() ); |
|
59 | + $amount_formatted = number_format(($amount / 100), $decimals, pronamic_pay_get_decimal_separator(), pronamic_pay_get_thousands_separator()); |
|
60 | 60 | |
61 | 61 | ?> |
62 | 62 | |
63 | 63 | <div> |
64 | - <input class="pronamic-pay-amount-input pronamic-pay-input" id="<?php echo esc_attr( $input_id ); ?>" name="pronamic_pay_amount" type="radio" required="required" value="<?php echo esc_attr( $amount ); ?>" /> |
|
65 | - <label for="<?php echo esc_attr( $input_id ); ?>"> |
|
64 | + <input class="pronamic-pay-amount-input pronamic-pay-input" id="<?php echo esc_attr($input_id); ?>" name="pronamic_pay_amount" type="radio" required="required" value="<?php echo esc_attr($amount); ?>" /> |
|
65 | + <label for="<?php echo esc_attr($input_id); ?>"> |
|
66 | 66 | <span class="pronamic-pay-currency-symbol pronamic-pay-currency-position-before">€</span> |
67 | - <span class="pronamic-pay-amount-value"><?php echo esc_html( $amount_formatted ); ?></span> |
|
67 | + <span class="pronamic-pay-amount-value"><?php echo esc_html($amount_formatted); ?></span> |
|
68 | 68 | </label> |
69 | 69 | </div> |
70 | 70 | |
71 | 71 | <?php endforeach; ?> |
72 | 72 | |
73 | - <?php if ( \Pronamic\WordPress\Pay\Forms\FormPostType::AMOUNT_METHOD_CHOICES_AND_INPUT === $amount_method ) : ?> |
|
73 | + <?php if (\Pronamic\WordPress\Pay\Forms\FormPostType::AMOUNT_METHOD_CHOICES_AND_INPUT === $amount_method) : ?> |
|
74 | 74 | |
75 | 75 | <div> |
76 | 76 | <input class="pronamic-pay-amount-input pronamic-pay-input" id="pronamic-pay-amount-other" name="pronamic_pay_amount" type="radio" required="required" value="other" /> |
77 | 77 | <label for="pronamic-pay-amount-other"> |
78 | 78 | <span class="pronamic-pay-currency-symbol pronamic-pay-currency-position-before">€</span> |
79 | - <input class="pronamic-pay-amount-input pronamic-pay-input" id="pronamic-pay-amount" name="pronamic_pay_amount_other" type="text" placeholder="" autocomplete="off" value="<?php echo esc_attr( $amount_value ); ?>" /> |
|
79 | + <input class="pronamic-pay-amount-input pronamic-pay-input" id="pronamic-pay-amount" name="pronamic_pay_amount_other" type="text" placeholder="" autocomplete="off" value="<?php echo esc_attr($amount_value); ?>" /> |
|
80 | 80 | </label> |
81 | 81 | </div> |
82 | 82 | |
@@ -84,54 +84,54 @@ discard block |
||
84 | 84 | |
85 | 85 | <?php endif; ?> |
86 | 86 | |
87 | - <?php if ( \Pronamic\WordPress\Pay\Forms\FormPostType::AMOUNT_METHOD_INPUT_ONLY === $amount_method ) : ?> |
|
87 | + <?php if (\Pronamic\WordPress\Pay\Forms\FormPostType::AMOUNT_METHOD_INPUT_ONLY === $amount_method) : ?> |
|
88 | 88 | |
89 | 89 | <span class="pronamic-pay-currency-symbol pronamic-pay-currency-position-before">€</span> |
90 | - <input class="pronamic-pay-amount-input pronamic-pay-input" id="pronamic-pay-amount" name="pronamic_pay_amount" type="text" placeholder="" autocomplete="off" value="<?php echo esc_attr( $amount_value ); ?>" /> |
|
90 | + <input class="pronamic-pay-amount-input pronamic-pay-input" id="pronamic-pay-amount" name="pronamic_pay_amount" type="text" placeholder="" autocomplete="off" value="<?php echo esc_attr($amount_value); ?>" /> |
|
91 | 91 | |
92 | 92 | <?php endif; ?> |
93 | 93 | </div> |
94 | 94 | |
95 | - <?php if ( in_array( $amount_method, $methods_with_choices, true ) ) : ?> |
|
95 | + <?php if (in_array($amount_method, $methods_with_choices, true)) : ?> |
|
96 | 96 | |
97 | 97 | </fieldset> |
98 | 98 | |
99 | 99 | <?php endif; ?> |
100 | 100 | |
101 | 101 | <fieldset> |
102 | - <legend><?php esc_html_e( 'Personal Info', 'pronamic_ideal' ); ?></legend> |
|
102 | + <legend><?php esc_html_e('Personal Info', 'pronamic_ideal'); ?></legend> |
|
103 | 103 | |
104 | 104 | <p class="pronamic-pay-form-row pronamic-pay-form-row-first"> |
105 | 105 | <label class="pronamic-pay-label" for="pronamic-pay-first-name"> |
106 | - <?php esc_html_e( 'First Name', 'pronamic_ideal' ); ?> <span class="pronamic-pay-required-indicator">*</span> |
|
106 | + <?php esc_html_e('First Name', 'pronamic_ideal'); ?> <span class="pronamic-pay-required-indicator">*</span> |
|
107 | 107 | </label> |
108 | 108 | |
109 | - <input class="pronamic-pay-input pronamic-pay-required" type="text" name="pronamic_pay_first_name" placeholder="<?php esc_attr_e( 'First Name', 'pronamic_ideal' ); ?>" id="pronamic-pay-first-name" required="required" value="" /> |
|
109 | + <input class="pronamic-pay-input pronamic-pay-required" type="text" name="pronamic_pay_first_name" placeholder="<?php esc_attr_e('First Name', 'pronamic_ideal'); ?>" id="pronamic-pay-first-name" required="required" value="" /> |
|
110 | 110 | </p> |
111 | 111 | |
112 | 112 | <p class="pronamic-pay-form-row pronamic-pay-form-row-last"> |
113 | 113 | <label class="pronamic-pay-label" for="pronamic-pay-last-name"> |
114 | - <?php esc_html_e( 'Last Name', 'pronamic_ideal' ); ?> |
|
114 | + <?php esc_html_e('Last Name', 'pronamic_ideal'); ?> |
|
115 | 115 | </label> |
116 | 116 | |
117 | - <input class="pronamic-pay-input" type="text" name="pronamic_pay_last_name" id="pronamic-pay-last-name" placeholder="<?php esc_attr_e( 'Last Name', 'pronamic_ideal' ); ?>" value="" /> |
|
117 | + <input class="pronamic-pay-input" type="text" name="pronamic_pay_last_name" id="pronamic-pay-last-name" placeholder="<?php esc_attr_e('Last Name', 'pronamic_ideal'); ?>" value="" /> |
|
118 | 118 | </p> |
119 | 119 | |
120 | 120 | <p class="pronamic-pay-form-row pronamic-pay-form-row-wide"> |
121 | 121 | <label class="pronamic-pay-label" for="pronamic-pay-email"> |
122 | - <?php esc_html_e( 'Email Address', 'pronamic_ideal' ); ?> |
|
122 | + <?php esc_html_e('Email Address', 'pronamic_ideal'); ?> |
|
123 | 123 | <span class="pronamic-pay-required-indicator">*</span> |
124 | 124 | </label> |
125 | 125 | |
126 | - <input class="pronamic-pay-input required" type="email" name="pronamic_pay_email" placeholder="<?php esc_attr_e( 'Email Address', 'pronamic_ideal' ); ?>" id="pronamic-pay-email" required="required" value="" /> |
|
126 | + <input class="pronamic-pay-input required" type="email" name="pronamic_pay_email" placeholder="<?php esc_attr_e('Email Address', 'pronamic_ideal'); ?>" id="pronamic-pay-email" required="required" value="" /> |
|
127 | 127 | </p> |
128 | 128 | </fieldset> |
129 | 129 | |
130 | 130 | <?php |
131 | 131 | |
132 | - if ( $gateway->payment_method_is_required() ) { |
|
132 | + if ($gateway->payment_method_is_required()) { |
|
133 | 133 | |
134 | - $gateway->set_payment_method( PaymentMethods::IDEAL ); |
|
134 | + $gateway->set_payment_method(PaymentMethods::IDEAL); |
|
135 | 135 | |
136 | 136 | } |
137 | 137 | |
@@ -139,23 +139,23 @@ discard block |
||
139 | 139 | |
140 | 140 | ?> |
141 | 141 | |
142 | - <?php if ( ! empty( $fields ) ) : ?> |
|
142 | + <?php if ( ! empty($fields)) : ?> |
|
143 | 143 | |
144 | 144 | <fieldset> |
145 | - <legend><?php esc_html_e( 'Payment Info', 'pronamic_ideal' ); ?></legend> |
|
145 | + <legend><?php esc_html_e('Payment Info', 'pronamic_ideal'); ?></legend> |
|
146 | 146 | |
147 | - <?php foreach ( $fields as $i => $field ) : ?> |
|
147 | + <?php foreach ($fields as $i => $field) : ?> |
|
148 | 148 | |
149 | 149 | <p class="pronamic-pay-form-row pronamic-pay-form-row-wide"> |
150 | - <label class="pronamic-pay-label" for="<?php echo esc_attr( $field['id'] ); ?>"> |
|
151 | - <?php echo esc_html( $field['label'] ); ?> |
|
150 | + <label class="pronamic-pay-label" for="<?php echo esc_attr($field['id']); ?>"> |
|
151 | + <?php echo esc_html($field['label']); ?> |
|
152 | 152 | <span class="pronamic-pay-required-indicator">*</span> |
153 | 153 | </label> |
154 | 154 | |
155 | - <?php if ( 'select' === $field['type'] ) : ?> |
|
155 | + <?php if ('select' === $field['type']) : ?> |
|
156 | 156 | |
157 | - <select id="<?php echo esc_attr( $field['id'] ); ?>" name="<?php echo esc_attr( $field['name'] ); ?>"> |
|
158 | - <?php echo Util::select_options_grouped( $field['choices'] ); ?> |
|
157 | + <select id="<?php echo esc_attr($field['id']); ?>" name="<?php echo esc_attr($field['name']); ?>"> |
|
158 | + <?php echo Util::select_options_grouped($field['choices']); ?> |
|
159 | 159 | </select> |
160 | 160 | |
161 | 161 | <?php endif; ?> |
@@ -167,14 +167,14 @@ discard block |
||
167 | 167 | |
168 | 168 | <?php endif; ?> |
169 | 169 | |
170 | - <?php if ( ! empty( $pronamic_pay_errors ) ) : ?> |
|
170 | + <?php if ( ! empty($pronamic_pay_errors)) : ?> |
|
171 | 171 | |
172 | 172 | <div class="pronamic-pay-errors"> |
173 | 173 | |
174 | - <?php foreach ( $pronamic_pay_errors as $error ) : ?> |
|
174 | + <?php foreach ($pronamic_pay_errors as $error) : ?> |
|
175 | 175 | |
176 | 176 | <p class="pronamic-pay-error"> |
177 | - <strong><?php esc_html_e( 'Error', 'pronamic_ideal' ); ?></strong>: <?php echo esc_html( $error ); ?> |
|
177 | + <strong><?php esc_html_e('Error', 'pronamic_ideal'); ?></strong>: <?php echo esc_html($error); ?> |
|
178 | 178 | </p> |
179 | 179 | |
180 | 180 | <?php endforeach; ?> |
@@ -184,11 +184,11 @@ discard block |
||
184 | 184 | <?php endif; ?> |
185 | 185 | |
186 | 186 | <div class="pronamic-pay-submit-button-wrap pronamic-pay-clearfix"> |
187 | - <?php wp_nonce_field( 'pronamic_pay', 'pronamic_pay_nonce' ); ?> |
|
187 | + <?php wp_nonce_field('pronamic_pay', 'pronamic_pay_nonce'); ?> |
|
188 | 188 | |
189 | - <input type="hidden" name="pronamic_pay_form_id" value="<?php echo esc_attr( $id ); ?>" /> |
|
189 | + <input type="hidden" name="pronamic_pay_form_id" value="<?php echo esc_attr($id); ?>" /> |
|
190 | 190 | |
191 | - <input type="submit" class="pronamic-pay-submit pronamic-pay-btn" id="pronamic-pay-purchase-button" name="pronamic_pay" value="<?php echo esc_attr( $button_text ); ?>" /> |
|
191 | + <input type="submit" class="pronamic-pay-submit pronamic-pay-btn" id="pronamic-pay-purchase-button" name="pronamic_pay" value="<?php echo esc_attr($button_text); ?>" /> |
|
192 | 192 | </div> |
193 | 193 | </form> |
194 | 194 | </div> |
@@ -1,27 +1,27 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$root_dir = dirname( __DIR__ ); |
|
3 | +$root_dir = dirname(__DIR__); |
|
4 | 4 | |
5 | -$data = file_get_contents( $root_dir . '/package.json' ); |
|
6 | -$pkg = json_decode( $data ); |
|
5 | +$data = file_get_contents($root_dir . '/package.json'); |
|
6 | +$pkg = json_decode($data); |
|
7 | 7 | |
8 | 8 | // Check readme.txt |
9 | 9 | // @see https://github.com/WordPress/WordPress/blob/4.9/wp-includes/functions.php#L4810-L4868 |
10 | 10 | $filename = 'readme.txt'; |
11 | 11 | |
12 | -$readme_txt_lines = file( $root_dir . '/' . $filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES ); |
|
12 | +$readme_txt_lines = file($root_dir . '/' . $filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
|
13 | 13 | |
14 | -$search_string = sprintf( 'Stable tag: %s', $pkg->version ); |
|
14 | +$search_string = sprintf('Stable tag: %s', $pkg->version); |
|
15 | 15 | |
16 | -if ( ! in_array( $search_string, $readme_txt_lines, true ) ) { |
|
17 | - printf( '❌ ' ); |
|
18 | - printf( 'Could not find "%s" in file "%s".', $search_string, $filename ); |
|
16 | +if ( ! in_array($search_string, $readme_txt_lines, true)) { |
|
17 | + printf('❌ '); |
|
18 | + printf('Could not find "%s" in file "%s".', $search_string, $filename); |
|
19 | 19 | |
20 | - exit( 1 ); |
|
20 | + exit(1); |
|
21 | 21 | } |
22 | 22 | |
23 | -printf( '✅ ' ); |
|
24 | -printf( 'Found "%s" in file "%s".', $search_string, $filename ); |
|
23 | +printf('✅ '); |
|
24 | +printf('Found "%s" in file "%s".', $search_string, $filename); |
|
25 | 25 | |
26 | 26 | echo PHP_EOL; |
27 | 27 | |
@@ -30,19 +30,19 @@ discard block |
||
30 | 30 | // @see https://github.com/WordPress/WordPress/blob/4.9/wp-includes/functions.php#L4810-L4868 |
31 | 31 | $filename = 'pronamic-ideal.php'; |
32 | 32 | |
33 | -$plugin_file = file_get_contents( $root_dir . '/' . $filename ); |
|
33 | +$plugin_file = file_get_contents($root_dir . '/' . $filename); |
|
34 | 34 | |
35 | 35 | $file_header = ''; |
36 | 36 | |
37 | -$tokens = token_get_all( $plugin_file ); |
|
37 | +$tokens = token_get_all($plugin_file); |
|
38 | 38 | |
39 | -foreach ( $tokens as $token ) { |
|
40 | - if ( is_array( $token ) ) { |
|
39 | +foreach ($tokens as $token) { |
|
40 | + if (is_array($token)) { |
|
41 | 41 | $type = $token[0]; |
42 | 42 | $value = $token[1]; |
43 | 43 | $line = $token[2]; |
44 | 44 | |
45 | - if ( in_array( $type, array( T_COMMENT, T_DOC_COMMENT ), true ) && false !== strpos( $value, 'Plugin Name' ) ) { |
|
45 | + if (in_array($type, array(T_COMMENT, T_DOC_COMMENT), true) && false !== strpos($value, 'Plugin Name')) { |
|
46 | 46 | $file_header = $value; |
47 | 47 | |
48 | 48 | break; |
@@ -50,22 +50,22 @@ discard block |
||
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | -$file_header_lines = explode( "\n", $file_header ); |
|
54 | -$file_header_lines = array_map( function( $value ) { |
|
55 | - return ltrim( $value, ' *' ); |
|
56 | -}, $file_header_lines ); |
|
57 | -$file_header_lines = array_map( 'trim', $file_header_lines ); |
|
53 | +$file_header_lines = explode("\n", $file_header); |
|
54 | +$file_header_lines = array_map(function($value) { |
|
55 | + return ltrim($value, ' *'); |
|
56 | +}, $file_header_lines); |
|
57 | +$file_header_lines = array_map('trim', $file_header_lines); |
|
58 | 58 | |
59 | -$search_string = sprintf( 'Version: %s', $pkg->version ); |
|
59 | +$search_string = sprintf('Version: %s', $pkg->version); |
|
60 | 60 | |
61 | -if ( ! in_array( $search_string, $file_header_lines, true ) ) { |
|
62 | - printf( '❌ ' ); |
|
63 | - printf( 'Could not find "%s" in file "%s".', $search_string, $filename ); |
|
61 | +if ( ! in_array($search_string, $file_header_lines, true)) { |
|
62 | + printf('❌ '); |
|
63 | + printf('Could not find "%s" in file "%s".', $search_string, $filename); |
|
64 | 64 | |
65 | - exit( 1 ); |
|
65 | + exit(1); |
|
66 | 66 | } |
67 | 67 | |
68 | -printf( '✅ ' ); |
|
69 | -printf( 'Found "%s" in file "%s".', $search_string, $filename ); |
|
68 | +printf('✅ '); |
|
69 | +printf('Found "%s" in file "%s".', $search_string, $filename); |
|
70 | 70 | |
71 | 71 | echo PHP_EOL; |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $working_dir = getcwd(); |
4 | -$project_dir = dirname( __DIR__ ); |
|
4 | +$project_dir = dirname(__DIR__); |
|
5 | 5 | $repositories_dir = $project_dir . '/repositories'; |
6 | 6 | |
7 | 7 | $organisations = array( |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | ), |
50 | 50 | ); |
51 | 51 | |
52 | -foreach ( $organisations as $organisation => $repositories ) { |
|
52 | +foreach ($organisations as $organisation => $repositories) { |
|
53 | 53 | echo '# ', $organisation, PHP_EOL; |
54 | 54 | |
55 | - foreach ( $repositories as $repository ) { |
|
55 | + foreach ($repositories as $repository) { |
|
56 | 56 | echo '- ', $repository, PHP_EOL; |
57 | 57 | |
58 | 58 | $git_url = sprintf( |
@@ -63,23 +63,23 @@ discard block |
||
63 | 63 | |
64 | 64 | $git_dir = $repositories_dir . '/' . $organisation . '/' . $repository; |
65 | 65 | |
66 | - if ( ! is_dir( $git_dir ) ) { |
|
66 | + if ( ! is_dir($git_dir)) { |
|
67 | 67 | `git clone $git_url $git_dir`; |
68 | 68 | } |
69 | 69 | |
70 | 70 | // Git flow |
71 | - chdir( $git_dir ); |
|
71 | + chdir($git_dir); |
|
72 | 72 | |
73 | - if ( isset( $argv[1] ) && 'develop' === $argv[1] ) { |
|
73 | + if (isset($argv[1]) && 'develop' === $argv[1]) { |
|
74 | 74 | `git checkout develop`; |
75 | 75 | } |
76 | 76 | |
77 | - if ( isset( $argv[1] ) && 'pull' === $argv[1] ) { |
|
77 | + if (isset($argv[1]) && 'pull' === $argv[1]) { |
|
78 | 78 | $command = 'git pull'; |
79 | 79 | |
80 | 80 | echo $command, PHP_EOL; |
81 | 81 | |
82 | - echo shell_exec( $command ), PHP_EOL; |
|
82 | + echo shell_exec($command), PHP_EOL; |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | } |
@@ -1,35 +1,35 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -header( 'Content-Type: text/plain' ); |
|
3 | +header('Content-Type: text/plain'); |
|
4 | 4 | |
5 | -$data = file_get_contents( __DIR__ . '/../changelog.json' ); |
|
6 | -$changelog = json_decode( $data ); |
|
5 | +$data = file_get_contents(__DIR__ . '/../changelog.json'); |
|
6 | +$changelog = json_decode($data); |
|
7 | 7 | |
8 | -function render_changes( $changes, $level = 0 ) { |
|
8 | +function render_changes($changes, $level = 0) { |
|
9 | 9 | $indent = $level * 2; |
10 | 10 | |
11 | - if ( is_string( $changes ) ) { |
|
12 | - echo str_repeat( ' ', $indent ), '- ', $changes, "\r\n"; |
|
13 | - } elseif ( is_array( $changes ) ) { |
|
14 | - foreach ( $changes as $change ) { |
|
15 | - render_changes( $change, $level ); |
|
11 | + if (is_string($changes)) { |
|
12 | + echo str_repeat(' ', $indent), '- ', $changes, "\r\n"; |
|
13 | + } elseif (is_array($changes)) { |
|
14 | + foreach ($changes as $change) { |
|
15 | + render_changes($change, $level); |
|
16 | 16 | } |
17 | - } elseif ( is_object( $changes ) ) { |
|
18 | - if ( isset( $changes->name ) ) { |
|
17 | + } elseif (is_object($changes)) { |
|
18 | + if (isset($changes->name)) { |
|
19 | 19 | // Changes group |
20 | 20 | echo "\r\n"; |
21 | 21 | echo '### ', $changes->name, "\r\n"; |
22 | 22 | |
23 | - if ( isset( $changes->changes ) ) { |
|
24 | - render_changes( $changes->changes, $level ); |
|
23 | + if (isset($changes->changes)) { |
|
24 | + render_changes($changes->changes, $level); |
|
25 | 25 | } |
26 | 26 | } else { |
27 | - if ( isset( $changes->description ) ) { |
|
28 | - render_changes( $changes->description, $level ); |
|
27 | + if (isset($changes->description)) { |
|
28 | + render_changes($changes->description, $level); |
|
29 | 29 | } |
30 | 30 | |
31 | - if ( isset( $changes->changes ) ) { |
|
32 | - render_changes( $changes->changes, $level + 1 ); |
|
31 | + if (isset($changes->changes)) { |
|
32 | + render_changes($changes->changes, $level + 1); |
|
33 | 33 | } |
34 | 34 | } |
35 | 35 | } |
@@ -44,25 +44,25 @@ discard block |
||
44 | 44 | |
45 | 45 | <?php |
46 | 46 | |
47 | -foreach ( $changelog as $log ) { |
|
48 | - if ( 'Unreleased' === $log->version ) { |
|
47 | +foreach ($changelog as $log) { |
|
48 | + if ('Unreleased' === $log->version) { |
|
49 | 49 | echo '## [', $log->version, '][unreleased]', "\r\n"; |
50 | 50 | } else { |
51 | 51 | echo '## [', $log->version, '] - ', $log->date, "\r\n"; |
52 | 52 | } |
53 | 53 | |
54 | - render_changes( $log->changes ); |
|
54 | + render_changes($log->changes); |
|
55 | 55 | |
56 | 56 | echo "\r\n"; |
57 | 57 | } |
58 | 58 | |
59 | -$collection = new CachingIterator( new ArrayIterator( $changelog ), CachingIterator::TOSTRING_USE_CURRENT ); |
|
59 | +$collection = new CachingIterator(new ArrayIterator($changelog), CachingIterator::TOSTRING_USE_CURRENT); |
|
60 | 60 | |
61 | -foreach ( $collection as $log ) { |
|
62 | - if ( $collection->hasNext() ) { |
|
61 | +foreach ($collection as $log) { |
|
62 | + if ($collection->hasNext()) { |
|
63 | 63 | $prev = $collection->getInnerIterator()->current(); |
64 | 64 | |
65 | - if ( 'Unreleased' === $log->version ) { |
|
65 | + if ('Unreleased' === $log->version) { |
|
66 | 66 | echo '[unreleased]: https://github.com/pronamic/wp-pronamic-ideal/compare/', $prev->version, '...', 'HEAD', "\r\n"; |
67 | 67 | } else { |
68 | 68 | echo '[', $log->version, ']: https://github.com/pronamic/wp-pronamic-ideal/compare/', $prev->version, '...', $log->version, "\r\n"; |
@@ -1,28 +1,28 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$data = file_get_contents( __DIR__ . '/../extensions.json' ); |
|
4 | -$extensions = json_decode( $data ); |
|
3 | +$data = file_get_contents(__DIR__ . '/../extensions.json'); |
|
4 | +$extensions = json_decode($data); |
|
5 | 5 | |
6 | -foreach ( $extensions as $extension ) { |
|
7 | - printf( "* [%s](%s)\n", $extension->name, $extension->url ); |
|
6 | +foreach ($extensions as $extension) { |
|
7 | + printf("* [%s](%s)\n", $extension->name, $extension->url); |
|
8 | 8 | |
9 | - if ( isset( $extension->author, $extension->author_url ) ) { |
|
10 | - printf( " * **Author:** [%s](%s)\n", $extension->author, $extension->author_url ); |
|
9 | + if (isset($extension->author, $extension->author_url)) { |
|
10 | + printf(" * **Author:** [%s](%s)\n", $extension->author, $extension->author_url); |
|
11 | 11 | } |
12 | 12 | |
13 | - if ( isset( $extension->wp_org_url ) ) { |
|
14 | - printf( " * **WordPress.org:** [%s](%s)\n", $extension->wp_org_url, $extension->wp_org_url ); |
|
13 | + if (isset($extension->wp_org_url)) { |
|
14 | + printf(" * **WordPress.org:** [%s](%s)\n", $extension->wp_org_url, $extension->wp_org_url); |
|
15 | 15 | } |
16 | 16 | |
17 | - if ( isset( $extension->github_url ) ) { |
|
18 | - printf( " * **GitHub:** [%s](%s)\n", $extension->github_url, $extension->github_url ); |
|
17 | + if (isset($extension->github_url)) { |
|
18 | + printf(" * **GitHub:** [%s](%s)\n", $extension->github_url, $extension->github_url); |
|
19 | 19 | } |
20 | 20 | |
21 | - if ( isset( $extension->requires_at_least ) ) { |
|
22 | - printf( " * **Requires at least:** %s\n", $extension->requires_at_least ); |
|
21 | + if (isset($extension->requires_at_least)) { |
|
22 | + printf(" * **Requires at least:** %s\n", $extension->requires_at_least); |
|
23 | 23 | } |
24 | 24 | |
25 | - if ( isset( $extension->tested_up_to ) ) { |
|
26 | - printf( " * **Tested up to:** %s\n", $extension->tested_up_to ); |
|
25 | + if (isset($extension->tested_up_to)) { |
|
26 | + printf(" * **Tested up to:** %s\n", $extension->tested_up_to); |
|
27 | 27 | } |
28 | 28 | } |
@@ -1,45 +1,45 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$data = file_get_contents( __DIR__ . '/../changelog.json' ); |
|
4 | -$changelog = json_decode( $data ); |
|
3 | +$data = file_get_contents(__DIR__ . '/../changelog.json'); |
|
4 | +$changelog = json_decode($data); |
|
5 | 5 | |
6 | -function render_changes( $changes, $level = 0 ) { |
|
6 | +function render_changes($changes, $level = 0) { |
|
7 | 7 | $indent = $level * 1; |
8 | 8 | |
9 | - if ( is_string( $changes ) ) { |
|
10 | - echo str_repeat( "\t", $indent ), '*', "\t", $changes, "\r\n"; |
|
11 | - } elseif ( is_array( $changes ) ) { |
|
12 | - foreach ( $changes as $change ) { |
|
13 | - render_changes( $change, $level ); |
|
9 | + if (is_string($changes)) { |
|
10 | + echo str_repeat("\t", $indent), '*', "\t", $changes, "\r\n"; |
|
11 | + } elseif (is_array($changes)) { |
|
12 | + foreach ($changes as $change) { |
|
13 | + render_changes($change, $level); |
|
14 | 14 | } |
15 | - } elseif ( is_object( $changes ) ) { |
|
16 | - if ( isset( $changes->name ) ) { |
|
15 | + } elseif (is_object($changes)) { |
|
16 | + if (isset($changes->name)) { |
|
17 | 17 | // Changes group |
18 | 18 | //echo '### ', $changes->name, "\r\n"; |
19 | 19 | |
20 | - if ( isset( $changes->changes ) ) { |
|
21 | - render_changes( $changes->changes, $level ); |
|
20 | + if (isset($changes->changes)) { |
|
21 | + render_changes($changes->changes, $level); |
|
22 | 22 | } |
23 | 23 | } else { |
24 | - if ( isset( $changes->description ) ) { |
|
25 | - render_changes( $changes->description, $level ); |
|
24 | + if (isset($changes->description)) { |
|
25 | + render_changes($changes->description, $level); |
|
26 | 26 | } |
27 | 27 | |
28 | - if ( isset( $changes->changes ) ) { |
|
29 | - render_changes( $changes->changes, $level + 1 ); |
|
28 | + if (isset($changes->changes)) { |
|
29 | + render_changes($changes->changes, $level + 1); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | -foreach ( $changelog as $log ) { |
|
36 | - if ( 'Unreleased' === $log->version ) { |
|
35 | +foreach ($changelog as $log) { |
|
36 | + if ('Unreleased' === $log->version) { |
|
37 | 37 | continue; |
38 | 38 | } |
39 | 39 | |
40 | 40 | echo '= ', $log->version, ' - ', $log->date, ' =', "\r\n"; |
41 | 41 | |
42 | - render_changes( $log->changes ); |
|
42 | + render_changes($log->changes); |
|
43 | 43 | |
44 | 44 | echo "\r\n"; |
45 | 45 | } |
@@ -1,36 +1,36 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$data = file_get_contents( __DIR__ . '/../providers.json' ); |
|
4 | -$data = json_decode( $data ); |
|
3 | +$data = file_get_contents(__DIR__ . '/../providers.json'); |
|
4 | +$data = json_decode($data); |
|
5 | 5 | |
6 | 6 | $providers = array(); |
7 | -foreach ( $data as $provider ) { |
|
8 | - $providers[ $provider->slug ] = $provider; |
|
7 | +foreach ($data as $provider) { |
|
8 | + $providers[$provider->slug] = $provider; |
|
9 | 9 | } |
10 | 10 | |
11 | -$data = file_get_contents( __DIR__ . '/../gateways.json' ); |
|
12 | -$gateways = json_decode( $data ); |
|
11 | +$data = file_get_contents(__DIR__ . '/../gateways.json'); |
|
12 | +$gateways = json_decode($data); |
|
13 | 13 | |
14 | -foreach ( $gateways as $gateway ) { |
|
15 | - if ( isset( $providers[ $gateway->provider ] ) ) { |
|
16 | - $provider = $providers[ $gateway->provider ]; |
|
14 | +foreach ($gateways as $gateway) { |
|
15 | + if (isset($providers[$gateway->provider])) { |
|
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 | |
22 | - $provider->gateways[ $gateway->slug ] = $gateway; |
|
22 | + $provider->gateways[$gateway->slug] = $gateway; |
|
23 | 23 | } |
24 | 24 | } |
25 | 25 | |
26 | -foreach ( $providers as $provider ) { |
|
27 | - if ( isset( $provider->url ) ) { |
|
28 | - printf( "* [%s](%s)\n", $provider->name, $provider->url ); |
|
26 | +foreach ($providers as $provider) { |
|
27 | + if (isset($provider->url)) { |
|
28 | + printf("* [%s](%s)\n", $provider->name, $provider->url); |
|
29 | 29 | } else { |
30 | - printf( "* %s\n", $provider->name ); |
|
30 | + printf("* %s\n", $provider->name); |
|
31 | 31 | } |
32 | 32 | |
33 | - foreach ( $provider->gateways as $gateway ) { |
|
34 | - printf( " * %s\n", $gateway->name ); |
|
33 | + foreach ($provider->gateways as $gateway) { |
|
34 | + printf(" * %s\n", $gateway->name); |
|
35 | 35 | } |
36 | 36 | } |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -header( 'Content-Type: text/plain' ); |
|
3 | +header('Content-Type: text/plain'); |
|
4 | 4 | |
5 | -$data = file_get_contents( __DIR__ . '/../../package.json' ); |
|
6 | -$pkg = json_decode( $data ); |
|
5 | +$data = file_get_contents(__DIR__ . '/../../package.json'); |
|
6 | +$pkg = json_decode($data); |
|
7 | 7 | |
8 | 8 | ?> |
9 | 9 | === Pronamic Pay === |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -header( 'Content-Type: text/plain' ); |
|
3 | +header('Content-Type: text/plain'); |
|
4 | 4 | |
5 | 5 | ?> |
6 | 6 | # [Pronamic Pay](https://www.pronamic.eu/plugins/pronamic-ideal/) |