Generic.Formatting.DisallowMultipleStatements.SameLine

This commit is contained in:
Aristeides Stathopoulos 2016-09-02 06:40:52 +03:00
parent 9dc4949e0a
commit 6ac7f03241
13 changed files with 28 additions and 18 deletions

View File

@ -515,7 +515,7 @@ class WC_Admin_Settings {
}
?><tr valign="top">
<th scope="row" class="titledesc"><?php echo esc_html( $value['title'] ) ?> <?php echo $tooltip_html; echo $disabled_message; ?></th>
<th scope="row" class="titledesc"><?php echo esc_html( $value['title'] ) ?> <?php echo $tooltip_html . $disabled_message; ?></th>
<td class="forminp image_width_settings">
<input name="<?php echo esc_attr( $value['id'] ); ?>[width]" <?php echo $disabled_attr; ?> id="<?php echo esc_attr( $value['id'] ); ?>-width" type="text" size="3" value="<?php echo $width; ?>" /> &times; <input name="<?php echo esc_attr( $value['id'] ); ?>[height]" <?php echo $disabled_attr; ?> id="<?php echo esc_attr( $value['id'] ); ?>-height" type="text" size="3" value="<?php echo $height; ?>" />px

View File

@ -36,9 +36,11 @@ $who_refunded = new WP_User( $refund->get_refunded_by() );
</div>
</td>
<?php if ( wc_tax_enabled() ) : for ( $i = 0; $i < count( $order_taxes ); $i++ ) : ?>
<td class="line_tax" width="1%"></td>
<?php endfor; endif; ?>
<?php if ( wc_tax_enabled() ) : ?>
<?php for ( $i = 0; $i < count( $order_taxes ); $i++ ) : ?>
<td class="line_tax" width="1%"></td>
<?php endfor; ?>
<?php endif; ?>
<td class="wc-order-edit-line-item">
<div class="wc-order-edit-line-item-actions">

View File

@ -59,7 +59,7 @@ extract( $variation_data );
<div class="woocommerce_variable_attributes wc-metabox-content" style="display: none;">
<div class="data">
<p class="form-row form-row-first upload_image">
<a href="#" class="upload_image_button tips <?php if ( $_thumbnail_id > 0 ) echo 'remove'; ?>" data-tip="<?php if ( $_thumbnail_id > 0 ) { echo __( 'Remove this image', 'woocommerce' ); } else { echo __( 'Upload an image', 'woocommerce' ); } ?>" rel="<?php echo esc_attr( $variation_id ); ?>"><img src="<?php if ( ! empty( $image ) ) echo esc_attr( $image ); else echo esc_attr( wc_placeholder_img_src() ); ?>" /><input type="hidden" name="upload_image_id[<?php echo $loop; ?>]" class="upload_image_id" value="<?php echo esc_attr( $_thumbnail_id ); ?>" /></a>
<a href="#" class="upload_image_button tips <?php echo ( $_thumbnail_id > 0 ) ? 'remove' : ''; ?>" data-tip="<?php echo ( $_thumbnail_id > 0 ) ? __( 'Remove this image', 'woocommerce' ) : __( 'Upload an image', 'woocommerce' ); ?>" rel="<?php echo esc_attr( $variation_id ); ?>"><img src="<?php echo ( ! empty( $image ) ) ? esc_attr( $image ) : esc_attr( wc_placeholder_img_src() ); ?>" /><input type="hidden" name="upload_image_id[<?php echo $loop; ?>]" class="upload_image_id" value="<?php echo esc_attr( $_thumbnail_id ); ?>" /></a>
</p>
<?php if ( wc_product_sku_enabled() ) : ?>
<p class="sku form-row form-row-last">

View File

