1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Converted MissingPropertyType to property issue (#4099)

Fixes vimeo/psalm#2200
This commit is contained in:
Bruce Weirdan 2020-09-01 16:21:03 +03:00 committed by GitHub
parent aa09a1c780
commit ffb316a9e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 4 deletions

View File

@ -264,7 +264,7 @@
<xs:element name="MissingFile" type="IssueHandlerType" minOccurs="0" />
<xs:element name="MissingImmutableAnnotation" type="IssueHandlerType" minOccurs="0" />
<xs:element name="MissingParamType" type="IssueHandlerType" minOccurs="0" />
<xs:element name="MissingPropertyType" type="IssueHandlerType" minOccurs="0" />
<xs:element name="MissingPropertyType" type="PropertyIssueHandlerType" minOccurs="0" />
<xs:element name="MissingReturnType" type="IssueHandlerType" minOccurs="0" />
<xs:element name="MissingTemplateParam" type="IssueHandlerType" minOccurs="0" />
<xs:element name="MissingThrowsDocblock" type="IssueHandlerType" minOccurs="0" />

View File

@ -1710,7 +1710,8 @@ class ClassAnalyzer extends ClassLikeAnalyzer
if (IssueBuffer::accepts(
new MissingPropertyType(
$message,
new CodeLocation($source, $stmt->props[0]->name)
new CodeLocation($source, $stmt->props[0]->name),
$property_id
),
$this->source->getSuppressedIssues()
)) {

View File

@ -965,7 +965,8 @@ class InstancePropertyFetchAnalyzer
new MissingPropertyType(
'Property ' . $fq_class_name . '::$' . $prop_name
. ' does not have a declared type',
new CodeLocation($statements_analyzer->getSource(), $stmt)
new CodeLocation($statements_analyzer->getSource(), $stmt),
$property_id
),
$statements_analyzer->getSuppressedIssues()
)) {

View File

@ -1,7 +1,7 @@
<?php
namespace Psalm\Issue;
class MissingPropertyType extends CodeIssue
class MissingPropertyType extends PropertyIssue
{
const ERROR_LEVEL = 2;
const SHORTCODE = 45;