Skip to content

Commit

Permalink
MethodSignatureRule - more verbose type description
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed May 3, 2020
1 parent db656b0 commit 56eadce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Rules/Methods/MethodSignatureRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public function processNode(Node $node, Scope $scope): array
if ($returnTypeCompatibility->no() || (!$returnTypeCompatibility->yes() && $this->reportMaybes)) {
$errors[] = RuleErrorBuilder::message(sprintf(
'Return type (%s) of method %s::%s() should be %s with return type (%s) of method %s::%s()',
$parameters->getReturnType()->describe(VerbosityLevel::typeOnly()),
$parameters->getReturnType()->describe(VerbosityLevel::value()),
$method->getDeclaringClass()->getDisplayName(),
$method->getName(),
$returnTypeCompatibility->no() ? 'compatible' : 'covariant',
$parentParameters->getReturnType()->describe(VerbosityLevel::typeOnly()),
$parentParameters->getReturnType()->describe(VerbosityLevel::value()),
$parentMethod->getDeclaringClass()->getDisplayName(),
$parentMethod->getName()
))->build();
Expand All @@ -96,12 +96,12 @@ public function processNode(Node $node, Scope $scope): array
'Parameter #%d $%s (%s) of method %s::%s() should be %s with parameter $%s (%s) of method %s::%s()',
$parameterIndex + 1,
$parameter->getName(),
$parameter->getType()->describe(VerbosityLevel::typeOnly()),
$parameter->getType()->describe(VerbosityLevel::value()),
$method->getDeclaringClass()->getDisplayName(),
$method->getName(),
$parameterResult->no() ? 'compatible' : 'contravariant',
$parentParameter->getName(),
$parentParameter->getType()->describe(VerbosityLevel::typeOnly()),
$parentParameter->getType()->describe(VerbosityLevel::value()),
$parentMethod->getDeclaringClass()->getDisplayName(),
$parentMethod->getName()
))->build();
Expand Down

0 comments on commit 56eadce

Please sign in to comment.