Skip to content

Commit 226873e

Browse files
committed
Update squizlabs/php_codesniffer from 3.13.5 to 4.0.1
1 parent 15c1118 commit 226873e

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

.github/workflows/test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ jobs:
2727
- php-version: '8.2'
2828
dependencies: highest
2929
allowed-to-fail: true
30-
variant: 'squizlabs/php_codesniffer:"dev-master"'
30+
variant: 'squizlabs/php_codesniffer:"dev-4.x"'
3131
- php-version: '8.3'
3232
dependencies: highest
3333
allowed-to-fail: true
34-
variant: 'squizlabs/php_codesniffer:"dev-master"'
34+
variant: 'squizlabs/php_codesniffer:"dev-4.x"'
3535
- php-version: '8.4'
3636
dependencies: highest
3737
allowed-to-fail: true
38-
variant: 'squizlabs/php_codesniffer:"dev-master"'
38+
variant: 'squizlabs/php_codesniffer:"dev-4.x"'
3939

4040
steps:
4141
- name: Checkout

Swivl/Sniffs/Commenting/ClassCommentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Swivl\Sniffs\Commenting;
44

55
use PHP_CodeSniffer\Files\File;
6-
use PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClassCommentSniff as SquizClassCommentSniff;
76
use PHP_CodeSniffer\Util\Tokens;
7+
use PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClassCommentSniff as SquizClassCommentSniff;
88

99
/**
1010
* ClassCommentSniff

Swivl/Sniffs/Commenting/FunctionCommentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
use PHP_CodeSniffer\Files\File;
66
use PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\DocCommentSniff;
7-
use PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentSniff as SquizFunctionCommentSniff;
87
use PHP_CodeSniffer\Util\Tokens;
98
use Swivl\Helpers\FunctionHelper;
109
use Swivl\Helpers\TypeHelper;
10+
use PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentSniff as SquizFunctionCommentSniff;
1111

1212
/**
1313
* FunctionCommentSniff

Swivl/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ public function process(File $phpcsFile, $stackPtr): void
5151
$closeBrace = $tokens[$stackPtr]['scope_closer'];
5252
$prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), null, true);
5353

54-
// Special case for empty JS functions
55-
if ($phpcsFile->tokenizerType === 'JS' && $prevContent === $tokens[$stackPtr]['scope_opener']) {
54+
// Special case for empty JS functions (PHPCS < 4 only; JS support removed in PHPCS 4+)
55+
if (
56+
property_exists($phpcsFile, 'tokenizerType')
57+
&& $phpcsFile->tokenizerType === 'JS'
58+
&& $prevContent === $tokens[$stackPtr]['scope_opener']
59+
) {
5660
// In this case, the opening and closing brace must be
5761
// right next to each other.
5862
if ($tokens[$stackPtr]['scope_closer'] !== ($tokens[$stackPtr]['scope_opener'] + 1)) {

Swivl/ruleset.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@
6969
</properties>
7070
</rule>
7171

72-
<rule ref="Generic.Functions.CallTimePassByReference"/>
73-
7472
<rule ref="Generic.Metrics.NestingLevel">
7573
<properties>
7674
<property name="nestingLevel" value="6"/>
@@ -271,7 +269,6 @@
271269
<property name="spacingAfterLast" value="0"/>
272270
</properties>
273271
</rule>
274-
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
275272
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
276273
<rule ref="Squiz.WhiteSpace.MemberVarSpacing">
277274
<properties>

Swivl/slevomat.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@
295295
<property name="spacesCountBeforeColon" value="0"/>
296296
</properties>
297297
</rule>
298-
<rule ref="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat">
298+
<rule ref="SlevomatCodingStandard.TypeHints.DNFTypeHintFormat">
299299
<properties>
300300
<property name="withSpaces" value="no"/>
301301
<property name="nullPosition" value="last"/>

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
}
1515
],
1616
"require": {
17-
"php": ">=7.1",
18-
"squizlabs/php_codesniffer": "^3.6"
17+
"php": ">=7.2",
18+
"squizlabs/php_codesniffer": "4.0.*"
1919
},
2020
"conflict": {
2121
"doctrine/orm": "<2.9"

0 commit comments

Comments
 (0)