Add support for generating enum pages for the manual#21469
Add support for generating enum pages for the manual#21469kocsismate wants to merge 1 commit intophp:PHP-8.5from
Conversation
|
I'm not sure I'm qualified to review the doc-generation parts of the gen_stub script, deferring to @Girgias for that |
No, I intentionally targeted 8.5 because that's the version which is being synchronized with the manual. |
| class EnumCaseName { | ||
| public /* readonly */ Name $enum; | ||
| public /* readonly */ string $case; | ||
|
|
||
| public function __construct(Name $enum, string $case) | ||
| { | ||
| $this->enum = $enum; | ||
| $this->case = $case; | ||
| } | ||
| } |
There was a problem hiding this comment.
Why do you need this? I don't understand why the enum case needs to know about the name of the enum it's part of?
There was a problem hiding this comment.
All VariableLike classes do the same (check ClassConstName and PropertyName) because the class/enum name is needed in multiple places:
ClassConstNameandPropertyNamehave a__toString()method where the classname is needed- The class/enum name is needed for all these classes to be able to generate the
linkendattribute (check theClassConstName::getFieldSynopsisDefaultLinkend()and theEnumCaseName::getEnumSynopsisLinkend()methods)
That said, the enum name could be stored in the EnumCaseInfo directly instead of EnumCaseName, but I figured it's a good idea to follow the other name classes.
I intentionally omit the usage of the
enumitemdescriptionelement, and I generate links instead based on php/phd#180 (comment).