1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Add more specific __toString error issue

This commit is contained in:
Matthew Brown 2017-02-12 13:26:24 -05:00
parent a31ef0ae5f
commit 3f0a87f6fe

View File

@ -997,7 +997,7 @@ abstract class FunctionLikeChecker extends SourceChecker implements StatementsSo
if (!$inferred_return_type->isMixed() && (string)$inferred_return_type !== 'string') {
if (IssueBuffer::accepts(
new InvalidToString(
'__toString methods must return a string',
'__toString methods must return a string, ' . $inferred_return_type . ' returned',
$secondary_return_type_location ?: $return_type_location
)
)) {