Merge pull request #9604 from mitogh/master

Update comparission to be strict comparison instead
This commit is contained in:
Claudio Sanches 2015-11-15 16:38:24 -02:00
commit 8f26233905
21 changed files with 34 additions and 34 deletions

View File

@ -64,8 +64,8 @@ if ( ! defined( 'ABSPATH' ) ) {
</tr>
<?php endforeach; ?>
<?php if ( wc_tax_enabled() && WC()->cart->tax_display_cart == 'excl' ) : ?>
<?php if ( get_option( 'woocommerce_tax_total_display' ) == 'itemized' ) : ?>
<?php if ( wc_tax_enabled() && 'excl' === WC()->cart->tax_display_cart ) : ?>
<?php if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) : ?>
<?php foreach ( WC()->cart->get_tax_totals() as $code => $tax ) : ?>
<tr class="tax-rate tax-rate-<?php echo sanitize_title( $code ); ?>">
<th><?php echo esc_html( $tax->label ); ?></th>

View File

@ -23,7 +23,7 @@ global $product, $woocommerce_loop;
$crosssells = WC()->cart->get_cross_sells();
if ( sizeof( $crosssells ) == 0 ) return;
if ( 0 === sizeof( $crosssells ) ) return;
$meta_query = WC()->query->get_meta_query();

View File

