@@ -36,15 +36,15 @@ discard block |
||
36 | 36 | public function __construct( AdminModule $admin ) { |
37 | 37 | $this->admin = $admin; |
38 | 38 | |
39 | - add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( $this, 'edit_columns' ) ); |
|
39 | + add_filter( 'manage_edit-'.self::POST_TYPE.'_columns', array( $this, 'edit_columns' ) ); |
|
40 | 40 | |
41 | - add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 ); |
|
41 | + add_action( 'manage_'.self::POST_TYPE.'_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 ); |
|
42 | 42 | |
43 | 43 | add_action( 'post_edit_form_tag', array( $this, 'post_edit_form_tag' ) ); |
44 | 44 | |
45 | 45 | add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) ); |
46 | 46 | |
47 | - add_action( 'save_post_' . self::POST_TYPE, array( $this, 'save_post' ) ); |
|
47 | + add_action( 'save_post_'.self::POST_TYPE, array( $this, 'save_post' ) ); |
|
48 | 48 | |
49 | 49 | add_action( 'display_post_states', array( $this, 'display_post_states' ), 10, 2 ); |
50 | 50 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $name = __( 'Dashboard', 'pronamic_ideal' ); |
143 | 143 | } |
144 | 144 | |
145 | - $content[] = sprintf( |
|
145 | + $content[ ] = sprintf( |
|
146 | 146 | '<a href="%s" target="_blank">%s</a>', |
147 | 147 | esc_attr( $url ), |
148 | 148 | esc_html( ucfirst( $name ) ) |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | if ( intval( get_option( 'pronamic_pay_config_id' ) ) === $post->ID ) { |
171 | - $post_states['pronamic_pay_config_default'] = __( 'Default', 'pronamic_ideal' ); |
|
171 | + $post_states[ 'pronamic_pay_config_default' ] = __( 'Default', 'pronamic_ideal' ); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | return $post_states; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | public function meta_box_config( $post ) { |
230 | 230 | wp_nonce_field( 'pronamic_pay_save_gateway', 'pronamic_pay_nonce' ); |
231 | 231 | |
232 | - include Plugin::$dirname . '/admin/meta-box-gateway-config.php'; |
|
232 | + include Plugin::$dirname.'/admin/meta-box-gateway-config.php'; |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | /** |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | * @param WP_Post $post The object for the current post/page. |
239 | 239 | */ |
240 | 240 | public function meta_box_test( $post ) { |
241 | - include Plugin::$dirname . '/admin/meta-box-gateway-test.php'; |
|
241 | + include Plugin::$dirname.'/admin/meta-box-gateway-test.php'; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | */ |
249 | 249 | public function save_post( $post_id ) { |
250 | 250 | // Nonce. |
251 | - if ( ! filter_has_var( INPUT_POST, 'pronamic_pay_nonce' ) ) { |
|
251 | + if ( !filter_has_var( INPUT_POST, 'pronamic_pay_nonce' ) ) { |
|
252 | 252 | return $post_id; |
253 | 253 | } |
254 | 254 | |
@@ -268,9 +268,9 @@ discard block |
||
268 | 268 | ); |
269 | 269 | |
270 | 270 | foreach ( $fields as $field ) { |
271 | - if ( isset( $field['meta_key'], $field['filter'] ) ) { |
|
272 | - $name = $field['meta_key']; |
|
273 | - $filter = $field['filter']; |
|
271 | + if ( isset( $field[ 'meta_key' ], $field[ 'filter' ] ) ) { |
|
272 | + $name = $field[ 'meta_key' ]; |
|
273 | + $filter = $field[ 'filter' ]; |
|
274 | 274 | |
275 | 275 | $definition[ $name ] = $filter; |
276 | 276 | } |
@@ -278,28 +278,28 @@ discard block |
||
278 | 278 | |
279 | 279 | $data = filter_input_array( INPUT_POST, $definition ); |
280 | 280 | |
281 | - if ( ! empty( $data['_pronamic_gateway_id'] ) ) { |
|
281 | + if ( !empty( $data[ '_pronamic_gateway_id' ] ) ) { |
|
282 | 282 | $integrations = $this->admin->plugin->gateway_integrations; |
283 | 283 | |
284 | - if ( isset( $integrations[ $data['_pronamic_gateway_id'] ] ) ) { |
|
285 | - $integration = $integrations[ $data['_pronamic_gateway_id'] ]; |
|
284 | + if ( isset( $integrations[ $data[ '_pronamic_gateway_id' ] ] ) ) { |
|
285 | + $integration = $integrations[ $data[ '_pronamic_gateway_id' ] ]; |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | if ( $integration ) { |
289 | 289 | $settings = $integration->get_settings(); |
290 | 290 | |
291 | 291 | foreach ( $fields as $field ) { |
292 | - if ( isset( $field['default'], $field['meta_key'], $data[ $field['meta_key'] ] ) ) { |
|
292 | + if ( isset( $field[ 'default' ], $field[ 'meta_key' ], $data[ $field[ 'meta_key' ] ] ) ) { |
|
293 | 293 | // Remove default value if not applicable to the selected gateway. |
294 | - if ( isset( $field['methods'] ) ) { |
|
295 | - $clean_default = array_intersect( $settings, $field['methods'] ); |
|
294 | + if ( isset( $field[ 'methods' ] ) ) { |
|
295 | + $clean_default = array_intersect( $settings, $field[ 'methods' ] ); |
|
296 | 296 | |
297 | 297 | if ( empty( $clean_default ) ) { |
298 | - $meta_value = get_post_meta( $post_id, $field['meta_key'], true ); |
|
298 | + $meta_value = get_post_meta( $post_id, $field[ 'meta_key' ], true ); |
|
299 | 299 | |
300 | 300 | // Only remove value if not saved before. |
301 | 301 | if ( empty( $meta_value ) ) { |
302 | - $data[ $field['meta_key'] ] = null; |
|
302 | + $data[ $field[ 'meta_key' ] ] = null; |
|
303 | 303 | |
304 | 304 | continue; |
305 | 305 | } |
@@ -307,13 +307,13 @@ discard block |
||
307 | 307 | } |
308 | 308 | |
309 | 309 | // Set the default value if empty. |
310 | - if ( empty( $data[ $field['meta_key'] ] ) ) { |
|
311 | - $default = $field['default']; |
|
310 | + if ( empty( $data[ $field[ 'meta_key' ] ] ) ) { |
|
311 | + $default = $field[ 'default' ]; |
|
312 | 312 | |
313 | - if ( is_array( $default ) && 2 === count( $default ) && Util::class_method_exists( $default[0], $default[1] ) ) { |
|
314 | - $data[ $field['meta_key'] ] = call_user_func( $default, $field ); |
|
313 | + if ( is_array( $default ) && 2 === count( $default ) && Util::class_method_exists( $default[ 0 ], $default[ 1 ] ) ) { |
|
314 | + $data[ $field[ 'meta_key' ] ] = call_user_func( $default, $field ); |
|
315 | 315 | } else { |
316 | - $data[ $field['meta_key'] ] = $default; |
|
316 | + $data[ $field[ 'meta_key' ] ] = $default; |
|
317 | 317 | } |
318 | 318 | } |
319 | 319 | } |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | // Filter data through gateway integration settings. |
323 | 323 | $settings_classes = $integration->get_settings_class(); |
324 | 324 | |
325 | - if ( ! is_array( $settings_classes ) ) { |
|
325 | + if ( !is_array( $settings_classes ) ) { |
|
326 | 326 | $settings_classes = array( $settings_classes ); |
327 | 327 | } |
328 | 328 | |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | pronamic_pay_update_post_meta_data( $post_id, $data ); |
339 | 339 | |
340 | 340 | // Transient. |
341 | - delete_transient( 'pronamic_pay_issuers_' . $post_id ); |
|
341 | + delete_transient( 'pronamic_pay_issuers_'.$post_id ); |
|
342 | 342 | |
343 | 343 | \Pronamic\WordPress\Pay\Core\PaymentMethods::update_active_payment_methods(); |
344 | 344 | } |
@@ -362,14 +362,14 @@ discard block |
||
362 | 362 | 0 => '', // Unused. Messages start at index 1. |
363 | 363 | 1 => __( 'Configuration updated.', 'pronamic_ideal' ), |
364 | 364 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352799&filters[translation_id]=37947229 |
365 | - 2 => $messages['post'][2], |
|
365 | + 2 => $messages[ 'post' ][ 2 ], |
|
366 | 366 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352800&filters[translation_id]=37947870 |
367 | - 3 => $messages['post'][3], |
|
367 | + 3 => $messages[ 'post' ][ 3 ], |
|
368 | 368 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352798&filters[translation_id]=37947230 |
369 | 369 | 4 => __( 'Configuration updated.', 'pronamic_ideal' ), |
370 | 370 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352801&filters[translation_id]=37947231 |
371 | 371 | // translators: %s: date and time of the revision. |
372 | - 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Configuration restored to revision from %s.', 'pronamic_ideal' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, // WPCS: CSRF ok. |
|
372 | + 5 => isset( $_GET[ 'revision' ] ) ? sprintf( __( 'Configuration restored to revision from %s.', 'pronamic_ideal' ), wp_post_revision_title( (int) $_GET[ 'revision' ], false ) ) : false, // WPCS: CSRF ok. |
|
373 | 373 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352802&filters[translation_id]=37949178 |
374 | 374 | 6 => __( 'Configuration published.', 'pronamic_ideal' ), |
375 | 375 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352803&filters[translation_id]=37947232 |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352804&filters[translation_id]=37949303 |
378 | 378 | 8 => __( 'Configuration submitted.', 'pronamic_ideal' ), |
379 | 379 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352805&filters[translation_id]=37949302 |
380 | - 9 => sprintf( __( 'Configuration scheduled for: %s.', 'pronamic_ideal' ), '<strong>' . $scheduled_date . '</strong>' ), |
|
380 | + 9 => sprintf( __( 'Configuration scheduled for: %s.', 'pronamic_ideal' ), '<strong>'.$scheduled_date.'</strong>' ), |
|
381 | 381 | // @https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352806&filters[translation_id]=37949301 |
382 | 382 | 10 => __( 'Configuration draft updated.', 'pronamic_ideal' ), |
383 | 383 | ); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | update_user_meta( get_current_user_id(), 'pronamic_pay_ignore_tour', $ignore ); |
47 | 47 | } |
48 | 48 | |
49 | - if ( ! get_user_meta( get_current_user_id(), 'pronamic_pay_ignore_tour', true ) ) { |
|
49 | + if ( !get_user_meta( get_current_user_id(), 'pronamic_pay_ignore_tour', true ) ) { |
|
50 | 50 | add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); |
51 | 51 | } |
52 | 52 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | // Pointers. |
61 | 61 | wp_register_style( |
62 | 62 | 'proanmic-pay-admin-tour', |
63 | - plugins_url( 'css/admin-tour' . $min . '.css', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
63 | + plugins_url( 'css/admin-tour'.$min.'.css', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
64 | 64 | array( |
65 | 65 | 'wp-pointer', |
66 | 66 | ), |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | wp_register_script( |
71 | 71 | 'proanmic-pay-admin-tour', |
72 | - plugins_url( 'js/admin-tour' . $min . '.js', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
72 | + plugins_url( 'js/admin-tour'.$min.'.js', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
73 | 73 | array( |
74 | 74 | 'jquery', |
75 | 75 | 'wp-pointer', |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | private function get_content( $file ) { |
101 | 101 | $content = ''; |
102 | 102 | |
103 | - $path = plugin_dir_path( \Pronamic\WordPress\Pay\Plugin::$file ) . 'admin/' . $file . '.php'; |
|
103 | + $path = plugin_dir_path( \Pronamic\WordPress\Pay\Plugin::$file ).'admin/'.$file.'.php'; |
|
104 | 104 | |
105 | 105 | if ( is_readable( $path ) ) { |
106 | 106 | ob_start(); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | // @see https://en.wikipedia.org/wiki/Non-breaking_space#Keyboard_entry_methods |
189 | 189 | $non_breaking_space = ' '; |
190 | 190 | |
191 | - return '' . $currency_symbol . $non_breaking_space . number_format_i18n( $float, 2 ); |
|
191 | + return ''.$currency_symbol.$non_breaking_space.number_format_i18n( $float, 2 ); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | /** |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | * @return string |
267 | 267 | */ |
268 | 268 | public static function build_url( $url, array $parameters ) { |
269 | - return $url . '?' . _http_build_query( $parameters, null, '&' ); |
|
269 | + return $url.'?'._http_build_query( $parameters, null, '&' ); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -318,14 +318,14 @@ discard block |
||
318 | 318 | |
319 | 319 | if ( is_array( $groups ) ) { |
320 | 320 | foreach ( $groups as $group ) { |
321 | - $optgroup = isset( $group['name'] ) && ! empty( $group['name'] ); |
|
321 | + $optgroup = isset( $group[ 'name' ] ) && !empty( $group[ 'name' ] ); |
|
322 | 322 | |
323 | 323 | if ( $optgroup ) { |
324 | - $html .= '<optgroup label="' . $group['name'] . '">'; |
|
324 | + $html .= '<optgroup label="'.$group[ 'name' ].'">'; |
|
325 | 325 | } |
326 | 326 | |
327 | - foreach ( $group['options'] as $value => $label ) { |
|
328 | - $html .= '<option value="' . $value . '" ' . selected( $selected_value, $value, false ) . '>' . $label . '</option>'; |
|
327 | + foreach ( $group[ 'options' ] as $value => $label ) { |
|
328 | + $html .= '<option value="'.$value.'" '.selected( $selected_value, $value, false ).'>'.$label.'</option>'; |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | if ( $optgroup ) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | add_action( 'init', array( $this, 'register_gateway_post_type' ), 0 ); // Highest priority. |
41 | 41 | |
42 | - add_action( 'save_post_' . self::POST_TYPE, array( $this, 'maybe_set_default_gateway' ) ); |
|
42 | + add_action( 'save_post_'.self::POST_TYPE, array( $this, 'maybe_set_default_gateway' ) ); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | // Don't set the default gateway if there is already a published gateway set. |
103 | 103 | $config_id = get_option( 'pronamic_pay_config_id' ); |
104 | 104 | |
105 | - if ( ! empty( $config_id ) && 'publish' === get_post_status( $config_id ) ) { |
|
105 | + if ( !empty( $config_id ) && 'publish' === get_post_status( $config_id ) ) { |
|
106 | 106 | return; |
107 | 107 | } |
108 | 108 |
@@ -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 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | public function test_construct() { |
27 | 27 | $payment = new Payment(); |
28 | 28 | |
29 | - $this->assertInstanceOf( __NAMESPACE__ . '\Payment', $payment ); |
|
29 | + $this->assertInstanceOf( __NAMESPACE__.'\Payment', $payment ); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |