Skip to content

Commit eeeffb3

Browse files
committed
Composer: switch to phpcsstandards/php_codesniffer - keep squizlabs compatibility
1 parent 2c07e01 commit eeeffb3

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"require": {
1414
"nette/neon": "^3.3",
1515
"php": "^8.0",
16-
"squizlabs/php_codesniffer": "^3.7"
16+
"phpcsstandards/php_codesniffer": "^3.8"
1717
},
1818
"require-dev": {
1919
"forrest79/phpcs": "^1.1",

phpstan.neon

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,6 @@ parameters:
2727
count: 1
2828
path: src/File.php
2929

30-
-
31-
message: '#^Parameter \$phpcsFile of method Forrest79\\PhpCsIgnores\\BaselineReport\:\:generateFileReport\(\) has invalid type PHP_CodeSniffer\\File\.$#'
32-
count: 1
33-
path: src/BaselineReport.php
34-
35-
- # Bad PHPCS annotation
36-
message: "#^Strict comparison using === between bool and 1 will always evaluate to false\\.$#"
37-
count: 1
38-
path: src/OutdatedFiles.php
39-
4030
-
4131
message: "#^Cannot access offset 0 on mixed\\.$#"
4232
count: 1
@@ -177,11 +167,6 @@ parameters:
177167
count: 1
178168
path: src/PhpCsInjections.php
179169

180-
- # Bad PHPCS annotation
181-
message: "#^Property PHP_CodeSniffer\\\\Config::\\$parallel \\(bool\\) does not accept int\\.$#"
182-
count: 1
183-
path: src/bootstrap-outdated.php
184-
185170
-
186171
message: '#^Cannot access offset .+\.$#'
187172
count: 54

src/File.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected function addMessage($error, $message, $line, $column, $code, $data, $s
6666
// This condition is for PHPCBF - when error is ignored and fixable, we want to ignore it immediately.
6767
// For PHPCS we want to process all errors in a classic way - because than we have complete cache a that we want.
6868
if ($this->fixer->enabled) {
69-
// Work out which sniff generated the message. (Copied and simplified from vendor/squizlabs/php_codesniffer/src/Files/File.php:844)
69+
// Work out which sniff generated the message. (Copied and simplified from vendor/phpcsstandards/php_codesniffer/src/Files/File.php:844)
7070
$parts = explode('.', $code);
7171
if ($parts[0] === 'Internal') {
7272
$sniffCode = $code;
@@ -78,7 +78,7 @@ protected function addMessage($error, $message, $line, $column, $code, $data, $s
7878
}
7979
}
8080

81-
// (Copied and simplified from vendor/squizlabs/php_codesniffer/src/Files/File.php:1056)
81+
// (Copied and simplified from vendor/phpcsstandards/php_codesniffer/src/Files/File.php:1056)
8282
if ($data !== []) {
8383
$message = vsprintf($message, $data);
8484
}

0 commit comments

Comments
 (0)