Skip to content

Commit 9e8adfd

Browse files
committed
Ruleset: use MsgCollector for "no sniffs registered" error
1 parent 754685c commit 9e8adfd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Ruleset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public function __construct(Config $config)
255255
}
256256

257257
if ($numSniffs === 0) {
258-
throw new RuntimeException('ERROR: No sniffs were registered');
258+
$this->msgCache->add('No sniffs were registered.', MsgCollector::ERROR);
259259
}
260260

261261
$this->displayCachedMessages();

tests/Core/Ruleset/ConstructorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public function testNoSniffsRegisteredException()
282282
$standard = __DIR__.'/ConstructorNoSniffsTest.xml';
283283
$config = new ConfigDouble(["--standard=$standard"]);
284284

285-
$message = 'ERROR: No sniffs were registered';
285+
$message = 'ERROR: No sniffs were registered.'.PHP_EOL.PHP_EOL;
286286
$this->expectRuntimeExceptionMessage($message);
287287

288288
new Ruleset($config);

0 commit comments

Comments
 (0)