Skip to content

Commit 732c81f

Browse files
committed
Use display names for errors
1 parent a323b04 commit 732c81f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Rules/Methods/MissingMethodParameterTypehintRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private function checkMethodParameter(MethodReflection $methodReflection, Parame
5454
if ($parameterType instanceof MixedType && !$parameterType->isExplicitMixed()) {
5555
return sprintf(
5656
'Method %s::%s() has parameter $%s with no typehint specified',
57-
$methodReflection->getDeclaringClass()->getName(),
57+
$methodReflection->getDeclaringClass()->getDisplayName(),
5858
$methodReflection->getName(),
5959
$parameterReflection->getName()
6060
);

src/Rules/Methods/MissingMethodReturnTypehintRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private function checkMethodReturnType(MethodReflection $methodReflection): ?str
4949
if ($returnType instanceof MixedType && !$returnType->isExplicitMixed()) {
5050
return sprintf(
5151
'Method %s::%s() has no return typehint specified',
52-
$methodReflection->getDeclaringClass()->getName(),
52+
$methodReflection->getDeclaringClass()->getDisplayName(),
5353
$methodReflection->getName()
5454
);
5555
}

src/Rules/Properties/MissingPropertyTypehintRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array
3535
return [
3636
sprintf(
3737
'Property %s::$%s has no typehint specified',
38-
$propertyReflection->getDeclaringClass()->getName(),
38+
$propertyReflection->getDeclaringClass()->getDisplayName(),
3939
$node->name
4040
),
4141
];

0 commit comments

Comments
 (0)