Closed sbuerk closed 2 years ago
You can use git rebase -i HEAD^^ --exec vendor/bin/phpcbf
to fix the coding standard issues.
While reading your PR, I noticed there are a lot of repetition of the array shape describing a token. I attempted to extract it into a Psalm type in https://github.com/doctrine/lexer/pull/64, and was forced by static analysis to apply the main change you did to this PR, as well as some others. Please review it.
If this got accepted and merged, it would be nice to have a patchlevel release in the nearer time.
I'll do a release as soon as we merge either your PR or mine.
Please address the conflicts, and use a Psalm type.
[TASK] Use proper docblock type for
AbstractLexer::isNextTokenAny()
This patch changes the docblock type hint of
AbstractLexer::isNextTokenAny()
tolist<int|string>
to adopt the int and string based support of token types. Thus making phpstan in projects happy which uses this packages for there own lexer implementations.However this only aligns to other token methods which already supports int and string as token types, thus fixing a wrong set type hint through #48.
Additionally a concrete lexer implementation was added to test a lexer implemention with integer based tokens, adopted from the already string based implementation.
If this got accepted and merged, it would be nice to have a patchlevel release in the nearer time.
Fixes: #62