Skip to content

Commit 7c86f46

Browse files
authored
fix: use getSniffName() from slevomat's testcase (#137)
1 parent 7434e73 commit 7c86f46

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed

Diff for: composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"require": {
1717
"php": "^8.1",
1818
"doctrine/coding-standard": "^12.0",
19-
"slevomat/coding-standard": "^8.12",
19+
"slevomat/coding-standard": "^8.14",
2020
"squizlabs/php_codesniffer": "^3.8"
2121
},
2222
"require-dev": {

Diff for: phpstan-baseline.neon

-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ parameters:
2020
count: 1
2121
path: tests/TestCase.php
2222

23-
-
24-
message: "#^Method Cdn77\\\\TestCase\\:\\:getSniffName\\(\\) should return string but returns string\\|null\\.$#"
25-
count: 1
26-
path: tests/TestCase.php
27-
2823
-
2924
message: "#^Parameter \\#3 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#"
3025
count: 1

Diff for: tests/TestCase.php

-18
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use function define;
2020
use function defined;
2121
use function in_array;
22-
use function preg_replace;
2322
use function sprintf;
2423
use function str_replace;
2524
use function strlen;
@@ -80,23 +79,6 @@ protected static function checkFile(string $filePath, array $sniffProperties = [
8079
return $file;
8180
}
8281

83-
private static function getSniffName(): string
84-
{
85-
return preg_replace(
86-
[
87-
'~\\\~',
88-
'~\.Sniffs~',
89-
'~Sniff$~',
90-
],
91-
[
92-
'.',
93-
'',
94-
'',
95-
],
96-
static::getSniffClassName(),
97-
);
98-
}
99-
10082
private static function getSniffClassReflection(): ReflectionClass
10183
{
10284
static $reflections = [];

0 commit comments

Comments
 (0)