Skip to content

Consider reference symbol in docblock for param type declaration rector#1735

Merged
TomasVotruba merged 1 commit intorectorphp:masterfrom
tigitz:feat-consider-ref-symbol-docblock
Jul 15, 2019
Merged

Consider reference symbol in docblock for param type declaration rector#1735
TomasVotruba merged 1 commit intorectorphp:masterfrom
tigitz:feat-consider-ref-symbol-docblock

Conversation

@tigitz
Copy link
Copy Markdown

@tigitz tigitz commented Jul 13, 2019

Linked to #1734

The idea here would be to ignore the & during parsing. Unfortunately in this case, rector depends on phpstan doc parser which maintainers decided not to support this type of documenting: phpstan/phpstan#699

I've dug a little and found that adding this line:

$tokens->tryConsumeTokenType(Lexer::TOKEN_REFERENCE);

After this line:
https://github.com/phpstan/phpdoc-parser/blob/master/src/Parser/PhpDocParser.php#L166

Would effectively ignore it and make the test green.

I'm wondering if there could be any workaround that can be put in rector code directly.

@TomasVotruba
Copy link
Copy Markdown
Member

I'll look at it, thanks for failing test and propsed solution 👍

@TomasVotruba TomasVotruba merged commit ddb54b2 into rectorphp:master Jul 15, 2019
@TomasVotruba TomasVotruba self-assigned this Jul 15, 2019
TomasVotruba added a commit that referenced this pull request Jan 27, 2022
rectorphp/rector-src@c6142e1 [Php56][Php70] Handle ExceptionHandlerTypehintRector+CatchExceptionNameMatchingTypeRector+AddDefaultValueForUndefinedVariableRector (#1735)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants