Fix Generic.WhiteSpace.ScopeIndent violations

This commit fixes all violations of the Generic.WhiteSpace.ScopeIndent sniff automatically using phpcbf.
This commit is contained in:
Rodrigo Primo 2019-12-20 14:48:11 -03:00
parent 73b5fff29e
commit 86c1b61f03
8 changed files with 65 additions and 61 deletions

View File

@ -35,28 +35,28 @@ if ( ! defined( 'ABSPATH' ) ) {
<td> <td>
<label><?php esc_html_e( 'Customer download link', 'woocommerce' ); ?></label> <label><?php esc_html_e( 'Customer download link', 'woocommerce' ); ?></label>
<?php <?php
$download_link = add_query_arg( $download_link = add_query_arg(
array( array(
'download_file' => $download->get_product_id(), 'download_file' => $download->get_product_id(),
'order' => $download->get_order_key(), 'order' => $download->get_order_key(),
'email' => urlencode( $download->get_user_email() ), 'email' => urlencode( $download->get_user_email() ),
'key' => $download->get_download_id(), 'key' => $download->get_download_id(),
), trailingslashit( home_url() ) ), trailingslashit( home_url() )
); );
?> ?>
<a id="copy-download-link" class="button" href="<?php echo esc_url( $download_link ); ?>" data-tip="<?php esc_attr_e( 'Copied!', 'woocommerce' ); ?>" data-tip-failed="<?php esc_attr_e( 'Copying to clipboard failed. You should be able to right-click the button and copy.', 'woocommerce' ); ?>"><?php esc_html_e( 'Copy link', 'woocommerce' ); ?></a> <a id="copy-download-link" class="button" href="<?php echo esc_url( $download_link ); ?>" data-tip="<?php esc_attr_e( 'Copied!', 'woocommerce' ); ?>" data-tip-failed="<?php esc_attr_e( 'Copying to clipboard failed. You should be able to right-click the button and copy.', 'woocommerce' ); ?>"><?php esc_html_e( 'Copy link', 'woocommerce' ); ?></a>
</td> </td>
<td> <td>
<label><?php esc_html_e( 'Customer download log', 'woocommerce' ); ?></label> <label><?php esc_html_e( 'Customer download log', 'woocommerce' ); ?></label>
<?php <?php
$report_url = add_query_arg( $report_url = add_query_arg(
'permission_id', 'permission_id',
rawurlencode( $download->get_id() ), rawurlencode( $download->get_id() ),
admin_url( 'admin.php?page=wc-reports&tab=orders&report=downloads' ) admin_url( 'admin.php?page=wc-reports&tab=orders&report=downloads' )
); );
echo '<a class="button" href="' . esc_url( $report_url ) . '">'; echo '<a class="button" href="' . esc_url( $report_url ) . '">';
esc_html_e( 'View report', 'woocommerce' ); esc_html_e( 'View report', 'woocommerce' );
echo '</a>'; echo '</a>';
?> ?>
</td> </td>
</tr> </tr>

View File

@ -7,33 +7,33 @@ if ( ! defined( 'ABSPATH' ) ) {
<div class="options_group hide_if_external hide_if_grouped"> <div class="options_group hide_if_external hide_if_grouped">
<?php <?php
woocommerce_wp_textarea_input( woocommerce_wp_textarea_input(
array( array(
'id' => '_purchase_note', 'id' => '_purchase_note',
'value' => $product_object->get_purchase_note( 'edit' ), 'value' => $product_object->get_purchase_note( 'edit' ),
'label' => __( 'Purchase note', 'woocommerce' ), 'label' => __( 'Purchase note', 'woocommerce' ),
'desc_tip' => true, 'desc_tip' => true,
'description' => __( 'Enter an optional note to send the customer after purchase.', 'woocommerce' ), 'description' => __( 'Enter an optional note to send the customer after purchase.', 'woocommerce' ),
) )
); );
?> ?>
</div> </div>
<div class="options_group"> <div class="options_group">
<?php <?php
woocommerce_wp_text_input( woocommerce_wp_text_input(
array( array(
'id' => 'menu_order', 'id' => 'menu_order',
'value' => $product_object->get_menu_order( 'edit' ), 'value' => $product_object->get_menu_order( 'edit' ),
'label' => __( 'Menu order', 'woocommerce' ), 'label' => __( 'Menu order', 'woocommerce' ),
'desc_tip' => true, 'desc_tip' => true,
'description' => __( 'Custom ordering position.', 'woocommerce' ), 'description' => __( 'Custom ordering position.', 'woocommerce' ),
'type' => 'number', 'type' => 'number',
'custom_attributes' => array( 'custom_attributes' => array(
'step' => '1', 'step' => '1',
), ),
) )
); );
?> ?>
</div> </div>

View File

@ -205,7 +205,7 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
); );
if ( ! empty( $used_coupons ) && is_array( $used_coupons ) ) : if ( ! empty( $used_coupons ) && is_array( $used_coupons ) ) :
?> ?>
<select id="coupon_codes" name="coupon_codes" class="wc-enhanced-select" data-placeholder="<?php esc_attr_e( 'Choose coupons&hellip;', 'woocommerce' ); ?>" style="width:100%;"> <select id="coupon_codes" name="coupon_codes" class="wc-enhanced-select" data-placeholder="<?php esc_attr_e( 'Choose coupons&hellip;', 'woocommerce' ); ?>" style="width:100%;">
<option value=""><?php esc_html_e( 'All coupons', 'woocommerce' ); ?></option> <option value=""><?php esc_html_e( 'All coupons', 'woocommerce' ); ?></option>
<?php <?php

