Skip to content

Commit 45cd985

Browse files
authored
Fix phpcs locally with PHP 8.2, fix #43
1 parent 67bd517 commit 45cd985

36 files changed

+67
-64
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file and formatte
44
## [1.1.1] - 2024-XX-XX
55
### Fixed
66
- Function return type broke WPForms.Formatting.EmptyLineBeforeReturn sniff.
7+
- The phpcs did not work locally with PHP 8+.
78

89
## [1.1.0] - 2023-09-07
910
### Fixed

WPForms/Sniffs/BaseSniff.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function getRootDirectory( $phpcsFile ) {
6767
}
6868

6969
/**
70-
* Get relative path from project root directory.
70+
* Get a relative path from project root directory.
7171
*
7272
* @since 1.0.0
7373
*
@@ -119,7 +119,7 @@ protected function normalizeFilename( $filename ) {
119119
}
120120

121121
/**
122-
* Get first argument of a function.
122+
* Get the first argument of a function.
123123
*
124124
* @since 1.0.0
125125
*
@@ -152,7 +152,7 @@ protected function getFirstArgument( $phpcsFile, $stackPtr ) {
152152
}
153153

154154
/**
155-
* Check whether the token is break in switch statement.
155+
* Check whether the token is break in the switch statement.
156156
*
157157
* @since 1.0.4
158158
*
@@ -176,7 +176,7 @@ protected function isBreakInSwitch( $phpcsFile, $token ) {
176176
}
177177

178178
/**
179-
* Get fully qualified class name.
179+
* Get a fully qualified class name.
180180
*
181181
* @since 1.0.0
182182
*
@@ -219,7 +219,7 @@ protected function getFullyQualifiedClassName( $phpcsFile ) {
219219
$fqcn = $this->camelToSnake( str_replace( '\\', '', $namespace ) ) . '_' . $class;
220220

221221
// Fix WPForms.
222-
// Remove _plugin for main plugin class, which is usually Plugin.
222+
// Remove _plugin for the main plugin class, which is usually Plugin.
223223
$fqcn = str_replace( [ 'wp_forms', '_plugin' ], [ 'wpforms', '' ], $fqcn );
224224

225225
$fqcnArr = explode( '_', $fqcn );

WPForms/Sniffs/Comments/DeprecatedTagHooksSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function register() {
5959
}
6060

6161
/**
62-
* Processes this test, when one of its tokens is encountered.
62+
* Process this test when one of its tokens is encountered.
6363
*
6464
* @since 1.0.0
6565
*

WPForms/Sniffs/Comments/DeprecatedTagSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function register() {
3939
}
4040

4141
/**
42-
* Processes this test, when one of its tokens is encountered.
42+
* Process this test when one of its tokens is encountered.
4343
*
4444
* @since 1.0.0
4545
*

WPForms/Sniffs/Comments/DescriptionStopSymbolPropertySniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class DescriptionStopSymbolPropertySniff extends PropertyBaseSniff {
1818
use Description;
1919

2020
/**
21-
* Called to process class member vars.
21+
* Process Process this test when one of its tokens is encountered..
2222
*
2323
* @since 1.0.0
2424
*

WPForms/Sniffs/Comments/DescriptionStopSymbolSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function register() {
3737
}
3838

3939
/**
40-
* Processes this test, when one of its tokens is encountered.
40+
* Process this test when one of its tokens is encountered.
4141
*
4242
* @since 1.0.0
4343
*

WPForms/Sniffs/Comments/LanguageInjectionSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function register() {
2929
}
3030

3131
/**
32-
* Processes this test, when one of its tokens is encountered.
32+
* Process this test when one of its tokens is encountered.
3333
*
3434
* @since 1.0.0
3535
*

WPForms/Sniffs/Comments/NoSpacesAfterParamTagSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function register() {
4040
}
4141

4242
/**
43-
* Processes this test, when one of its tokens is encountered.
43+
* Process this test when one of its tokens is encountered.
4444
*
4545
* @since 1.0.0
4646
*
@@ -59,7 +59,7 @@ public function process( File $phpcsFile, $stackPtr ) {
5959
return;
6060
}
6161

62-
// More than 1 spaces.
62+
// More than one space.
6363
if ( $tokens[ $tag['tag'] + 1 ]['length'] > 1 ) {
6464
$phpcsFile->addError(
6565
sprintf(

WPForms/Sniffs/Comments/PHPDocDefineSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function register() {
3131
}
3232

3333
/**
34-
* Processes this test, when one of its tokens is encountered.
34+
* Process this test when one of its tokens is encountered.
3535
*
3636
* @since 1.0.0
3737
*

WPForms/Sniffs/Comments/PHPDocHooksSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function register() {
4242
}
4343

4444
/**
45-
* Processes this test, when one of its tokens is encountered.
45+
* Process this test when one of its tokens is encountered.
4646
*
4747
* @since 1.0.0
4848
*

0 commit comments

Comments
 (0)