mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Don’t throw exception when property is missing type
This commit is contained in:
parent
e6f3948f7b
commit
0bca8db561
@ -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'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1195,6 +1195,13 @@ class AnnotationTest extends TestCase
|
||||
$a = $_GET["foo"];',
|
||||
'error_message' => 'UndefinedClass',
|
||||
],
|
||||
'badPsalmType' => [
|
||||
'<?php
|
||||
/**
|
||||
* @psalm-type Foo = array{a:}
|
||||
*/',
|
||||
'error_message' => 'InvalidDocblock',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user