Skip to content

Commit 992184c

Browse files
committed
Coding Standards: Upgrade WPCS to 1.2.1.
This upgrade fixes quite a few false positives, as well as auto-fixing some indenting issues. Fixes #45956. git-svn-id: https://develop.svn.wordpress.org/trunk@44574 602fd350-edb4-49c9-b593-d223f7449a82
1 parent a139c8c commit 992184c

45 files changed

Lines changed: 248 additions & 256 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"issues": "https://core.trac.wordpress.org/"
1111
},
1212
"require-dev": {
13-
"dealerdirect/phpcodesniffer-composer-installer": "~0.4.4",
14-
"wp-coding-standards/wpcs": "~1.0.0"
13+
"dealerdirect/phpcodesniffer-composer-installer": "~0.5.0",
14+
"wp-coding-standards/wpcs": "~1.2.0"
1515
},
1616
"scripts": {
1717
"format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source",

composer.lock

Lines changed: 24 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpcs.xml.dist

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55
<rule ref="WordPress-Core"/>
66
<rule ref="WordPress.CodeAnalysis.EmptyStatement"/>
77

8-
<rule ref="PEAR.Functions.FunctionCallSignature">
9-
<properties>
10-
<property name="allowMultipleArguments" value="false"/>
11-
</properties>
12-
</rule>
13-
148
<rule ref="WordPress.NamingConventions.ValidVariableName">
159
<properties>
1610
<property name="customPropertiesWhitelist" type="array">

src/wp-activate.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ function wpmu_activate_stylesheet() {
135135
</form>
136136

137137
<?php
138-
} else {
139-
if ( is_wp_error( $result ) && in_array( $result->get_error_code(), $valid_error_codes ) ) {
140-
$signup = $result->get_error_data();
141-
?>
138+
} else {
139+
if ( is_wp_error( $result ) && in_array( $result->get_error_code(), $valid_error_codes ) ) {
140+
$signup = $result->get_error_data();
141+
?>
142142
<h2><?php _e( 'Your account is now active!' ); ?></h2>
143143
<?php
144144
echo '<p class="lead-in">';
@@ -162,17 +162,17 @@ function wpmu_activate_stylesheet() {
162162
);
163163
}
164164
echo '</p>';
165-
} elseif ( $result === null || is_wp_error( $result ) ) {
166-
?>
165+
} elseif ( $result === null || is_wp_error( $result ) ) {
166+
?>
167167
<h2><?php _e( 'An error occurred during the activation' ); ?></h2>
168168
<?php if ( is_wp_error( $result ) ) : ?>
169169
<p><?php echo $result->get_error_message(); ?></p>
170170
<?php endif; ?>
171171
<?php
172-
} else {
173-
$url = isset( $result['blog_id'] ) ? get_home_url( (int) $result['blog_id'] ) : '';
174-
$user = get_userdata( (int) $result['user_id'] );
175-
?>
172+
} else {
173+
$url = isset( $result['blog_id'] ) ? get_home_url( (int) $result['blog_id'] ) : '';
174+
$user = get_userdata( (int) $result['user_id'] );
175+
?>
176176
<h2><?php _e( 'Your account is now active!' ); ?></h2>
177177

178178
<div id="signup-welcome">
@@ -199,11 +199,11 @@ function wpmu_activate_stylesheet() {
199199
printf( __( 'Your account is now activated. <a href="%1$s">Log in</a> or go back to the <a href="%2$s">homepage</a>.' ), network_site_url( 'wp-login.php', 'login' ), network_home_url() );
200200
?>
201201
</p>
202-
<?php
203-
endif;
202+
<?php
203+
endif;
204+
}
204205
}
205-
}
206-
?>
206+
?>
207207
</div>
208208
</div>
209209
<script type="text/javascript">

src/wp-admin/custom-header.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -642,43 +642,43 @@ public function step_1() {
642642
</tr>
643643
<?php
644644
endif;
645-
if ( ! empty( $this->default_headers ) ) :
646-
?>
645+
if ( ! empty( $this->default_headers ) ) :
646+
?>
647647
<tr>
648648
<th scope="row"><?php _e( 'Default Images' ); ?></th>
649649
<td>
650-
<?php if ( current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
650+
<?php if ( current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
651651
<p><?php _e( 'If you don&lsquo;t want to upload your own image, you can use one of these cool headers, or show a random one.' ); ?></p>
652652
<?php else : ?>
653653
<p><?php _e( 'You can use one of these cool headers or show a random one on each page.' ); ?></p>
654654
<?php endif; ?>
655-
<?php
656-
$this->show_header_selector( 'default' );
657-
?>
655+
<?php
656+
$this->show_header_selector( 'default' );
657+
?>
658658
</td>
659659
</tr>
660-
<?php
660+
<?php
661661
endif;
662-
if ( get_header_image() ) :
663-
?>
662+
if ( get_header_image() ) :
663+
?>
664664
<tr>
665665
<th scope="row"><?php _e( 'Remove Image' ); ?></th>
666666
<td>
667667
<p><?php _e( 'This will remove the header image. You will not be able to restore any customizations.' ); ?></p>
668-
<?php submit_button( __( 'Remove Header Image' ), '', 'removeheader', false ); ?>
668+
<?php submit_button( __( 'Remove Header Image' ), '', 'removeheader', false ); ?>
669669
</td>
670670
</tr>
671-
<?php
671+
<?php
672672
endif;
673673

674-
$default_image = sprintf( get_theme_support( 'custom-header', 'default-image' ), get_template_directory_uri(), get_stylesheet_directory_uri() );
675-
if ( $default_image && get_header_image() != $default_image ) :
676-
?>
674+
$default_image = sprintf( get_theme_support( 'custom-header', 'default-image' ), get_template_directory_uri(), get_stylesheet_directory_uri() );
675+
if ( $default_image && get_header_image() != $default_image ) :
676+
?>
677677
<tr>
678678
<th scope="row"><?php _e( 'Reset Image' ); ?></th>
679679
<td>
680680
<p><?php _e( 'This will restore the original header image. You will not be able to restore any customizations.' ); ?></p>
681-
<?php submit_button( __( 'Restore Original Header Image' ), '', 'resetheader', false ); ?>
681+
<?php submit_button( __( 'Restore Original Header Image' ), '', 'resetheader', false ); ?>
682682
</td>
683683
</tr>
684684
<?php endif; ?>
@@ -741,7 +741,7 @@ public function step_1() {
741741
do_action( 'custom_header_options' );
742742

743743
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' );
744-
?>
744+
?>
745745

746746
<?php submit_button( null, 'primary', 'save-header-options' ); ?>
747747
</form>

src/wp-admin/includes/class-wp-list-table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ protected function display_tablenav( $which ) {
12181218
endif;
12191219
$this->extra_tablenav( $which );
12201220
$this->pagination( $which );
1221-
?>
1221+
?>
12221222

12231223
<br class="clear" />
12241224
</div>

src/wp-admin/includes/class-wp-plugin-install-list-table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public function no_items() {
280280
<?php } else { ?>
281281
<div class="no-plugin-results"><?php _e( 'No plugins found. Try a different search.' ); ?></div>
282282
<?php
283-
}
283+
}
284284
}
285285

286286
/**
@@ -392,7 +392,7 @@ protected function display_tablenav( $which ) {
392392
<br class="clear" />
393393
</div>
394394
<?php
395-
}
395+
}
396396
}
397397

398398
/**

0 commit comments

Comments
 (0)