Skip to content

Commit

Permalink
else if -> elseif
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisnissle committed Mar 31, 2017
1 parent 72d004e commit 4a50506
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions includes/abstracts/abstract-wc-gzd-compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public function __construct( $plugin_name, $plugin_file, $version_data = array()
if ( empty( $version_data[ 'requires_at_least' ] ) && empty( $version_data[ 'tested_up_to' ] ) ) {
$version_data[ 'requires_at_least' ] = $version_data[ 'version' ];
$version_data[ 'tested_up_to' ] = $version_data[ 'version' ];
} else if ( empty( $version_data[ 'tested_up_to' ] ) ) {
} elseif ( empty( $version_data[ 'tested_up_to' ] ) ) {
$version_data[ 'tested_up_to' ] = $version_data[ 'requires_at_least' ];
if ( wc_gzd_get_dependencies()->compare_versions( $version_data[ 'version' ], $version_data[ 'requires_at_least' ], '>' ) )
$version_data[ 'tested_up_to' ] = $version_data[ 'version' ];
} else if ( empty( $version_data[ 'requires_at_least' ] ) ) {
} elseif ( empty( $version_data[ 'requires_at_least' ] ) ) {
$version_data[ 'requires_at_least' ] = $version_data[ 'tested_up_to' ];
if ( wc_gzd_get_dependencies()->compare_versions( $version_data[ 'version' ], $version_data[ 'requires_at_least' ], '<' ) )
$version_data[ 'requires_at_least' ] = $version_data[ 'version' ];
Expand Down
6 changes: 3 additions & 3 deletions includes/abstracts/abstract-wc-gzd-product.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function __get( $key ) {
if ( '' === $value )
$value = $this->gzd_variation_level_meta[ $key ];

} else if ( $this->child->is_type( 'variation' ) && in_array( $key, $this->gzd_variation_inherited_meta_data ) ) {
} elseif ( $this->child->is_type( 'variation' ) && in_array( $key, $this->gzd_variation_inherited_meta_data ) ) {

$value = wc_gzd_get_crud_data( $this->child, $key ) ? wc_gzd_get_crud_data( $this->child, $key ) : '';

Expand All @@ -80,7 +80,7 @@ public function __get( $key ) {
$value = wc_gzd_get_crud_data( wc_get_product( wc_gzd_get_crud_data( $this->child, 'parent' ) ), $key );
}

} else if ( $key == 'delivery_time' ) {
} elseif ( $key == 'delivery_time' ) {

$value = $this->get_delivery_time();

Expand All @@ -104,7 +104,7 @@ public function __get( $key ) {
public function __isset( $key ) {
if ( $this->child->is_type( 'variation' ) && in_array( $key, array_keys( $this->gzd_variation_level_meta ) ) ) {
return metadata_exists( 'post', wc_gzd_get_crud_data( $this->child, 'id' ), '_' . $key );
} else if ( $this->child->is_type( 'variation' ) && in_array( $key, array_keys( $this->gzd_variation_inherited_meta_data ) ) ) {
} elseif ( $this->child->is_type( 'variation' ) && in_array( $key, array_keys( $this->gzd_variation_inherited_meta_data ) ) ) {
return metadata_exists( 'post', wc_gzd_get_crud_data( $this->child, 'id' ), '_' . $key ) || metadata_exists( 'post', wc_gzd_get_crud_data( $this->child, 'parent' ), '_' . $key );
} else {
return metadata_exists( 'post', wc_gzd_get_crud_data( $this->child, 'id' ), '_' . $key );
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/class-wc-gzd-admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public function add_notices() {

if ( ! $this->is_theme_compatible() )
add_action( 'admin_notices', array( $this, 'theme_incompatibility_notice' ) );
else if ( $this->is_theme_supported_by_pro() )
elseif ( $this->is_theme_supported_by_pro() )
add_action( 'admin_notices', array( $this, 'theme_supported_notice' ) );
else if ( ! $this->is_theme_ready() )
elseif ( ! $this->is_theme_ready() )
add_action( 'admin_notices', array( $this, 'theme_not_ready_notice' ) );

}
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/class-wc-gzd-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function check_tour_hide() {

wp_safe_redirect( remove_query_arg( array( 'hide', 'tour', '_wpnonce' ) ) );

} else if ( isset( $_GET[ 'tour' ] ) && isset( $_GET[ 'enable' ] ) && isset( $_GET[ '_wpnonce' ] ) && check_admin_referer( 'wc-gzd-tour-enable' ) ) {
} elseif ( isset( $_GET[ 'tour' ] ) && isset( $_GET[ 'enable' ] ) && isset( $_GET[ '_wpnonce' ] ) && check_admin_referer( 'wc-gzd-tour-enable' ) ) {

$setting_sections = array_merge( array(
'general' => '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ public function before_save( $settings ) {
update_option( 'woocommerce_calc_taxes', 'yes' );
update_option( 'woocommerce_prices_include_tax', 'yes' );
}
} else if ( $setting[ 'id' ] == 'woocommerce_gzd_enable_virtual_vat' ) {
} elseif ( $setting[ 'id' ] == 'woocommerce_gzd_enable_virtual_vat' ) {
if ( get_option( 'woocommerce_gzd_enable_virtual_vat' ) != 'yes' && ! empty( $_POST[ 'woocommerce_gzd_enable_virtual_vat' ] ) ) {
if ( ! empty( $_POST[ 'woocommerce_gzd_small_enterprise' ] ) )
continue;
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/views/html-page-status-germanized.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
foreach ( $rates as $rate ) {
if ( ! isset( $tax_rate_names[ $rate->tax_rate_name ] ) )
$tax_rate_names[ $rate->tax_rate_name ] = $rate;
else if ( $tax_rate_names[ $rate->tax_rate_name ]->tax_rate_class != $rate->tax_rate_class )
elseif ( $tax_rate_names[ $rate->tax_rate_name ]->tax_rate_class != $rate->tax_rate_class )
array_push( $collisions, array( $tax_rate_names[ $rate->tax_rate_name ], $rate ) );

}
Expand Down
2 changes: 1 addition & 1 deletion includes/api/class-wc-gzd-rest-products-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ public function save_update_product_data( $request, $product ) {

if ( isset( $data[ '_unit_price_auto' ] ) && ! empty( $data[ '_unit_price_auto' ] ) )
$data[ '_unit_price_auto' ] = true;
else if ( empty( $data[ '_unit_price_auto' ] ) )
elseif ( empty( $data[ '_unit_price_auto' ] ) )
unset( $data[ '_unit_price_auto' ] );
else
$data[ '_unit_price_auto' ] = get_post_meta( $real_product_id, '_unit_price_auto', true );
Expand Down
4 changes: 2 additions & 2 deletions includes/class-wc-gzd-customer-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ public function disable_checkout() {
// Disable registration
WC()->session->set( 'disable_checkout_signup', true );

} else if ( ! WC()->session->get( 'disable_checkout_signup' ) ) {
} elseif ( ! WC()->session->get( 'disable_checkout_signup' ) ) {

if ( is_checkout() && ( ! is_user_logged_in() || ! wc_gzd_is_customer_activated() ) ) {

WC()->session->set( 'login_redirect', 'checkout' );
wp_safe_redirect( wc_gzd_get_page_permalink( 'myaccount' ) );
exit;

} else if ( is_checkout() ) {
} elseif ( is_checkout() ) {

unset( WC()->session->login_redirect );

Expand Down
8 changes: 4 additions & 4 deletions includes/class-wc-gzd-dependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ public function __construct( $plugin = null ) {

if ( ! $this->is_plugin_activated( $plugin ) ) {
$this->plugins_result[ 'unactivated' ][ $plugin ] = $data;
} else if ( $this->is_plugin_outdated( $plugin ) ) {
} elseif ( $this->is_plugin_outdated( $plugin ) ) {
$this->plugins_result[ 'outdated' ][ $plugin ] = $data;
} else if ( ! $this->is_plugin_tested( $plugin ) ) {
} elseif ( ! $this->is_plugin_tested( $plugin ) ) {
$this->plugins_result[ 'untested' ][ $plugin ] = $data;
}

Expand All @@ -106,7 +106,7 @@ public function __construct( $plugin = null ) {
$this->loadable = false;
remove_all_actions( 'admin_notices' );
add_action( 'admin_notices', array( $this, 'dependencies_notice' ) );
} else if ( ! empty( $this->plugins_result[ 'untested' ] ) ) {
} elseif ( ! empty( $this->plugins_result[ 'untested' ] ) ) {
remove_all_actions( 'admin_notices' );
add_action( 'admin_notices', array( $this, 'dependencies_notice' ) );
}
Expand Down Expand Up @@ -150,7 +150,7 @@ protected function parse_plugin_header_data() {
foreach ( $plugin_data as $key => $value ) {
if ( strpos( $key, 'requires' ) !== false ) {
$this->plugins_header[ str_replace( 'requires_', '', $key ) ][ 'requires' ] = $value;
} else if ( strpos( $key, 'tested' ) !== false ) {
} elseif ( strpos( $key, 'tested' ) !== false ) {
$this->plugins_header[ str_replace( 'tested_', '', $key ) ][ 'tested' ] = $value;
}
}
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-gzd-emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function maybe_hide_username_password_reset( $translated, $original, $dom
if ( 'woocommerce' === $domain ) {
if ( 'Someone requested that the password be reset for the following account:' === $original ) {
return __( 'Someone requested a password reset for your account.', 'woocommerce-germanized' );
} else if ( 'Username: %s' === $original ) {
} elseif ( 'Username: %s' === $original ) {
remove_filter( 'gettext', array( $this, 'maybe_hide_username_password_reset' ), 10, 3 );
return '';
}
Expand Down
4 changes: 2 additions & 2 deletions includes/compatibility/class-wc-gzd-compatibility-wpml.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function send_order_admin_confirmation( $order_id ) {

if ( method_exists( $woocommerce_wpml->emails, 'admin_email' ) )
$woocommerce_wpml->emails->admin_email( $order_id );
else if ( method_exists( $woocommerce_wpml->emails, 'new_order_admin_email' ) )
elseif ( method_exists( $woocommerce_wpml->emails, 'new_order_admin_email' ) )
$woocommerce_wpml->emails->new_order_admin_email( $order_id );

// Stop Germanized from sending the notification
Expand All @@ -89,7 +89,7 @@ public function unregister_order_confirmation_hooks() {
foreach ( $statuses as $status ) {
if ( method_exists( $woocommerce_wpml->emails, 'admin_email' ) )
remove_action( $status, array( $woocommerce_wpml->emails, 'admin_email' ), 9 );
else if ( method_exists( $woocommerce_wpml->emails, 'new_order_admin_email' ) )
elseif ( method_exists( $woocommerce_wpml->emails, 'new_order_admin_email' ) )
remove_action( $status, array( $woocommerce_wpml->emails, 'new_order_admin_email' ), 9 );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function export_args( $args = array() ) {
if ( isset( $_GET['sepa_start_date'] ) || isset( $_GET['sepa_end_date'] ) ) {
$args['start_date'] = ( isset( $_GET['sepa_start_date'] ) ? sanitize_text_field( $_GET['sepa_start_date'] ) : '' );
$args['end_date'] = ( isset( $_GET['sepa_end_date'] ) ? sanitize_text_field( $_GET['sepa_end_date'] ) : '' );
} else if ( isset( $_GET[ 'sepa_order_id' ] ) ) {
} elseif ( isset( $_GET[ 'sepa_order_id' ] ) ) {
$args['order_id'] = absint( $_GET['sepa_order_id'] );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public function before_save( $settings ) {
if ( $setting[ 'id' ] == 'woocommerce_' . $this->base->option_prefix . 'trusted_shops_review_widget_enable' ) {
if ( ! empty( $_POST[ 'woocommerce_' . $this->base->option_prefix . 'trusted_shops_review_widget_enable' ] ) && ! $this->base->is_review_widget_enabled() )
update_option( '_woocommerce_' . $this->base->option_prefix . 'trusted_shops_update_reviews', 1 );
} else if ( $setting[ 'id' ] == 'woocommerce_' . $this->base->option_prefix . 'trusted_shops_rich_snippets_enable' ) {
} elseif ( $setting[ 'id' ] == 'woocommerce_' . $this->base->option_prefix . 'trusted_shops_rich_snippets_enable' ) {
if ( ! empty( $_POST[ 'woocommerce_' . $this->base->option_prefix . 'trusted_shops_rich_snippets_enable' ] ) && ! $this->base->is_rich_snippets_enabled() )
update_option( '_woocommerce_' . $this->base->option_prefix . 'trusted_shops_update_snippets', 1 );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private function get_file_content( $url ) {

return $output;

} else if ( ini_get( 'allow_url_fopen' ) ) {
} elseif ( ini_get( 'allow_url_fopen' ) ) {
return file_get_contents( $url );
}

Expand Down
16 changes: 8 additions & 8 deletions includes/wc-gzd-cart-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ function wc_gzd_cart_product_item_desc( $title, $cart_item, $cart_item_key = ''
if ( wc_gzd_get_gzd_product( $product )->get_mini_desc() )
$product_desc = wc_gzd_get_gzd_product( $product )->get_mini_desc();

} else if ( isset( $cart_item[ 'item_desc' ] ) ) {
} elseif ( isset( $cart_item[ 'item_desc' ] ) ) {

$product_desc = $cart_item[ 'item_desc' ];

} else if ( isset( $cart_item[ 'product_id' ] ) ) {
} elseif ( isset( $cart_item[ 'product_id' ] ) ) {

$product = wc_get_product( ! empty( $cart_item[ 'variation_id' ] ) ? $cart_item[ 'variation_id' ] : $cart_item[ 'product_id' ] );

Expand Down Expand Up @@ -77,11 +77,11 @@ function wc_gzd_cart_product_delivery_time( $title, $cart_item, $cart_item_key =
if ( wc_gzd_get_gzd_product( $product )->get_delivery_time_term() )
$delivery_time = wc_gzd_get_gzd_product( $product )->get_delivery_time_html();

} else if ( isset( $cart_item[ 'delivery_time' ] ) ) {
} elseif ( isset( $cart_item[ 'delivery_time' ] ) ) {

$delivery_time = $cart_item[ 'delivery_time' ];

} else if ( isset( $cart_item[ 'product_id' ] ) ) {
} elseif ( isset( $cart_item[ 'product_id' ] ) ) {

$product = wc_get_product( ! empty( $cart_item[ 'variation_id' ] ) ? $cart_item[ 'variation_id' ] : $cart_item[ 'product_id' ] );

Expand Down Expand Up @@ -114,12 +114,12 @@ function wc_gzd_cart_product_unit_price( $price, $cart_item, $cart_item_key = ''
if ( wc_gzd_get_gzd_product( $product )->has_unit() )
$unit_price = wc_gzd_get_gzd_product( $product )->get_unit_html( false );

} else if ( isset( $cart_item[ 'unit_price' ] ) ) {
} elseif ( isset( $cart_item[ 'unit_price' ] ) ) {

$unit_price = $cart_item[ 'unit_price' ];


} else if ( isset( $cart_item[ 'product_id' ] ) ) {
} elseif ( isset( $cart_item[ 'product_id' ] ) ) {

$product = wc_get_product( ! empty( $cart_item[ 'variation_id' ] ) ? $cart_item[ 'variation_id' ] : $cart_item[ 'product_id' ] );

Expand Down Expand Up @@ -152,11 +152,11 @@ function wc_gzd_cart_product_units( $title, $cart_item, $cart_item_key = '' ) {
if ( wc_gzd_get_gzd_product( $product )->has_product_units() )
$units = wc_gzd_get_gzd_product( $product )->get_product_units_html();

} else if ( isset( $cart_item[ 'units' ] ) ) {
} elseif ( isset( $cart_item[ 'units' ] ) ) {

$units = $cart_item[ 'units' ];

} else if ( isset( $cart_item[ 'product_id' ] ) ) {
} elseif ( isset( $cart_item[ 'product_id' ] ) ) {

$product = wc_get_product( ! empty( $cart_item[ 'variation_id' ] ) ? $cart_item[ 'variation_id' ] : $cart_item[ 'product_id' ] );

Expand Down
4 changes: 2 additions & 2 deletions includes/wc-gzd-legacy-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function wc_gzd_get_crud_data( $object, $key ) {

if ( 'id' === $key && is_callable( array( $object, 'is_type' ) ) && $object->is_type( 'variation' ) && ! wc_gzd_get_dependencies()->woocommerce_version_supports_crud() ) {
$key = 'variation_id';
} else if ( 'parent' === $key && is_callable( array( $object, 'is_type' ) ) && $object->is_type( 'variation' ) && ! wc_gzd_get_dependencies()->woocommerce_version_supports_crud() ) {
} elseif ( 'parent' === $key && is_callable( array( $object, 'is_type' ) ) && $object->is_type( 'variation' ) && ! wc_gzd_get_dependencies()->woocommerce_version_supports_crud() ) {
// Set getter to parent so that it is not being used for pre 2.7
$key = 'id';
$getter = 'parent';
Expand All @@ -46,7 +46,7 @@ function wc_gzd_get_crud_data( $object, $key ) {
if ( $reflection->isPublic() ) {
$value = $object->{$getter}();
}
} else if ( wc_gzd_get_dependencies()->woocommerce_version_supports_crud() ) {
} elseif ( wc_gzd_get_dependencies()->woocommerce_version_supports_crud() ) {
if ( substr( $key, 0, 1 ) !== '_' )
$key = '_' . $key;

Expand Down
6 changes: 3 additions & 3 deletions includes/wc-gzd-product-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function wc_gzd_is_revocation_exempt( $product, $type = 'digital' ) {
if ( empty( $types ) )
return false;

else if ( ! is_array( $types ) )
elseif ( ! is_array( $types ) )
$types = array( $types );

if ( $type === 'digital' ) {
Expand All @@ -74,7 +74,7 @@ function wc_gzd_is_revocation_exempt( $product, $type = 'digital' ) {
if ( wc_gzd_product_matches_extended_type( $revo_type, $product ) )
return true;
}
} else if ( $type === 'service' ) {
} elseif ( $type === 'service' ) {
if ( wc_gzd_get_gzd_product( $product )->is_service() )
return true;
}
Expand All @@ -98,7 +98,7 @@ function wc_gzd_product_matches_extended_type( $type, $product ) {

if ( $type === $product->get_type() )
$matches_type = true;
else if ( is_callable( array( $product, 'is_' . $type ) ) )
elseif ( is_callable( array( $product, 'is_' . $type ) ) )
$matches_type = ( call_user_func_array( array( $product, 'is_' . $type ), array() ) === true ? true : false );

// Do only check parent if product does not match the type
Expand Down
2 changes: 1 addition & 1 deletion includes/wc-gzd-template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ function woocommerce_gzd_template_sale_price_label_html( $price, $product ) {

if ( ! is_product() && get_option( 'woocommerce_gzd_display_listings_sale_price_labels' ) === 'no' )
return $price;
else if ( is_product() && get_option( 'woocommerce_gzd_display_product_detail_sale_price_labels' ) === 'no' )
elseif ( is_product() && get_option( 'woocommerce_gzd_display_product_detail_sale_price_labels' ) === 'no' )
return $price;

return wc_gzd_get_gzd_product( $product )->add_labels_to_price_html( $price );
Expand Down

0 comments on commit 4a50506

Please sign in to comment.