Add support for generating the namespace for the manual#21313
Add support for generating the namespace for the manual#21313kocsismate wants to merge 2 commits intophp:PHP-8.5from
Conversation
Girgias
left a comment
There was a problem hiding this comment.
Reviewing gen_stub code is always difficult due to the lack of tests :/
DanielEScherzer
left a comment
There was a problem hiding this comment.
agree that reviewing is hard, especially for patches that change the documentation generation rather than stubs - noticed one thing that might make it easier to review, but I don't think I'm qualified to actually approve this
|
|
||
| /** @param array<string, ConstInfo> $allConstInfos */ | ||
| public function getFieldSynopsisElement(DOMDocument $doc, array $allConstInfos): DOMElement | ||
| public function getFieldSynopsisElement(DOMDocument $doc, array $allConstInfos, int $indentationLevel): DOMElement |
There was a problem hiding this comment.
can we do the indentation changes on a separate commit, even if it is in the same PR? I assume that the initial indentation changes were meant to be no-ops, and just make things useful for indenting in a namespace later, but I can't really tell
There was a problem hiding this comment.
If you have a look at the example generated code (https://github.com/php/doc-en/pull/5394/changes?diff=split#diff-49432cb2fae40acb9f018102542d2dd4acff194aebceec061c804fbfb8997ce9R21), you'll see why I had to change indentation all over the place: the classsynopsis element went one level inner, because it got wrapped into a packagesynopsis element.
That's why I cannot move those changed to their own commit.
| } | ||
|
|
||
| $nameElement = $doc->createElement("{$type}name", $classInfo->name->toString()); | ||
| $nameElement = $doc->createElement("{$type}name", $isMainClass ? $classInfo->getClassName() : $classInfo->name->toString()); |
There was a problem hiding this comment.
probably "main class" is not the right word, but it's the class for which the class synopsis is generated: in which case, only the class name itself has to be added to the ooclass element, since the namespace shouldn't be present there anymore.
Based on php/phd#194