Skip to content

Commit 7fcf7fa

Browse files
committed
Upgrade WPCS to latest
1 parent f4e8275 commit 7fcf7fa

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"composer-runtime-api": "^2.0"
99
},
1010
"require-dev": {
11-
"dealerdirect/phpcodesniffer-composer-installer": "0.7.2",
11+
"dealerdirect/phpcodesniffer-composer-installer": "1.0.0",
1212
"phpcompatibility/phpcompatibility-wp": "2.1.4",
13-
"squizlabs/php_codesniffer": "3.7.1",
14-
"wp-coding-standards/wpcs": "2.3"
13+
"squizlabs/php_codesniffer": "3.7.2",
14+
"wp-coding-standards/wpcs": "3.0.1"
1515
},
1616
"config": {
1717
"allow-plugins": {

includes/class-bbpress-allowed-shortcodes-admin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function register_plugin_options_page(): void {
8181
add_options_page(
8282
__( 'bbPress Allowed Shortcodes', 'bbpress-allowed-shortcodes' ),
8383
__( 'bbPress Allowed Shortcodes', 'bbpress-allowed-shortcodes' ),
84-
'administrator',
84+
'manage_options',
8585
'bbpress-allowed-shortcodes',
8686
[ $this, 'show_settings_page' ],
8787
);
@@ -112,8 +112,8 @@ public function register_plugin_settings(): void {
112112
/**
113113
* Prints the allowed shortcodes list field.
114114
*/
115-
public function print_bbpress_allowed_shortcodes_list_field( array $args ): void {
116-
echo sprintf(
115+
public function print_bbpress_allowed_shortcodes_list_field(): void {
116+
printf(
117117
'<input type="text" id="bbpress_allowed_shortcodes_list" name="bbpress_allowed_shortcodes_list" class="regular-text code" value="%s" />',
118118
esc_attr( get_option( 'bbpress_allowed_shortcodes_list', '' ) )
119119
);

includes/class-bbpress-allowed-shortcodes-autoloader.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,28 @@ public static function unregister(): void {
6464
/**
6565
* Auto-load function for plugin classes.
6666
*
67-
* @param string $class Class name.
67+
* @param string $class_name Class name.
6868
*/
69-
public function autoload( string $class ): void {
70-
$class = strtolower( $class );
69+
public function autoload( string $class_name ): void {
70+
$class_name = strtolower( $class_name );
7171

7272
// Only attempt to load classes if they look like they come from this plugin
73-
if ( strpos( $class, 'bbpress_allowed_shortcodes_' ) !== 0 ) {
73+
if ( strpos( $class_name, 'bbpress_allowed_shortcodes_' ) !== 0 ) {
7474
return;
7575
}
7676

77-
$file = $this->get_file_name_from_class_name( $class );
77+
$file = $this->get_file_name_from_class_name( $class_name );
7878

7979
$this->include_file_if_readable( $this->include_path . $file );
8080
}
8181

8282
/**
8383
* Take a class name and turn it into a file name.
8484
*
85-
* @param string $class Class name.
85+
* @param string $class_name Class name.
8686
*/
87-
private function get_file_name_from_class_name( string $class ): string {
88-
return 'class-' . str_replace( '_', '-', $class ) . '.php';
87+
private function get_file_name_from_class_name( string $class_name ): string {
88+
return 'class-' . str_replace( '_', '-', $class_name ) . '.php';
8989
}
9090

9191
/**

phpcs.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<!-- These rules come from the WordPress coding standards -->
1313
<rule ref="WordPress-Extra">
14-
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
14+
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
1515
<exclude name="WordPress.PHP.YodaConditions.NotYoda" />
1616
</rule>
1717

0 commit comments

Comments
 (0)