diff --git a/SlevomatCodingStandard/Sniffs/TestCase.php b/SlevomatCodingStandard/Sniffs/TestCase.php index 74d440f94..b418c788b 100644 --- a/SlevomatCodingStandard/Sniffs/TestCase.php +++ b/SlevomatCodingStandard/Sniffs/TestCase.php @@ -21,6 +21,7 @@ use function strlen; use function strpos; use function substr; +use function version_compare; use const PHP_EOL; /** @@ -44,6 +45,16 @@ protected static function checkFile(string $filePath, array $sniffProperties = [ $codeSniffer->init(); if (count($sniffProperties) > 0) { + /** @phpstan-ignore-next-line */ + if (version_compare(Config::VERSION, '3.8.0', '>=')) { + foreach ($sniffProperties as $name => $value) { + $sniffProperties[$name] = [ + 'value' => $value, + 'scope' => 'sniff', + ]; + } + } + $codeSniffer->ruleset->ruleset[self::getSniffName()]['properties'] = $sniffProperties; }