Skip to content

Commit ba87afd

Browse files
committed
fix (cs) update rules
1 parent 3608a07 commit ba87afd

File tree

6 files changed

+19
-13
lines changed

6 files changed

+19
-13
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
77
"php-parallel-lint/php-parallel-lint": "^1.2",
88
"phpcompatibility/php-compatibility": "^9.3",
9-
"phpro/grumphp-shim": "^0.19.1",
9+
"phpro/grumphp-shim": "^1.5",
1010
"squizlabs/php_codesniffer": "^3.5",
1111
"vimeo/psalm": "^3.13",
1212
"wp-coding-standards/wpcs": "^2.3"

grumphp.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ grumphp:
55
keywords:
66
- "var_dump("
77
- "<<<<<<< HEAD"
8+
- "beapi.top"
9+
- "beapi.space"
10+
- "beapi.science"
11+
- "beapi.xyz"
812
whitelist_patterns: []
913
triggered_by: ['php']
1014
regexp_type: G
@@ -13,7 +17,7 @@ grumphp:
1317
jobs: ~
1418
triggered_by: ['php', 'phtml', 'php3', 'php4', 'php5', 'php7']
1519
phpcs:
16-
standard: ['phpcs.xml']
20+
standard: ['phpcs.xml.dist']
1721
triggered_by: [php]
1822
composer:
1923
no_check_all: true
@@ -25,5 +29,6 @@ grumphp:
2529
psalm:
2630
config: psalm.xml
2731
triggered_by: ['php']
32+
show_info: true
2833
testsuites: []
2934
extensions: []

inc/Services/Assets_JS_Async.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function register( Service_Container $container ): void {}
2929
*/
3030
public function boot( Service_Container $container ): void {
3131
if ( current_theme_supports( 'async-js' ) && ! is_admin() ) {
32-
add_filter( 'script_loader_tag', array( $this, 'script_loader_tag' ), 20, 2 );
32+
add_filter( 'script_loader_tag', [ $this, 'script_loader_tag' ], 20, 2 );
3333
}
3434

3535
/**

inc/Services/Editor_Patterns.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function register_patterns(): void {
8787
return;
8888
}
8989

90-
$default_headers = array(
90+
$default_headers = [
9191
'title' => 'Title',
9292
'slug' => 'Slug',
9393
'description' => 'Description',
@@ -96,11 +96,11 @@ public function register_patterns(): void {
9696
'keywords' => 'Keywords',
9797
'blockTypes' => 'Block Types',
9898
'inserter' => 'Inserter',
99-
);
99+
];
100100

101101
// Register patterns for the active theme. If the theme is a child theme,
102102
// let it override any patterns from the parent theme that shares the same slug.
103-
$themes = array();
103+
$themes = [];
104104
$stylesheet = get_stylesheet();
105105
$template = get_template();
106106
if ( $stylesheet !== $template ) {
@@ -161,7 +161,7 @@ public function register_patterns(): void {
161161
}
162162

163163
// For properties of type array, parse data as comma-separated.
164-
foreach ( array( 'categories', 'keywords', 'blockTypes' ) as $property ) {
164+
foreach ( [ 'categories', 'keywords', 'blockTypes' ] as $property ) {
165165
if ( ! empty( $pattern_data[ $property ] ) ) {
166166
$pattern_data[ $property ] = array_filter(
167167
preg_split(
@@ -175,7 +175,7 @@ public function register_patterns(): void {
175175
}
176176

177177
// Parse properties of type int.
178-
foreach ( array( 'viewportWidth' ) as $property ) {
178+
foreach ( [ 'viewportWidth' ] as $property ) {
179179
if ( ! empty( $pattern_data[ $property ] ) ) {
180180
$pattern_data[ $property ] = (int) $pattern_data[ $property ];
181181
} else {
@@ -184,11 +184,11 @@ public function register_patterns(): void {
184184
}
185185

186186
// Parse properties of type bool.
187-
foreach ( array( 'inserter' ) as $property ) {
187+
foreach ( [ 'inserter' ] as $property ) {
188188
if ( ! empty( $pattern_data[ $property ] ) ) {
189189
$pattern_data[ $property ] = in_array(
190190
strtolower( $pattern_data[ $property ] ),
191-
array( 'yes', 'true' ),
191+
[ 'yes', 'true' ],
192192
true
193193
);
194194
} else {

inc/Tools/Template_Parts.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Template_Parts implements Service {
1717
* @var array
1818
* @author Maxime Culea
1919
*/
20-
private $vars = array();
20+
private $vars = [];
2121

2222
/**
2323
* @param Service_Container $container

phpcs.xml phpcs.xml.dist

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
<file>.</file>
1313

1414
<!-- Exclude the Composer Vendor directory. -->
15-
<exclude-pattern>web/app/themes/*/src/</exclude-pattern>
16-
<exclude-pattern>web/app/themes/*/autoload.php</exclude-pattern>
15+
<exclude-pattern>src/</exclude-pattern>
16+
<exclude-pattern>vendor/</exclude-pattern>
17+
<exclude-pattern>autoload.php</exclude-pattern>
1718

1819
<rule ref="WordPress-Extra">
1920
<!-- Exclude as we use a custom autoloader. -->

0 commit comments

Comments
 (0)