@ -19,7 +19,7 @@ if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
if ( get_option( 'woocommerce_enable_shipping_calc' ) === 'no' || ! WC()->cart->needs_shipping() ) {
if ( 'no' === get_option( 'woocommerce_enable_shipping_calc' ) || ! WC()->cart->needs_shipping() ) {
return;
}

View File

@ -21,7 +21,7 @@ if ( ! defined( 'ABSPATH' ) ) {
?>
<div class="woocommerce-shipping-fields">
<?php if ( WC()->cart->needs_shipping_address() === true ) : ?>
<?php if ( true === WC()->cart->needs_shipping_address() ) : ?>
<?php
if ( empty( $_POST ) ) {

View File

@ -83,8 +83,8 @@ if ( ! defined( 'ABSPATH' ) ) {
</tr>
<?php endforeach; ?>
<?php if ( wc_tax_enabled() && WC()->cart->tax_display_cart === 'excl' ) : ?>
<?php if ( get_option( 'woocommerce_tax_total_display' ) === 'itemized' ) : ?>
<?php if ( wc_tax_enabled() && 'excl' === WC()->cart->tax_display_cart ) : ?>
<?php if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) : ?>
<?php foreach ( WC()->cart->get_tax_totals() as $code => $tax ) : ?>
<tr class="tax-rate tax-rate-<?php echo sanitize_title( $code ); ?>">
<th><?php echo esc_html( $tax->label ); ?></th>

View File

@ -41,10 +41,10 @@ $woocommerce_loop['loop']++;
// Extra post classes
$classes = array();
if ( 0 == ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns'] ) {
if ( 0 === ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] || 1 === $woocommerce_loop['columns'] ) {
$classes[] = 'first';
}
if ( 0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns'] ) {
if ( 0 === $woocommerce_loop['loop'] % $woocommerce_loop['columns'] ) {
$classes[] = 'last';
}
?>

View File

@ -42,8 +42,8 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
foreach ( $totals as $total ) {
$i++;
?><tr>
<th class="td" scope="row" colspan="2" style="text-align:left; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td class="td" style="text-align:left; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
<th class="td" scope="row" colspan="2" style="text-align:left; <?php if ( $i === 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td class="td" style="text-align:left; <?php if ( $i === 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
</tr><?php
}
}

View File

@ -47,8 +47,8 @@ if ( ! defined( 'ABSPATH' ) ) {
foreach ( $totals as $total ) {
$i++;
?><tr>
<th class="td" scope="row" colspan="2" style="text-align:left; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td class="td" style="text-align:left; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
<th class="td" scope="row" colspan="2" style="text-align:left; <?php if ( $i === 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td class="td" style="text-align:left; <?php if ( $i === 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
</tr><?php
}
}

View File

@ -63,8 +63,8 @@ if ( ! defined( 'ABSPATH' ) ) {
foreach ( $totals as $total ) {
$i++;
?><tr>
<td class="td" colspan="2" style="text-align:left; <?php if ( $i == 1 ) echo 'border-top-width: 4px !important;'; ?>"><?php echo $total['label']; ?></td>
<td class="td" style="text-align:left; <?php if ( $i == 1 ) echo 'border-top-width: 4px !important;'; ?>"><?php echo $total['value']; ?></td>
<td class="td" colspan="2" style="text-align:left; <?php if ( $i === 1 ) echo 'border-top-width: 4px !important;'; ?>"><?php echo $total['label']; ?></td>
<td class="td" style="text-align:left; <?php if ( $i === 1 ) echo 'border-top-width: 4px !important;'; ?>"><?php echo $total['value']; ?></td>
</tr><?php
}
}

View File

@ -25,7 +25,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<p><?php printf( __( "Thanks for creating an account on %s. Your username is <strong>%s</strong>.", 'woocommerce' ), esc_html( $blogname ), esc_html( $user_login ) ); ?></p>
<?php if ( get_option( 'woocommerce_registration_generate_password' ) == 'yes' && $password_generated ) : ?>
<?php if ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) && $password_generated ) : ?>
<p><?php printf( __( "Your password has been automatically generated: <strong>%s</strong>", 'woocommerce' ), esc_html( $user_pass ) ); ?></p>

View File

@ -51,8 +51,8 @@ if ( ! defined( 'ABSPATH' ) ) {
foreach ( $totals as $total ) {
$i++;
?><tr>
<th class="td" scope="row" colspan="2" style="text-align:left; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td class="td" style="text-align:left; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
<th class="td" scope="row" colspan="2" style="text-align:left; <?php if ( $i === 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td class="td" style="text-align:left; <?php if ( $i === 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
</tr><?php
}
}

View File

@ -47,8 +47,8 @@ if ( ! defined( 'ABSPATH' ) ) {
foreach ( $totals as $total ) {
$i++;
?><tr>
<th class="td" scope="row" colspan="2" style="text-align:left; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td class="td" style="text-align:left; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
<th class="td" scope="row" colspan="2" style="text-align:left; <?php if ( 1 === $i ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td class="td" style="text-align:left; <?php if ( 1 === $i ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
</tr><?php
}
}

View File

@ -64,8 +64,8 @@ if ( ! defined( 'ABSPATH' ) ) {
foreach ( $totals as $total ) {
$i++;
?><tr>
<th class="td" scope="row" colspan="2" style="text-align:left; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td class="td" style="text-align:left; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
<th class="td" scope="row" colspan="2" style="text-align:left; <?php if ( 1 === $i ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td class="td" style="text-align:left; <?php if ( 1 === $i ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
</tr><?php
}
}

View File

@ -23,7 +23,7 @@ echo "= " . $email_heading . " =\n\n";
echo sprintf( __( "Thanks for creating an account on %s. Your username is <strong>%s</strong>.", 'woocommerce' ), $blogname, $user_login ) . "\n\n";
if ( get_option( 'woocommerce_registration_generate_password' ) === 'yes' && $password_generated )
if ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) && $password_generated )
echo sprintf( __( "Your password is <strong>%s</strong>.", 'woocommerce' ), $user_pass ) . "\n\n";
echo sprintf( __( 'You can access your account area to view your orders and change your password here: %s.', 'woocommerce' ), wc_get_page_permalink( 'myaccount' ) ) . "\n\n";

View File

@ -34,9 +34,9 @@ if ( ! woocommerce_products_will_display() )
$first = ( $per_page * $paged ) - $per_page + 1;
$last = min( $total, $wp_query->get( 'posts_per_page' ) * $paged );
if ( 1 == $total ) {
if ( 1 === $total ) {
_e( 'Showing the single result', 'woocommerce' );
} elseif ( $total <= $per_page || -1 == $per_page ) {
} elseif ( $total <= $per_page || -1 === $per_page ) {
printf( __( 'Showing all %d results', 'woocommerce' ), $total );
} else {
printf( _x( 'Showing %1$d&ndash;%2$d of %3$d results', '%1$d = first, %2$d = last, %3$d = total', 'woocommerce' ), $first, $last, $total );

View File

@ -25,7 +25,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<form method="post" class="lost_reset_password">
<?php if( 'lost_password' == $args['form'] ) : ?>
<?php if( 'lost_password' === $args['form'] ) : ?>
<p><?php echo apply_filters( 'woocommerce_lost_password_message', __( 'Lost your password? Please enter your username or email address. You will receive a link to create a new password via email.', 'woocommerce' ) ); ?></p>
@ -55,7 +55,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<p class="form-row">
<input type="hidden" name="wc_reset_password" value="true" />
<input type="submit" class="button" value="<?php echo 'lost_password' == $args['form'] ? __( 'Reset Password', 'woocommerce' ) : __( 'Save', 'woocommerce' ); ?>" />
<input type="submit" class="button" value="<?php echo 'lost_password' === $args['form'] ? __( 'Reset Password', 'woocommerce' ) : __( 'Save', 'woocommerce' ); ?>" />
</p>
<?php wp_nonce_field( $args['form'] ); ?>

View File

@ -33,14 +33,14 @@ ob_start();
<?php if ( $product->enable_dimensions_display() ) : ?>
<?php if ( $product->has_weight() ) : $has_row = true; ?>
<tr class="<?php if ( ( $alt = $alt * -1 ) == 1 ) echo 'alt'; ?>">
<tr class="<?php if ( ( $alt = $alt * -1 ) === 1 ) echo 'alt'; ?>">
<th><?php _e( 'Weight', 'woocommerce' ) ?></th>
<td class="product_weight"><?php echo $product->get_weight() . ' ' . esc_attr( get_option( 'woocommerce_weight_unit' ) ); ?></td>
</tr>
<?php endif; ?>
<?php if ( $product->has_dimensions() ) : $has_row = true; ?>
<tr class="<?php if ( ( $alt = $alt * -1 ) == 1 ) echo 'alt'; ?>">
<tr class="<?php if ( ( $alt = $alt * -1 ) === 1 ) echo 'alt'; ?>">
<th><?php _e( 'Dimensions', 'woocommerce' ) ?></th>
<td class="product_dimensions"><?php echo $product->get_dimensions(); ?></td>
</tr>

View File

@ -33,10 +33,10 @@ if ( $attachment_ids ) {
$classes = array( 'zoom' );
if ( $loop == 0 || $loop % $columns == 0 )
if ( $loop === 0 || $loop % $columns === 0 )
$classes[] = 'first';
if ( ( $loop + 1 ) % $columns == 0 )
if ( ( $loop + 1 ) % $columns === 0 )
$classes[] = 'last';
$image_link = wp_get_attachment_url( $attachment_id );

View File

@ -27,7 +27,7 @@ if ( empty( $product ) || ! $product->exists() ) {
$related = $product->get_related( $posts_per_page );
if ( sizeof( $related ) == 0 ) return;
if ( sizeof( $related ) === 0 ) return;
$args = apply_filters( 'woocommerce_related_products_args', array(
'post_type' => 'product',

View File

@ -33,7 +33,7 @@ $verified = wc_review_is_from_verified_owner( $comment->comment_ID );
<div class="comment-text">
<?php if ( $rating && get_option( 'woocommerce_enable_review_rating' ) == 'yes' ) : ?>
<?php if ( $rating && get_option( 'woocommerce_enable_review_rating' ) === 'yes' ) : ?>
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating" class="star-rating" title="<?php echo sprintf( __( 'Rated %d out of 5', 'woocommerce' ), $rating ) ?>">
<span style="width:<?php echo ( $rating / 5 ) * 100; ?>%"><strong itemprop="ratingValue"><?php echo $rating; ?></strong> <?php _e( 'out of 5', 'woocommerce' ); ?></span>

View File

@ -23,7 +23,7 @@ global $product, $woocommerce_loop;
$upsells = $product->get_upsells();
if ( sizeof( $upsells ) == 0 ) {
if ( sizeof( $upsells ) === 0 ) {
return;
}