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

Don’t suggest useless type information

This commit is contained in:
Matthew Brown 2017-04-15 00:45:43 -04:00
parent a8bee2f843
commit bdfe2396ad

View File

@ -1128,8 +1128,12 @@ abstract class ClassLikeChecker extends SourceChecker implements StatementsSourc
$property_storage = $class_storage->properties[$property_name];
if ($property_storage->suggested_type) {
$message .= ' - consider ' . $property_storage->suggested_type;
if ($property_storage->suggested_type && !$property_storage->suggested_type->isNull()) {
$message .= ' - consider ' . str_replace(
['<mixed, mixed>', '<empty, empty>'],
'',
(string)$property_storage->suggested_type
);
}
if (IssueBuffer::accepts(