Skip to content

Commit

Permalink
Converted MissingPropertyType to property issue (vimeo#4099)
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan authored and danog committed Jan 29, 2021
1 parent 529a19d commit ee029a6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,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" />
Expand Down
3 changes: 2 additions & 1 deletion src/Psalm/Internal/Analyzer/ClassAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,8 @@ private function checkForMissingPropertyType(
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()
)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,8 @@ public static function analyze(
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()
)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Issue/MissingPropertyType.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Psalm\Issue;

class MissingPropertyType extends CodeIssue
class MissingPropertyType extends PropertyIssue
{
const ERROR_LEVEL = 2;
const SHORTCODE = 45;
Expand Down

0 comments on commit ee029a6

Please sign in to comment.