Skip to content

Commit f20435d

Browse files
committed
Ruleset: update wiring in after class rename
1 parent b61d7c6 commit f20435d

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

src/Ruleset.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use PHP_CodeSniffer\Exceptions\RuntimeException;
1515
use PHP_CodeSniffer\Sniffs\DeprecatedSniff;
1616
use PHP_CodeSniffer\Util\Common;
17-
use PHP_CodeSniffer\Util\MsgCollector;
17+
use PHP_CodeSniffer\Util\MessageCollector;
1818
use PHP_CodeSniffer\Util\Standards;
1919
use RecursiveDirectoryIterator;
2020
use RecursiveIteratorIterator;
@@ -142,7 +142,7 @@ class Ruleset
142142
* - Errors which are directly aimed at and only intended for sniff developers or integrators
143143
* (in contrast to ruleset maintainers or end-users).
144144
*
145-
* @var \PHP_CodeSniffer\Util\MsgCollector
145+
* @var \PHP_CodeSniffer\Util\MessageCollector
146146
*/
147147
private $msgCache;
148148

@@ -161,7 +161,7 @@ public function __construct(Config $config)
161161
$restrictions = $config->sniffs;
162162
$exclusions = $config->exclude;
163163
$sniffs = [];
164-
$this->msgCache = new MsgCollector();
164+
$this->msgCache = new MessageCollector();
165165

166166
$standardPaths = [];
167167
foreach ($config->standards as $standard) {

tests/Core/Ruleset/DisplayCachedMessagesTest.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use PHP_CodeSniffer\Ruleset;
1313
use PHP_CodeSniffer\Tests\ConfigDouble;
1414
use PHP_CodeSniffer\Tests\Core\Ruleset\AbstractRulesetTestCase;
15-
use PHP_CodeSniffer\Util\MsgCollector;
15+
use PHP_CodeSniffer\Util\MessageCollector;
1616
use ReflectionMethod;
1717
use ReflectionProperty;
1818

@@ -77,14 +77,14 @@ public static function dataBlockingErrorsAreDisplayedViaAnException()
7777
{
7878
return [
7979
'One error' => [
80-
'messages' => ['This is a serious blocking issue' => MsgCollector::ERROR],
80+
'messages' => ['This is a serious blocking issue' => MessageCollector::ERROR],
8181
'expected' => 'ERROR: This is a serious blocking issue'.PHP_EOL.PHP_EOL,
8282
],
8383
'Multiple blocking errors' => [
8484
'messages' => [
85-
'This is a serious blocking issue' => MsgCollector::ERROR,
86-
'And here is another one' => MsgCollector::ERROR,
87-
'OMG, why do you think that would work ?' => MsgCollector::ERROR,
85+
'This is a serious blocking issue' => MessageCollector::ERROR,
86+
'And here is another one' => MessageCollector::ERROR,
87+
'OMG, why do you think that would work ?' => MessageCollector::ERROR,
8888
],
8989
// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- Test readability is more important.
9090
'expected' => 'ERROR: This is a serious blocking issue'.PHP_EOL
@@ -94,9 +94,9 @@ public static function dataBlockingErrorsAreDisplayedViaAnException()
9494
],
9595
'Mix of blocking and non-blocking errors' => [
9696
'messages' => [
97-
'This is a serious blocking issue' => MsgCollector::ERROR,
98-
'Something something deprecated and will be removed in v x.x.x' => MsgCollector::DEPRECATED,
99-
'Careful, this may not be correct' => MsgCollector::NOTICE,
97+
'This is a serious blocking issue' => MessageCollector::ERROR,
98+
'Something something deprecated and will be removed in v x.x.x' => MessageCollector::DEPRECATED,
99+
'Careful, this may not be correct' => MessageCollector::NOTICE,
100100
],
101101
// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- Test readability is more important.
102102
'expected' => 'ERROR: This is a serious blocking issue'.PHP_EOL
@@ -142,23 +142,23 @@ public static function dataNonBlockingErrorsGenerateOutput()
142142
{
143143
return [
144144
'One deprecation' => [
145-
'messages' => ['My deprecation message' => MsgCollector::DEPRECATED],
145+
'messages' => ['My deprecation message' => MessageCollector::DEPRECATED],
146146
'expected' => 'DEPRECATED: My deprecation message'.PHP_EOL.PHP_EOL,
147147
],
148148
'One notice' => [
149-
'messages' => ['My notice message' => MsgCollector::NOTICE],
149+
'messages' => ['My notice message' => MessageCollector::NOTICE],
150150
'expected' => 'NOTICE: My notice message'.PHP_EOL.PHP_EOL,
151151
],
152152
'One warning' => [
153-
'messages' => ['My warning message' => MsgCollector::WARNING],
153+
'messages' => ['My warning message' => MessageCollector::WARNING],
154154
'expected' => 'WARNING: My warning message'.PHP_EOL.PHP_EOL,
155155
],
156156
'Multiple non-blocking errors' => [
157157
'messages' => [
158-
'Something something deprecated and will be removed in v x.x.x' => MsgCollector::DEPRECATED,
159-
'Something is not supported and support may be removed' => MsgCollector::WARNING,
160-
'Some other deprecation notice' => MsgCollector::DEPRECATED,
161-
'Careful, this may not be correct' => MsgCollector::NOTICE,
158+
'Something something deprecated and will be removed in v x.x.x' => MessageCollector::DEPRECATED,
159+
'Something is not supported and support may be removed' => MessageCollector::WARNING,
160+
'Some other deprecation notice' => MessageCollector::DEPRECATED,
161+
'Careful, this may not be correct' => MessageCollector::NOTICE,
162162
],
163163
// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- Test readability is more important.
164164
'expected' => 'WARNING: Something is not supported and support may be removed'.PHP_EOL
@@ -187,7 +187,7 @@ public function testBlockingErrorsAlwaysShow($configArgs)
187187
$ruleset = new Ruleset($config);
188188

189189
$message = 'Some serious error';
190-
$errors = [$message => MsgCollector::ERROR];
190+
$errors = [$message => MessageCollector::ERROR];
191191
$this->mockCachedMessages($ruleset, $errors);
192192

193193
$this->expectRuntimeExceptionMessage('ERROR: '.$message.PHP_EOL);
@@ -210,7 +210,7 @@ public function testNonBlockingErrorsDoNotShowUnderSpecificCircumstances($config
210210
{
211211
$config = new ConfigDouble($configArgs);
212212
$ruleset = new Ruleset($config);
213-
$this->mockCachedMessages($ruleset, ['Deprecation notice' => MsgCollector::DEPRECATED]);
213+
$this->mockCachedMessages($ruleset, ['Deprecation notice' => MessageCollector::DEPRECATED]);
214214

215215
$this->expectOutputString('');
216216

0 commit comments

Comments
 (0)