Skip to content

Commit 7e59347

Browse files
committed
fix CR issues
1 parent f7835a8 commit 7e59347

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Rules/Functions/PrintfParameterTypeRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function processNode(Node $node, Scope $scope): array
140140
'Parameter #%d of function %s is expected to be %s by placeholder #%d (%s), %s given.',
141141
$i + 1,
142142
$name,
143-
$allowedTypeNameMap[$placeholder->acceptedType],
143+
$allowedTypeNameMap[$placeholder->acceptingType],
144144
$placeholder->placeholderNumber,
145145
$placeholder->label,
146146
$argType->describe(VerbosityLevel::typeOnly()),

src/Rules/Functions/PrintfPlaceholder.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
final class PrintfPlaceholder
1010
{
1111

12-
/** @phpstan-param 'strict-int'|'int'|'float'|'string'|'mixed' $acceptedType */
12+
/** @phpstan-param 'strict-int'|'int'|'float'|'string'|'mixed' $acceptingType */
1313
public function __construct(
1414
public readonly string $label,
1515
public readonly int $parameterIndex,
1616
public readonly int $placeholderNumber,
17-
public readonly string $acceptedType,
17+
public readonly string $acceptingType,
1818
)
1919
{
2020
}
2121

2222
public function doesArgumentTypeMatchPlaceholder(Type $argumentType): bool
2323
{
24-
switch ($this->acceptedType) {
24+
switch ($this->acceptingType) {
2525
case 'strict-int':
2626
return (new IntegerType())->accepts($argumentType, true)->yes();
2727
case 'int':
@@ -32,7 +32,6 @@ public function doesArgumentTypeMatchPlaceholder(Type $argumentType): bool
3232
// no point in checking string again here.
3333
case 'string':
3434
case 'mixed':
35-
default:
3635
return true;
3736
}
3837
}

0 commit comments

Comments
 (0)