File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -380,10 +380,16 @@ public function isHtml(TokenIterator $tokens): bool
380380return false ;
381381}
382382
383+ $ endTag = '</ ' . $ htmlTagName . '> ' ;
384+ $ endTagSearchOffset = - strlen ($ endTag );
385+
383386while (!$ tokens ->isCurrentTokenType (Lexer::TOKEN_END )) {
384387if (
385- $ tokens ->tryConsumeTokenType (Lexer::TOKEN_OPEN_ANGLE_BRACKET )
386- && strpos ($ tokens ->currentTokenValue (), '/ ' . $ htmlTagName . '> ' ) !== false
388+ (
389+ $ tokens ->tryConsumeTokenType (Lexer::TOKEN_OPEN_ANGLE_BRACKET )
390+ && strpos ($ tokens ->currentTokenValue (), '/ ' . $ htmlTagName . '> ' ) !== false
391+ )
392+ || substr_compare ($ tokens ->currentTokenValue (), $ endTag , $ endTagSearchOffset ) === 0
387393) {
388394return true ;
389395}
Original file line number Diff line number Diff line change @@ -1301,6 +1301,20 @@ public function provideReturnTagsData(): Iterator
13011301]),
13021302];
13031303
1304+ yield [
1305+ 'OK with HTML description ' ,
1306+ '/** @return MongoCollection <p>Returns a collection object representing the new collection.</p> */ ' ,
1307+ new PhpDocNode ([
1308+ new PhpDocTagNode (
1309+ '@return ' ,
1310+ new ReturnTagValueNode (
1311+ new IdentifierTypeNode ('MongoCollection ' ),
1312+ '<p>Returns a collection object representing the new collection.</p> '
1313+ )
1314+ ),
1315+ ]),
1316+ ];
1317+
13041318yield [
13051319'invalid without type and description ' ,
13061320'/** @return */ ' ,
Original file line number Diff line number Diff line change @@ -2166,6 +2166,11 @@ public function provideParseData(): array
21662166false
21672167)),
21682168],
2169+ [
2170+ 'MongoCollection <p>Returns a collection object representing the new collection.</p> ' ,
2171+ new IdentifierTypeNode ('MongoCollection ' ),
2172+ Lexer::TOKEN_OPEN_ANGLE_BRACKET ,
2173+ ],
21692174];
21702175}
21712176
You can’t perform that action at this time.
0 commit comments