Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8c4ef2a

Browse files
arnaud-lbondrejmirtes
authored andcommitted
Add parse error test
1 parent 9b27b84 commit 8c4ef2a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

‎tests/PHPStan/Parser/TypeParserTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,24 @@ public function provideParseData(): array
447447
Lexer::TOKEN_CLOSE_CURLY_BRACKET
448448
),
449449
],
450+
[
451+
'array{"a": int}',
452+
new \PHPStan\PhpDocParser\Parser\ParserException(
453+
'"a"',
454+
Lexer::TOKEN_DOUBLE_QUOTED_STRING,
455+
6,
456+
Lexer::TOKEN_IDENTIFIER
457+
),
458+
],
459+
[
460+
'array{\'a\': int}',
461+
new \PHPStan\PhpDocParser\Parser\ParserException(
462+
'\'a\'',
463+
Lexer::TOKEN_SINGLE_QUOTED_STRING,
464+
6,
465+
Lexer::TOKEN_IDENTIFIER
466+
),
467+
],
450468
[
451469
'callable(): Foo',
452470
new CallableTypeNode(

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /