1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Fix #976 - make sure misplaced { doesn’t halt execution

This commit is contained in:
Matthew Brown 2018-09-06 00:41:07 -04:00
parent 3e920b1227
commit 44c742c849
2 changed files with 11 additions and 1 deletions

View File

@ -314,7 +314,7 @@ abstract class Type
}
if ($type !== 'array') {
throw new \InvalidArgumentException('Object-like type must be array');
throw new TypeParseTreeException('Unexpected brace character');
}
if (!$properties) {

View File

@ -509,6 +509,16 @@ class TypeParseTest extends TestCase
Type::parseString('max(a):void');
}
/**
* @expectedException \Psalm\Exception\TypeParseTreeException
*
* @return void
*/
public function testGeneratorWithWBadBrackets()
{
Type::parseString('Generator{string, A}');
}
/**
* @expectedException \Psalm\Exception\TypeParseTreeException
*