GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||
GeezerVison is showing github.com — TypeParser: read the "|" that follows a "?" by valzargaming · Pull Request #321 · phpstan/phpdoc-parser ConversationThe problemA $typeParser->parse(new TokenIterator($lexer->tokenize('?int|null'))); // ?int, with "|null" left over So every tag written that way is turned into an error: It is not specific to Why the
|
|
its a parse-error: https://3v4l.org/kNPeM#v allowing such type in phpdoc while its invalid in native types would be very confusing |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
you should fix your phpdoc to read it might make sense to open a issue on intelliphense about the bug in phpdoc parsing. I think it works correct at the PHPStan end |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I don't think it's a bug either as Intellephense correctly drops the ? without throwing an error whereas phpstan actually throws an error. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
yes, intelliphense should also throw an error. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
For anyone who comes across this PR in the future I patched this with https://github.com/discord-php/phpdoc-tool I understand it diverts from the RFC, however our library needs to be as faithful to Discord's official documentation as other languages follow this schema, and their docs utilize the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.