-
Notifications
You must be signed in to change notification settings - Fork 65
Require whitespace before description with limited start tokens #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1310,6 +1310,58 @@ public function provideReturnTagsData(): Iterator | |
), | ||
]), | ||
]; | ||
|
||
yield [ | ||
'OK variadic callable', | ||
'/** @return \Closure(int ...$u, string): string */', | ||
new PhpDocNode([ | ||
new PhpDocTagNode( | ||
'@return', | ||
new ReturnTagValueNode( | ||
new CallableTypeNode( | ||
new IdentifierTypeNode('\Closure'), | ||
[ | ||
new CallableTypeParameterNode( | ||
new IdentifierTypeNode('int'), | ||
false, | ||
true, | ||
'$u', | ||
false | ||
), | ||
new CallableTypeParameterNode( | ||
new IdentifierTypeNode('string'), | ||
false, | ||
false, | ||
'', | ||
false | ||
), | ||
], | ||
new IdentifierTypeNode('string') | ||
), | ||
'' | ||
) | ||
), | ||
]), | ||
]; | ||
|
||
yield [ | ||
'invalid variadic callable', | ||
'/** @return \Closure(...int, string): string */', | ||
new PhpDocNode([ | ||
new PhpDocTagNode( | ||
'@return', | ||
new InvalidTagValueNode( | ||
'\Closure(...int, string): string', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thank you for throwing at least as all other types in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is already supported, but the type always has to come first. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't know, thank you ❤️ |
||
new ParserException( | ||
'(', | ||
Lexer::TOKEN_OPEN_PARENTHESES, | ||
20, | ||
Lexer::TOKEN_HORIZONTAL_WS | ||
) | ||
) | ||
), | ||
]), | ||
]; | ||
} | ||
|
||
|
||
|
@@ -2104,10 +2156,14 @@ public function provideSingleLinePhpDocData(): Iterator | |
new PhpDocNode([ | ||
new PhpDocTagNode( | ||
'@var', | ||
new VarTagValueNode( | ||
new IdentifierTypeNode('callable'), | ||
'', | ||
'(int)' | ||
new InvalidTagValueNode( | ||
'callable(int)', | ||
new ParserException( | ||
'(', | ||
Lexer::TOKEN_OPEN_PARENTHESES, | ||
17, | ||
Lexer::TOKEN_HORIZONTAL_WS | ||
) | ||
) | ||
), | ||
]), | ||
|
@@ -4076,14 +4132,14 @@ public function provideDescriptionWithOrWithoutHtml(): Iterator | |
new PhpDocNode([ | ||
new PhpDocTagNode( | ||
'@return', | ||
new ReturnTagValueNode( | ||
new GenericTypeNode( | ||
new IdentifierTypeNode('Foo'), | ||
[ | ||
new IdentifierTypeNode('strong'), | ||
] | ||
), | ||
'Important description' | ||
new InvalidTagValueNode( | ||
'Foo <strong>Important description', | ||
new ParserException( | ||
'Important', | ||
Lexer::TOKEN_IDENTIFIER, | ||
27, | ||
Lexer::TOKEN_HORIZONTAL_WS | ||
) | ||
) | ||
), | ||
]), | ||
|