Coding Standards: Fix spacing for incrementors and decrementors in various files.

Note: This will be enforced by WPCS 3.0.0.

Props jrf.
See #56791.

git-svn-id: https://develop.svn.wordpress.org/trunk@54896 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2022-11-29 21:11:42 +00:00
parent 4b55a18d23
commit 8e44ab05a6
10 changed files with 15 additions and 15 deletions

View File

@@ -73,7 +73,7 @@ class WPProfiler {
if ( isset( $this->profile[ $name ] ) ) {
$this->profile[ $name ]['time'] += $time;
$this->profile[ $name ]['calls'] ++;
$this->profile[ $name ]['calls']++;
$this->profile[ $name ]['cache_cold_hits'] += ( $wp_object_cache->cold_cache_hits - $item['cache_cold_hits'] );
$this->profile[ $name ]['cache_warm_hits'] += ( $wp_object_cache->warm_cache_hits - $item['cache_warm_hits'] );
$this->profile[ $name ]['cache_misses'] += ( $wp_object_cache->cache_misses - $item['cache_misses'] );
@@ -143,7 +143,7 @@ class WPProfiler {
$sql = preg_replace( '/(WHERE \w+ =) \d+/', '$1 x', $sql );
$sql = preg_replace( '/(WHERE \w+ =) \'\[-\w]+\'/', '$1 \'xxx\'', $sql );
$out[ $sql ] ++;
$out[ $sql ]++;
}
asort( $out );
return;

View File

@@ -80,7 +80,7 @@ class Tests_Date_TheDate extends WP_UnitTestCase {
}
public function count_hook( $input ) {
$this->hooks_called[ current_filter() ] ++;
$this->hooks_called[ current_filter() ]++;
return $input;
}

View File

@@ -17,10 +17,10 @@ class Tests_Meta_isProtectedMeta extends WP_UnitTestCase {
$protected_keys = array(
array( '_wp_attachment' ),
);
for ( $i = 0, $max = 31; $i < $max; $i ++ ) {
for ( $i = 0, $max = 31; $i < $max; $i++ ) {
$protected_keys[] = array( chr( $i ) . '_wp_attachment' );
}
for ( $i = 127, $max = 159; $i <= $max; $i ++ ) {
for ( $i = 127, $max = 159; $i <= $max; $i++ ) {
$protected_keys[] = array( chr( $i ) . '_wp_attachment' );
}
$protected_keys[] = array( chr( 95 ) . '_wp_attachment' );
@@ -42,10 +42,10 @@ class Tests_Meta_isProtectedMeta extends WP_UnitTestCase {
array( 'ąŌ_not_so_protected_meta' ),
);
for ( $i = 32, $max = 94; $i <= $max; $i ++ ) {
for ( $i = 32, $max = 94; $i <= $max; $i++ ) {
$unprotected_keys[] = array( chr( $i ) . '_wp_attachment' );
}
for ( $i = 96, $max = 126; $i <= $max; $i ++ ) {
for ( $i = 96, $max = 126; $i <= $max; $i++ ) {
$unprotected_keys[] = array( chr( $i ) . '_wp_attachment' );
}

View File

@@ -949,7 +949,7 @@ class WP_Test_REST_Sidebars_Controller extends WP_Test_REST_Controller_Testcase
if ( isset( $item['_links'] ) ) {
unset( $data[ $count ]['_links'] );
}
$count ++;
$count++;
}
return $data;

View File

@@ -1555,7 +1555,7 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase {
if ( is_array( $item ) && isset( $item['_links'] ) ) {
unset( $data[ $count ]['_links'] );
}
$count ++;
$count++;
}
return $data;

View File

@@ -375,7 +375,7 @@ class Tests_REST_WpRestMenuItemsController extends WP_Test_REST_Post_Type_Contro
$new_menu_id = wp_create_nav_menu( rand_str() );
$expected = array();
$actual = array();
for ( $i = 1; $i < 5; $i ++ ) {
for ( $i = 1; $i < 5; $i++ ) {
$request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
$request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
$params = $this->set_menu_item_data(
@@ -921,7 +921,7 @@ class Tests_REST_WpRestMenuItemsController extends WP_Test_REST_Post_Type_Contro
foreach ( $taxonomies as $taxonomy ) {
$this->assertSame( $taxonomy->name, $links['https://api.w.org/term'][ $num ]['attributes']['taxonomy'] );
$this->assertSame( add_query_arg( 'post', $data['id'], rest_url( 'wp/v2/' . $taxonomy->rest_base ) ), $links['https://api.w.org/term'][ $num ]['href'] );
$num ++;
$num++;
}
if ( 'post_type' === $data['type'] ) {

View File

@@ -648,7 +648,7 @@ class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase {
$this->assertNotEmpty( $user_cpt, 'User CPT is expected not to be empty.' );
$global_styles_query_count = 0;
for ( $i = 0; $i < 3; $i ++ ) {
for ( $i = 0; $i < 3; $i++ ) {
$new_user_cpt = WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles( $theme );
WP_Theme_JSON_Resolver::clean_cached_data();
$this->assertSameSets( $user_cpt, $new_user_cpt, "User CPTs do not match on run {$i}." );