- Issue created by @quietone
- πͺπΈSpain fjgarlin
We'd need to investigate first what the PHP parsing library (https://github.com/nikic/PHP-Parser) returns, and then work on a solution based on that.
- π³π±Netherlands bbrala Netherlands
Commenting because this might be kinda annoying if we want to get stuff into core.
Wonder how this should actually look in that page. The parsing is probably not that hard. But we might need: https://github.com/phpstan/phpdoc-parser which adds support for a lot of extra types? (see https://github.com/phpstan/phpdoc-parser/blob/fcaefacf2d5c417e928405b71b...)
- π³π±Netherlands bbrala Netherlands
Most important though, how does the doc page need to look. Not sure about that. But if we have a direction on that adding is should be easy.
- πͺπΈSpain fjgarlin
Thanks for that link. It's really useful.
Other tags worth nothing (from π When parsing @coverDefaultClass, a link to the documentation class is provided, but the link is rendered as plain text Fixed ): @coversDefaultClass @group @internal
- πͺπΈSpain fjgarlin
This might be fixed by π Bugs with phpdoc data type display, especially for array types and shapes Active
- π¨π¦Canada Charlie ChX Negyesi πCanada
Nope, this will be a relatively easy and straightforward follow up to that, the phpstan/phpdoc-parser library we landed on does not support any tags except the phpstan ones which are very type oriented. I am adding support for the existing ones and it's one class with 1-2 lines of logic, usually one constructor line to define the properties and then a __toString to add HTML wrapper. Plus 3-4 lines of parsing logic but it's really formulaic, here's @section:
<?
protected function parseSectionTagValue(TokenIterator $tokens): SectionTagValueNode {
$sectionName = $tokens->currentTokenValue();
$tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER);
$description = $this->parseText($tokens, TRUE);
return new SectionTagValueNode($sectionName, $description);
}class SectionTagValueNode implements PhpDocTagValueNode {
use NodeAttributes;
public function __construct(protected string $sectionName, public string $description) {
}
public function __toString(): string {
return sprintf('
%s
', trim($this->sectionName), trim($this->description));
}
}?>
so this needs to be done for every tag.