View File

@ -529,7 +529,7 @@ class WC_Shortcodes {
); );
$single_product = new WP_Query( $args ); $single_product = new WP_Query( $args );
?> ?>
<script type="text/javascript"> <script type="text/javascript">
jQuery( document ).ready( function( $ ) { jQuery( document ).ready( function( $ ) {
var $variations_form = $( '[data-product-page-preselected-id="<?php echo esc_attr( $preselected_id ); ?>"]' ).find( 'form.variations_form' ); var $variations_form = $( '[data-product-page-preselected-id="<?php echo esc_attr( $preselected_id ); ?>"]' ).find( 'form.variations_form' );
@ -539,7 +539,7 @@ class WC_Shortcodes {
<?php } ?> <?php } ?>
}); });
</script> </script>
<?php <?php
} }
// For "is_single" to always make load comments_template() for reviews. // For "is_single" to always make load comments_template() for reviews.

View File

@ -33,9 +33,9 @@ if ( ! defined( 'ABSPATH' ) ) {
<td align="center" valign="top"> <td align="center" valign="top">
<div id="template_header_image"> <div id="template_header_image">
<?php <?php
if ( $img = get_option( 'woocommerce_email_header_image' ) ) { if ( $img = get_option( 'woocommerce_email_header_image' ) ) {
echo '<p style="margin-top:0;"><img src="' . esc_url( $img ) . '" alt="' . get_bloginfo( 'name', 'display' ) . '" /></p>'; echo '<p style="margin-top:0;"><img src="' . esc_url( $img ) . '" alt="' . get_bloginfo( 'name', 'display' ) . '" /></p>';
} }
?> ?>
</div> </div>
<table border="0" cellpadding="0" cellspacing="0" width="600" id="template_container"> <table border="0" cellpadding="0" cellspacing="0" width="600" id="template_container">

View File

@ -30,17 +30,17 @@ if ( $total <= 1 ) {
?> ?>
<nav class="woocommerce-pagination"> <nav class="woocommerce-pagination">
<?php <?php
echo paginate_links( apply_filters( 'woocommerce_pagination_args', array( // WPCS: XSS ok. echo paginate_links( apply_filters( 'woocommerce_pagination_args', array( // WPCS: XSS ok.
'base' => $base, 'base' => $base,
'format' => $format, 'format' => $format,
'add_args' => false, 'add_args' => false,
'current' => max( 1, $current ), 'current' => max( 1, $current ),
'total' => $total, 'total' => $total,
'prev_text' => '&larr;', 'prev_text' => '&larr;',
'next_text' => '&rarr;', 'next_text' => '&rarr;',
'type' => 'list', 'type' => 'list',
'end_size' => 3, 'end_size' => 3,
'mid_size' => 3, 'mid_size' => 3,
) ) ); ) ) );
?> ?>
</nav> </nav>

View File

@ -22,23 +22,27 @@ if ( ! defined( 'ABSPATH' ) ) {
} }
?> ?>
<p><?php <p>
<?php
printf( printf(
/* translators: 1: user display name 2: logout url */ /* translators: 1: user display name 2: logout url */
__( 'Hello %1$s (not %1$s? <a href="%2$s">Log out</a>)', 'woocommerce' ), __( 'Hello %1$s (not %1$s? <a href="%2$s">Log out</a>)', 'woocommerce' ),
'<strong>' . esc_html( $current_user->display_name ) . '</strong>', '<strong>' . esc_html( $current_user->display_name ) . '</strong>',
esc_url( wc_logout_url() ) esc_url( wc_logout_url() )
); );
?></p> ?>
</p>
<p><?php <p>
<?php
printf( printf(
__( 'From your account dashboard you can view your <a href="%1$s">recent orders</a>, manage your <a href="%2$s">shipping and billing addresses</a>, and <a href="%3$s">edit your password and account details</a>.', 'woocommerce' ), __( 'From your account dashboard you can view your <a href="%1$s">recent orders</a>, manage your <a href="%2$s">shipping and billing addresses</a>, and <a href="%3$s">edit your password and account details</a>.', 'woocommerce' ),
esc_url( wc_get_endpoint_url( 'orders' ) ), esc_url( wc_get_endpoint_url( 'orders' ) ),
esc_url( wc_get_endpoint_url( 'edit-address' ) ), esc_url( wc_get_endpoint_url( 'edit-address' ) ),
esc_url( wc_get_endpoint_url( 'edit-account' ) ) esc_url( wc_get_endpoint_url( 'edit-account' ) )
); );
?></p> ?>
</p>
<?php <?php
/** /**

View File

@ -41,5 +41,5 @@ if ( '0' === $comment->comment_approved ) { ?>
<span class="woocommerce-review__dash">&ndash;</span> <time class="woocommerce-review__published-date" datetime="<?php echo esc_attr( get_comment_date( 'c' ) ); ?>"><?php echo esc_html( get_comment_date( wc_date_format() ) ); ?></time> <span class="woocommerce-review__dash">&ndash;</span> <time class="woocommerce-review__published-date" datetime="<?php echo esc_attr( get_comment_date( 'c' ) ); ?>"><?php echo esc_html( get_comment_date( wc_date_format() ) ); ?></time>
</p> </p>
<?php <?php
} }