Skip to content

Commit

Permalink
fix: use getSniffName() from slevomat's testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod committed Feb 16, 2024
1 parent 7434e73 commit 890ebb6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"require": {
"php": "^8.1",
"doctrine/coding-standard": "^12.0",
"slevomat/coding-standard": "^8.12",
"slevomat/coding-standard": "^8.14",
"squizlabs/php_codesniffer": "^3.8"
},
"require-dev": {
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ parameters:
count: 1
path: tests/TestCase.php

-
message: "#^Method Cdn77\\\\TestCase\\:\\:getSniffName\\(\\) should return string but returns string\\|null\\.$#"
count: 1
path: tests/TestCase.php

-
message: "#^Parameter \\#3 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#"
count: 1
Expand Down
18 changes: 0 additions & 18 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use function define;
use function defined;
use function in_array;
use function preg_replace;
use function sprintf;
use function str_replace;
use function strlen;
Expand Down Expand Up @@ -80,23 +79,6 @@ protected static function checkFile(string $filePath, array $sniffProperties = [
return $file;
}

private static function getSniffName(): string
{
return preg_replace(
[
'~\\\~',
'~\.Sniffs~',
'~Sniff$~',
],
[
'.',
'',
'',
],
static::getSniffClassName(),
);
}

private static function getSniffClassReflection(): ReflectionClass
{
static $reflections = [];
Expand Down

0 comments on commit 890ebb6

Please sign in to comment.