Skip to content

Commit 3223368

Browse files
committed
DoctrineKeyValueStyleRule: improve table error message
Table names must be constant strings, not literal strings. As per staabm#560 (comment).
1 parent 0e25f97 commit 3223368

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Rules/DoctrineKeyValueStyleRule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function processNode(Node $callLike, Scope $scope): array
111111
$tableType = $scope->getType($tableExpr);
112112
if (! $tableType instanceof ConstantStringType) {
113113
return [
114-
RuleErrorBuilder::message('Argument #0 expects a literal string, got ' . $tableType->describe(VerbosityLevel::precise()))->line($callLike->getLine())->build(),
114+
RuleErrorBuilder::message('Argument #0 expects a constant string, got ' . $tableType->describe(VerbosityLevel::precise()))->line($callLike->getLine())->build(),
115115
];
116116
}
117117

tests/rules/DoctrineKeyValueStyleRuleTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testSyntaxErrorInMethod(): void
2929
{
3030
$expectedErrors = [
3131
[
32-
'Argument #0 expects a literal string, got string',
32+
'Argument #0 expects a constant string, got string',
3333
11,
3434
],
3535
[

0 commit comments

Comments
 (0)