Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
This gonna to fix 1 wrong doctrine/lexer usage.
The wrong usage was located in the TypeLexer
You must not use
group capture
(parenthesis) because this regex was use in preg_split functionFor example with
array<key=int, value=string>
if you use
([a-z0-9\\\\]+)
you get 15 tokens in the lexerand if you use
[a-z0-9\\\\]+
you get 10 tokens in the lexerso i fix the TypeParser::walk() function in order to drop the foreach (currently was a workaround to skip the token doublon capture by the regex parenthesis)
I'm not happy to set a lot of
->walk()
call everywhere in theTypeParser
but they are needed.This PR is related to doctrine/lexer#12 (comment)
I've also tested with https://github.com/doctrine/lexer/pull/12/files#diff-3945e835e8d3a0ad8409023030a9db04R262