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

Don’t throw exception when property is missing type

This commit is contained in:
Matthew Brown 2019-02-07 18:10:32 -05:00
parent e6f3948f7b
commit 0bca8db561
2 changed files with 9 additions and 2 deletions

View File

@ -354,8 +354,8 @@ abstract class Type
$property_maybe_undefined = $property_branch->possibly_undefined;
$property_key = $property_branch->value;
} else {
throw new \InvalidArgumentException(
'Unexpected number of property parts (' . count($property_branch->children) . ')'
throw new TypeParseTreeException(
'Missing property type'
);
}

View File

@ -1195,6 +1195,13 @@ class AnnotationTest extends TestCase
$a = $_GET["foo"];',
'error_message' => 'UndefinedClass',
],
'badPsalmType' => [
'<?php
/**
* @psalm-type Foo = array{a:}
*/',
'error_message' => 'InvalidDocblock',
],
];
}
}