@@ -261,14 +261,14 @@ |
||
| 261 | 261 | private function fill_values( $values, &$new_values ) { |
| 262 | 262 | $defaults = $this->get_defaults(); |
| 263 | 263 | foreach ( $defaults as $val => $default ) { |
| 264 | - if ( isset( $values[ $val ] ) ) { |
|
| 264 | + if ( isset( $values[$val] ) ) { |
|
| 265 | 265 | if ( $default['sanitize'] === 'float' ) { |
| 266 | - $new_values[ $val ] = (float) $values[ $val ]; |
|
| 266 | + $new_values[$val] = (float) $values[$val]; |
|
| 267 | 267 | } elseif ( ! empty( $default['sanitize'] ) ) { |
| 268 | - $new_values[ $val ] = call_user_func( $default['sanitize'], $values[ $val ] ); |
|
| 268 | + $new_values[$val] = call_user_func( $default['sanitize'], $values[$val] ); |
|
| 269 | 269 | } |
| 270 | 270 | } elseif ( $values['action'] === 'create' ) { |
| 271 | - $new_values[ $val ] = $default['default']; |
|
| 271 | + $new_values[$val] = $default['default']; |
|
| 272 | 272 | } |
| 273 | 273 | } |
| 274 | 274 | } |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | 'canceled' => __( 'Canceled', 'formidable' ), |
| 70 | 70 | 'confirm' => __( 'Are you sure you want to cancel that subscription?', 'formidable' ), |
| 71 | 71 | ); |
| 72 | - $atts = array_merge( $defaults, $atts ); |
|
| 72 | + $atts = array_merge( $defaults, $atts ); |
|
| 73 | 73 | |
| 74 | 74 | if ( $sub->status === 'active' ) { |
| 75 | 75 | $link = admin_url( 'admin-ajax.php?action=frm_trans_cancel&sub=' . $sub->id . '&nonce=' . wp_create_nonce( 'frm_trans_ajax' ) ); |
@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | * @return array|false |
| 24 | 24 | */ |
| 25 | 25 | public static function get_details_for_form( $form_id ) { |
| 26 | - if ( ! isset( self::$details_by_form_id[ $form_id ] ) ) { |
|
| 26 | + if ( ! isset( self::$details_by_form_id[$form_id] ) ) { |
|
| 27 | 27 | self::set_details_for_form( (int) $form_id ); |
| 28 | 28 | } |
| 29 | - return isset( self::$details_by_form_id[ $form_id ] ) ? self::$details_by_form_id[ $form_id ] : false; |
|
| 29 | + return isset( self::$details_by_form_id[$form_id] ) ? self::$details_by_form_id[$form_id] : false; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | return; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - self::$details_by_form_id[ $form_id ] = array( |
|
| 90 | + self::$details_by_form_id[$form_id] = array( |
|
| 91 | 91 | 'entry' => $entry, |
| 92 | 92 | 'intent' => $intent, |
| 93 | 93 | 'payment' => $payment, |
@@ -16,10 +16,10 @@ |
||
| 16 | 16 | public static function get_currency( $currency ) { |
| 17 | 17 | $currency = strtoupper( $currency ); |
| 18 | 18 | $currencies = self::get_currencies(); |
| 19 | - if ( isset( $currencies[ $currency ] ) ) { |
|
| 20 | - $currency = $currencies[ $currency ]; |
|
| 21 | - } elseif ( isset( $currencies[ strtolower( $currency ) ] ) ) { |
|
| 22 | - $currency = $currencies[ strtolower( $currency ) ]; |
|
| 19 | + if ( isset( $currencies[$currency] ) ) { |
|
| 20 | + $currency = $currencies[$currency]; |
|
| 21 | + } elseif ( isset( $currencies[strtolower( $currency )] ) ) { |
|
| 22 | + $currency = $currencies[strtolower( $currency )]; |
|
| 23 | 23 | } else { |
| 24 | 24 | $currency = $currencies['USD']; |
| 25 | 25 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | 'page' => '', |
| 46 | 46 | 'class' => 'frm-mt-0', |
| 47 | 47 | ); |
| 48 | - $tip = array_merge( $defaults, $tip ); |
|
| 48 | + $tip = array_merge( $defaults, $tip ); |
|
| 49 | 49 | |
| 50 | 50 | if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) { |
| 51 | 51 | $tip['link']['medium'] = 'tip'; |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | * @return array |
| 373 | 373 | */ |
| 374 | 374 | public static function get_banner_tip() { |
| 375 | - $tips = array( |
|
| 375 | + $tips = array( |
|
| 376 | 376 | array( |
| 377 | 377 | 'link' => array( |
| 378 | 378 | 'medium' => 'banner', |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | ), |
| 400 | 400 | ); |
| 401 | 401 | $random = rand( 0, count( $tips ) - 1 ); |
| 402 | - $tip = $tips[ $random ]; |
|
| 402 | + $tip = $tips[$random]; |
|
| 403 | 403 | $tip['num'] = $random; |
| 404 | 404 | |
| 405 | 405 | return $tip; |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | public static function get_random_tip( $tips ) { |
| 409 | 409 | $random = rand( 0, count( $tips ) - 1 ); |
| 410 | 410 | |
| 411 | - return $tips[ $random ]; |
|
| 411 | + return $tips[$random]; |
|
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | /** |
@@ -126,11 +126,11 @@ |
||
| 126 | 126 | foreach ( $payments as $payment ) { |
| 127 | 127 | list( $amount, $currency ) = FrmTransLiteAppHelper::get_amount_and_currency_from_payment( $payment ); |
| 128 | 128 | |
| 129 | - if ( ! isset( $data[ $currency ] ) ) { |
|
| 130 | - $data[ $currency ] = 0; |
|
| 129 | + if ( ! isset( $data[$currency] ) ) { |
|
| 130 | + $data[$currency] = 0; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - $data[ $currency ] += floatval( $amount ); |
|
| 133 | + $data[$currency] += floatval( $amount ); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | return $data; |
@@ -236,11 +236,11 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | public static function get_last_sent_date( $type ) { |
| 238 | 238 | $options = self::get_options(); |
| 239 | - if ( empty( $options[ 'last_' . $type ] ) ) { |
|
| 239 | + if ( empty( $options['last_' . $type] ) ) { |
|
| 240 | 240 | return false; |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - return $options[ 'last_' . $type ]; |
|
| 243 | + return $options['last_' . $type]; |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | public static function set_last_sent_date( $type, $value = null ) { |
| 253 | 253 | $options = self::get_options(); |
| 254 | 254 | |
| 255 | - $options[ 'last_' . $type ] = null === $value ? self::get_date_from_today() : ''; |
|
| 255 | + $options['last_' . $type] = null === $value ? self::get_date_from_today() : ''; |
|
| 256 | 256 | self::save_options( $options ); |
| 257 | 257 | } |
| 258 | 258 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | 'user_id' => get_current_user_id(), |
| 109 | 109 | 'frm_strp_connect_mode' => $mode, |
| 110 | 110 | ); |
| 111 | - $data = self::post_to_connect_server( 'initialize', $additional_body ); |
|
| 111 | + $data = self::post_to_connect_server( 'initialize', $additional_body ); |
|
| 112 | 112 | |
| 113 | 113 | if ( is_string( $data ) ) { |
| 114 | 114 | return $data; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * @return object|string |
| 144 | 144 | */ |
| 145 | 145 | private static function post_to_connect_server( $action, $additional_body = array() ) { |
| 146 | - $body = array( |
|
| 146 | + $body = array( |
|
| 147 | 147 | 'frm_strp_connect_action' => $action, |
| 148 | 148 | 'frm_strp_connect_mode' => FrmStrpLiteAppHelper::active_mode(), |
| 149 | 149 | ); |
@@ -87,6 +87,6 @@ |
||
| 87 | 87 | |
| 88 | 88 | ?></div> |
| 89 | 89 | <?php |
| 90 | - ++$option_index; |
|
| 90 | + ++ $option_index; |
|
| 91 | 91 | }//end foreach |
| 92 | 92 | }//end if |