We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a7f3e1 commit 621abb8Copy full SHA for 621abb8
src/Rules/PHPUnit/AssertEqualsIsDiscouragedRule.php
@@ -55,17 +55,13 @@ public function processNode(Node $node, Scope $scope): array
55
&& ($leftType->isSuperTypeOf($rightType)->yes())
56
&& ($rightType->isSuperTypeOf($leftType)->yes())
57
) {
58
- if (strtolower($node->name->name) === 'assertnotequals') {
59
- return [
60
- RuleErrorBuilder::message(
61
- 'You should use assertNotSame() instead of assertNotEquals(), because both values are scalars of the same type',
62
- )->identifier('phpunit.assertEquals')->build(),
63
- ];
64
- }
65
-
66
return [
67
RuleErrorBuilder::message(
68
- 'You should use assertSame() instead of assertEquals(), because both values are scalars of the same type',
+ sprintf(
+ 'You should use %s() instead of %s(), because both values are scalars of the same type',
+ strtolower($node->name->name) === 'assertnotequals' ? 'assertNotSame' : 'assertSame',
+ $node->name->name,
+ ),
69
)->identifier('phpunit.assertEquals')->build(),
70
];
71
}
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments