Skip to content

Commit 945c5d0

Browse files
Gido2935kukulich
authored andcommitted
Changed access modifier for the method getSniffClassName from private to protected to make overriding this method possible
1 parent 252d2f2 commit 945c5d0

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

SlevomatCodingStandard/Sniffs/TestCase.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,17 @@ protected static function assertAllFixedInFile(File $phpcsFile): void
123123
self::assertStringEqualsFile(preg_replace('~(\\.php)$~', '.fixed\\1', $phpcsFile->getFilename()), $phpcsFile->fixer->getContents());
124124
}
125125

126+
/**
127+
* @return class-string
128+
*/
129+
protected static function getSniffClassName(): string
130+
{
131+
/** @var class-string $sniffClassName */
132+
$sniffClassName = substr(static::class, 0, -strlen('Test'));
133+
134+
return $sniffClassName;
135+
}
136+
126137
private static function getSniffName(): string
127138
{
128139
return preg_replace(
@@ -140,17 +151,6 @@ private static function getSniffName(): string
140151
);
141152
}
142153

143-
/**
144-
* @return class-string
145-
*/
146-
private static function getSniffClassName(): string
147-
{
148-
/** @var class-string $sniffClassName */
149-
$sniffClassName = substr(static::class, 0, -strlen('Test'));
150-
151-
return $sniffClassName;
152-
}
153-
154154
private static function getSniffClassReflection(): ReflectionClass
155155
{
156156
static $reflections = [];

0 commit comments

Comments
 (0)