@@ -47,16 +47,20 @@ |
||
| 47 | 47 | // Provider. |
| 48 | 48 | if ( count( $name ) > 1 ) : |
| 49 | 49 | $provider = array_shift( $name ); |
| 50 | - else : |
|
| 50 | + else { |
|
| 51 | + : |
|
| 51 | 52 | $provider_name = explode( '(', $name[0] ); |
| 53 | + } |
|
| 52 | 54 | |
| 53 | 55 | $provider = array_shift( $provider_name ); |
| 54 | 56 | endif; |
| 55 | 57 | |
| 56 | 58 | if ( $current_provider === $integration->provider ) : |
| 57 | 59 | $provider = ''; |
| 58 | - else : |
|
| 60 | + else { |
|
| 61 | + : |
|
| 59 | 62 | $current_provider = $integration->provider; |
| 63 | + } |
|
| 60 | 64 | |
| 61 | 65 | $alternate = ! $alternate; |
| 62 | 66 | endif; |
@@ -37,9 +37,9 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | foreach ( $pronamic_pay_providers as $provider ) : |
| 39 | 39 | |
| 40 | - if ( isset( $provider['integrations'] ) && is_array( $provider['integrations'] ) ) : |
|
| 40 | + if ( isset( $provider[ 'integrations' ] ) && is_array( $provider[ 'integrations' ] ) ) : |
|
| 41 | 41 | |
| 42 | - foreach ( $provider['integrations'] as $integration ) : |
|
| 42 | + foreach ( $provider[ 'integrations' ] as $integration ) : |
|
| 43 | 43 | $name = $integration->get_name(); |
| 44 | 44 | |
| 45 | 45 | $name = explode( ' - ', $name ); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | if ( count( $name ) > 1 ) : |
| 49 | 49 | $provider = array_shift( $name ); |
| 50 | 50 | else : |
| 51 | - $provider_name = explode( '(', $name[0] ); |
|
| 51 | + $provider_name = explode( '(', $name[ 0 ] ); |
|
| 52 | 52 | |
| 53 | 53 | $provider = array_shift( $provider_name ); |
| 54 | 54 | endif; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | else : |
| 59 | 59 | $current_provider = $integration->provider; |
| 60 | 60 | |
| 61 | - $alternate = ! $alternate; |
|
| 61 | + $alternate = !$alternate; |
|
| 62 | 62 | endif; |
| 63 | 63 | |
| 64 | 64 | $name = implode( '', $name ); |
@@ -90,10 +90,13 @@ |
||
| 90 | 90 | </tr> |
| 91 | 91 | </table> |
| 92 | 92 | |
| 93 | -<?php else : ?> |
|
| 93 | +<?php else { |
|
| 94 | + : ?> |
|
| 94 | 95 | |
| 95 | 96 | <p> |
| 96 | - <?php esc_html_e( 'This payment is not related to a subscription.', 'pronamic_ideal' ); ?> |
|
| 97 | + <?php esc_html_e( 'This payment is not related to a subscription.', 'pronamic_ideal' ); |
|
| 98 | +} |
|
| 99 | +?> |
|
| 97 | 100 | </p> |
| 98 | 101 | |
| 99 | 102 | <?php endif; ?> |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | * @param Item $item The item to add. |
| 50 | 50 | */ |
| 51 | 51 | public function addItem( Item $item ) { |
| 52 | - $this->items[] = $item; |
|
| 52 | + $this->items[ ] = $item; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -28,23 +28,23 @@ |
||
| 28 | 28 | <td> |
| 29 | 29 | <?php |
| 30 | 30 | |
| 31 | - if ( isset( $method['icon'] ) ) { |
|
| 32 | - printf( '<img src="%s" alt="" />', esc_attr( $method['icon'] ) ); |
|
| 31 | + if ( isset( $method[ 'icon' ] ) ) { |
|
| 32 | + printf( '<img src="%s" alt="" />', esc_attr( $method[ 'icon' ] ) ); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | ?> |
| 36 | 36 | </td> |
| 37 | 37 | <td> |
| 38 | - <?php echo esc_html( $method['name'] ); ?> |
|
| 38 | + <?php echo esc_html( $method[ 'name' ] ); ?> |
|
| 39 | 39 | </td> |
| 40 | 40 | <td> |
| 41 | 41 | <?php |
| 42 | 42 | |
| 43 | - if ( isset( $method['url'] ) ) { |
|
| 43 | + if ( isset( $method[ 'url' ] ) ) { |
|
| 44 | 44 | printf( |
| 45 | 45 | '<a href="%s" target="_blank">%s</a>', |
| 46 | - esc_attr( $method['url'] ), |
|
| 47 | - esc_html( $method['url'] ) |
|
| 46 | + esc_attr( $method[ 'url' ] ), |
|
| 47 | + esc_html( $method[ 'url' ] ) |
|
| 48 | 48 | ); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | sprintf( |
| 67 | 67 | /* translators: %s: formatted amount */ |
| 68 | 68 | __( 'Transaction with <code>amount</code> = %s:', 'pronamic_ideal' ), |
| 69 | - esc_html( IDeal::format_amount( $data['amount'] ) ) |
|
| 69 | + esc_html( IDeal::format_amount( $data[ 'amount' ] ) ) |
|
| 70 | 70 | ), |
| 71 | 71 | array( |
| 72 | 72 | 'code' => array(), |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | ?> |
| 77 | 77 | </td> |
| 78 | 78 | <td> |
| 79 | - <?php echo esc_html( $data['result'] ); ?> |
|
| 79 | + <?php echo esc_html( $data[ 'result' ] ); ?> |
|
| 80 | 80 | </td> |
| 81 | 81 | </tr> |
| 82 | 82 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | <?php $eshop_metabox_plugin->show_img( 'pronamic_ideal' ); ?> |
| 16 | 16 | |
| 17 | 17 | <p class="cbox"> |
| 18 | - <input id="eshop_method_pronamic_ideal" name="eshop_method[]" type="checkbox" value="pronamic_ideal" <?php checked( in_array( 'pronamic_ideal', (array) $eshopoptions['method'], true ) ); ?> /> |
|
| 18 | + <input id="eshop_method_pronamic_ideal" name="eshop_method[]" type="checkbox" value="pronamic_ideal" <?php checked( in_array( 'pronamic_ideal', (array) $eshopoptions[ 'method' ], true ) ); ?> /> |
|
| 19 | 19 | |
| 20 | 20 | <label for="eshop_method_pronamic_ideal" class="eshopmethod"> |
| 21 | 21 | <?php esc_html_e( 'Accept payment by iDEAL', 'pronamic_ideal' ); ?> |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | \Pronamic\WordPress\Pay\Admin\AdminModule::dropdown_configs( array( |
| 32 | 32 | 'name' => 'eshop_pronamic_ideal_config_id', |
| 33 | - 'selected' => @$eshopoptions['pronamic_ideal']['config_id'], |
|
| 33 | + 'selected' => @$eshopoptions[ 'pronamic_ideal' ][ 'config_id' ], |
|
| 34 | 34 | ) ); |
| 35 | 35 | |
| 36 | 36 | ?> |
@@ -31,7 +31,7 @@ discard block |
||
| 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 | 36 | <h2 class="pronamic-pay-form-title"><?php echo esc_html( get_the_title( $id ) ); ?></h2> |
| 37 | 37 | |
@@ -52,7 +52,7 @@ discard block |
||
| 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 | 57 | $decimals = ( $amount % 100 > 0 ? 2 : 0 ); |
| 58 | 58 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | ?> |
| 141 | 141 | |
| 142 | - <?php if ( ! empty( $fields ) ) : ?> |
|
| 142 | + <?php if ( !empty( $fields ) ) : ?> |
|
| 143 | 143 | |
| 144 | 144 | <fieldset> |
| 145 | 145 | <legend><?php esc_html_e( 'Payment Info', 'pronamic_ideal' ); ?></legend> |
@@ -147,15 +147,15 @@ discard block |
||
| 147 | 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,7 +167,7 @@ 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 | |
@@ -2,18 +2,18 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | $root_dir = dirname( __DIR__ ); |
| 4 | 4 | |
| 5 | -$data = file_get_contents( $root_dir . '/package.json' ); |
|
| 5 | +$data = file_get_contents( $root_dir.'/package.json' ); |
|
| 6 | 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 | 14 | $search_string = sprintf( 'Stable tag: %s', $pkg->version ); |
| 15 | 15 | |
| 16 | -if ( ! in_array( $search_string, $readme_txt_lines, true ) ) { |
|
| 16 | +if ( !in_array( $search_string, $readme_txt_lines, true ) ) { |
|
| 17 | 17 | printf( '❌ ' ); |
| 18 | 18 | printf( 'Could not find "%s" in file "%s".', $search_string, $filename ); |
| 19 | 19 | |
@@ -30,7 +30,7 @@ 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 | |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | foreach ( $tokens as $token ) { |
| 40 | 40 | if ( is_array( $token ) ) { |
| 41 | - $type = $token[0]; |
|
| 42 | - $value = $token[1]; |
|
| 43 | - $line = $token[2]; |
|
| 41 | + $type = $token[ 0 ]; |
|
| 42 | + $value = $token[ 1 ]; |
|
| 43 | + $line = $token[ 2 ]; |
|
| 44 | 44 | |
| 45 | 45 | if ( in_array( $type, array( T_COMMENT, T_DOC_COMMENT ), true ) && false !== strpos( $value, 'Plugin Name' ) ) { |
| 46 | 46 | $file_header = $value; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | $search_string = sprintf( 'Version: %s', $pkg->version ); |
| 60 | 60 | |
| 61 | -if ( ! in_array( $search_string, $file_header_lines, true ) ) { |
|
| 61 | +if ( !in_array( $search_string, $file_header_lines, true ) ) { |
|
| 62 | 62 | printf( '❌ ' ); |
| 63 | 63 | printf( 'Could not find "%s" in file "%s".', $search_string, $filename ); |
| 64 | 64 | |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | $working_dir = getcwd(); |
| 4 | 4 | $project_dir = dirname( __DIR__ ); |
| 5 | -$repositories_dir = $project_dir . '/repositories'; |
|
| 5 | +$repositories_dir = $project_dir.'/repositories'; |
|
| 6 | 6 | |
| 7 | 7 | $organisations = array( |
| 8 | 8 | 'wp-pay' => array( |
@@ -61,20 +61,20 @@ discard block |
||
| 61 | 61 | $repository |
| 62 | 62 | ); |
| 63 | 63 | |
| 64 | - $git_dir = $repositories_dir . '/' . $organisation . '/' . $repository; |
|
| 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 | 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; |