Skip to content

Commit

Permalink
Fix Squiz.PHP.EmbeddedPhp violations
Browse files Browse the repository at this point in the history
This commit fixes all violations of the Squiz.PHP.EmbeddedPhp sniff automatically using phpcbf.
  • Loading branch information
rodrigoprimo committed Dec 20, 2019
1 parent 86c1b61 commit 24cc92e
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 14 deletions.
6 changes: 4 additions & 2 deletions templates/checkout/thankyou.php
Expand Up @@ -20,9 +20,11 @@

<div class="woocommerce-order">

<?php if ( $order ) :
<?php
if ( $order ) :

do_action( 'woocommerce_before_thankyou', $order->get_id() ); ?>
do_action( 'woocommerce_before_thankyou', $order->get_id() );
?>

<?php if ( $order->has_status( 'failed' ) ) : ?>

Expand Down
3 changes: 2 additions & 1 deletion templates/content-product_cat.php
Expand Up @@ -52,5 +52,6 @@
*
* @hooked woocommerce_template_loop_category_link_close - 10
*/
do_action( 'woocommerce_after_subcategory', $category ); ?>
do_action( 'woocommerce_after_subcategory', $category );
?>
</li>
2 changes: 1 addition & 1 deletion templates/content-widget-reviews.php
Expand Up @@ -26,7 +26,7 @@
<span class="product-title"><?php echo $product->get_name(); ?></span>
</a>

<?php echo wc_get_rating_html( intval( get_comment_meta( $comment->comment_ID, 'rating', true ) ) );?>
<?php echo wc_get_rating_html( intval( get_comment_meta( $comment->comment_ID, 'rating', true ) ) ); ?>

<span class="reviewer"><?php echo sprintf( esc_html__( 'by %s', 'woocommerce' ), get_comment_author( $comment->comment_ID ) ); ?></span>

Expand Down
2 changes: 1 addition & 1 deletion templates/global/form-login.php
Expand Up @@ -47,7 +47,7 @@
<input class="woocommerce-form__input woocommerce-form__input-checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever" /> <span><?php esc_html_e( 'Remember me', 'woocommerce' ); ?></span>
</label>
<?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?>
<input type="hidden" name="redirect" value="<?php echo esc_url( $redirect ) ?>" />
<input type="hidden" name="redirect" value="<?php echo esc_url( $redirect ); ?>" />
<button type="submit" class="woocommerce-button button woocommerce-form-login__submit" name="login" value="<?php esc_attr_e( 'Login', 'woocommerce' ); ?>"><?php esc_html_e( 'Login', 'woocommerce' ); ?></button>
</p>
<p class="lost_password">
Expand Down
3 changes: 2 additions & 1 deletion templates/loop/sale-flash.php
Expand Up @@ -26,6 +26,7 @@

<?php echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ); ?>

<?php endif;
<?php
endif;

/* Omit closing PHP tag at the end of PHP files to avoid "headers already sent" issues. */
3 changes: 2 additions & 1 deletion templates/single-product.php
Expand Up @@ -55,6 +55,7 @@
do_action( 'woocommerce_sidebar' );
?>

<?php get_footer( 'shop' );
<?php
get_footer( 'shop' );

/* Omit closing PHP tag at the end of PHP files to avoid "headers already sent" issues. */
2 changes: 1 addition & 1 deletion templates/single-product/price.php
Expand Up @@ -22,4 +22,4 @@
global $product;

?>
<p class="<?php echo esc_attr( apply_filters( 'woocommerce_product_price_class', 'price' ) );?>"><?php echo $product->get_price_html(); ?></p>
<p class="<?php echo esc_attr( apply_filters( 'woocommerce_product_price_class', 'price' ) ); ?>"><?php echo $product->get_price_html(); ?></p>
3 changes: 2 additions & 1 deletion templates/single-product/review.php
Expand Up @@ -60,7 +60,8 @@
*/
do_action( 'woocommerce_review_comment_text', $comment );

do_action( 'woocommerce_review_after_comment_text', $comment ); ?>
do_action( 'woocommerce_review_after_comment_text', $comment );
?>

</div>
</div>
3 changes: 2 additions & 1 deletion templates/single-product/sale-flash.php
Expand Up @@ -26,6 +26,7 @@

<?php echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ); ?>

<?php endif;
<?php
endif;

/* Omit closing PHP tag at the end of PHP files to avoid "headers already sent" issues. */
10 changes: 6 additions & 4 deletions templates/single-product/up-sells.php
Expand Up @@ -30,18 +30,20 @@
<?php foreach ( $upsells as $upsell ) : ?>

<?php
$post_object = get_post( $upsell->get_id() );
$post_object = get_post( $upsell->get_id() );

setup_postdata( $GLOBALS['post'] =& $post_object );
setup_postdata( $GLOBALS['post'] =& $post_object );

wc_get_template_part( 'content', 'product' ); ?>
wc_get_template_part( 'content', 'product' );
?>

<?php endforeach; ?>

<?php woocommerce_product_loop_end(); ?>

</section>

<?php endif;
<?php
endif;

wp_reset_postdata();

0 comments on commit 24cc92e

Please sign in to comment.