@ -579,14 +579,18 @@ class WC_Admin_Report {
public function get_currency_tooltip() {
switch ( get_option( 'woocommerce_currency_pos' ) ) {
case 'right':
$currency_tooltip = 'append_tooltip: "' . get_woocommerce_currency_symbol() . '"'; break;
$currency_tooltip = 'append_tooltip: "' . get_woocommerce_currency_symbol() . '"';
break;
case 'right_space':
$currency_tooltip = 'append_tooltip: "&nbsp;' . get_woocommerce_currency_symbol() . '"'; break;
$currency_tooltip = 'append_tooltip: "&nbsp;' . get_woocommerce_currency_symbol() . '"';
break;
case 'left':
$currency_tooltip = 'prepend_tooltip: "' . get_woocommerce_currency_symbol() . '"'; break;
$currency_tooltip = 'prepend_tooltip: "' . get_woocommerce_currency_symbol() . '"';
break;
case 'left_space':
default:
$currency_tooltip = 'prepend_tooltip: "' . get_woocommerce_currency_symbol() . '&nbsp;"'; break;
$currency_tooltip = 'prepend_tooltip: "' . get_woocommerce_currency_symbol() . '&nbsp;"';
break;
}
return $currency_tooltip;

View File

@ -506,7 +506,7 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
position: "bottom",
tickColor: 'transparent',
mode: "time",
timeformat: "<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>",
timeformat: "<?php echo ( $this->chart_groupby == 'day' ) ? '%d %b' : '%b'; ?>",
monthNames: <?php echo json_encode( array_values( $wp_locale->month_abbrev ) ) ?>,
tickLength: 1,
minTickSize: [1, "<?php echo $this->chart_groupby; ?>"],

View File

@ -375,7 +375,7 @@ class WC_Report_Customers extends WC_Admin_Report {
position: "bottom",
tickColor: 'transparent',
mode: "time",
timeformat: "<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>",
timeformat: "<?php echo ( $this->chart_groupby == 'day' ) ? '%d %b' : '%b'; ?>",
monthNames: <?php echo json_encode( array_values( $wp_locale->month_abbrev ) ) ?>,
tickLength: 1,
minTickSize: [1, "<?php echo $this->chart_groupby; ?>"],

View File

@ -396,7 +396,7 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report {
position: "bottom",
tickColor: 'transparent',
mode: "time",
timeformat: "<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>",
timeformat: "<?php echo ( $this->chart_groupby == 'day' ) ? '%d %b' : '%b'; ?>",
monthNames: <?php echo json_encode( array_values( $wp_locale->month_abbrev ) ); ?>,
tickLength: 1,
minTickSize: [1, "<?php echo $this->chart_groupby; ?>"],

View File

@ -673,7 +673,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
position: "bottom",
tickColor: 'transparent',
mode: "time",
timeformat: "<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>",
timeformat: "<?php echo ( $this->chart_groupby == 'day' ) ? '%d %b' : '%b'; ?>",
monthNames: <?php echo json_encode( array_values( $wp_locale->month_abbrev ) ) ?>,
tickLength: 1,
minTickSize: [1, "<?php echo $this->chart_groupby; ?>"],

View File

@ -539,7 +539,7 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
position: "bottom",
tickColor: 'transparent',
mode: "time",
timeformat: "<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>",
timeformat: "<?php echo ( $this->chart_groupby == 'day' ) ? '%d %b' : '%b'; ?>",
monthNames: <?php echo json_encode( array_values( $wp_locale->month_abbrev ) ) ?>,
tickLength: 1,
minTickSize: [1, "<?php echo $this->chart_groupby; ?>"],

View File

@ -67,7 +67,7 @@ $pages = $system_status->get_pages();
<tr>
<td data-export-label="WP Multisite"><?php _e( 'WP Multisite', 'woocommerce' ); ?>:</td>
<td class="help"><?php echo wc_help_tip( __( 'Whether or not you have WordPress Multisite enabled.', 'woocommerce' ) ); ?></td>
<td><?php if ( $environment['wp_multisite'] ) echo '<span class="dashicons dashicons-yes"></span>'; else echo '&ndash;'; ?></td>
<td><?php echo ( $environment['wp_multisite'] ) ? '<span class="dashicons dashicons-yes"></span>' : '&ndash;'; ?></td>
</tr>
<tr>
<td data-export-label="WP Memory Limit"><?php _e( 'WP Memory Limit', 'woocommerce' ); ?>:</td>

View File

@ -730,7 +730,10 @@ class WC_Shortcodes {
ob_start();
while ( $single_product->have_posts() ) : $single_product->the_post(); wp_enqueue_script( 'wc-single-product' ); ?>
while ( $single_product->have_posts() ) :
$single_product->the_post();
wp_enqueue_script( 'wc-single-product' );
?>
<div class="single-product" data-product-page-preselected-id="<?php echo esc_attr( $preselected_id ); ?>">

View File

@ -129,7 +129,8 @@ if ( ! class_exists( 'WC_Eval_Math' ) ) {
// ===============
} elseif ( ( in_array( $op, $ops ) or $ex ) and $expecting_op ) { // are we putting an operator on the stack?
if ( $ex ) { // are we expecting an operator but have a number/variable/function/opening parethesis?
$op = '*'; $index--; // it's an implicit multiplication
$op = '*';
$index--; // it's an implicit multiplication
}
// heart of the algorithm:
while ( $stack->count > 0 and ( $o2 = $stack->last() ) and in_array( $o2, $ops ) and ( $ops_r[ $op ] ? $ops_p[ $op ] < $ops_p[ $o2 ] : $ops_p[ $op ] <= $ops_p[ $o2 ] ) ) {

View File

@ -21,7 +21,7 @@
<!-- <exclude name="Generic.Files.EndFileNewline.NotFound" /> -->
<exclude name="Generic.Files.LineEndings.InvalidEOLChar" />
<exclude name="Generic.Files.LowercasedFilename.NotFound" />
<exclude name="Generic.Formatting.DisallowMultipleStatements.SameLine" />
<!-- <exclude name="Generic.Formatting.DisallowMultipleStatements.SameLine" /> -->
<!-- <exclude name="Generic.Formatting.SpaceAfterCast.NoSpace" /> -->
<exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine" />
<exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace" />