-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8.3: Document Random\IntervalBoundary #3419
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<reference xmlns="http://docbook.org/ns/docbook" xml:id="enum.random.intervalboundary" role="enum"> | ||
<title>The Random\IntervalBoundary Enum</title> | ||
<titleabbrev>Random\IntervalBoundary</titleabbrev> | ||
|
||
<partintro> | ||
<section xml:id="enum.random.intervalboundary.intro"> | ||
&reftitle.intro; | ||
<simpara> | ||
The <enumname>Random\IntervalBoundary</enumname> enum specifies | ||
whether an interval includes the boundary values within the set of values | ||
lying in the interval. | ||
</simpara> | ||
</section> | ||
|
||
<section xml:id="enum.random.intervalboundary.synopsis"> | ||
&reftitle.enumsynopsis; | ||
|
||
<enumsynopsis> | ||
<enumname>Random\IntervalBoundary</enumname> | ||
|
||
<enumitem> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other types of symbols have a dedicated section title for classes and interfaces. Would it be a good idea to add them for enums as well? |
||
<enumidentifier>ClosedOpen</enumidentifier> | ||
<enumitemdescription> | ||
A left-open interval. | ||
The lower boundary is included in the interval, | ||
the upper boundary is not. | ||
</enumitemdescription> | ||
</enumitem> | ||
|
||
<enumitem> | ||
<enumidentifier>ClosedClosed</enumidentifier> | ||
<enumitemdescription> | ||
A closed interval. | ||
Both boundary values are included in the interval. | ||
</enumitemdescription> | ||
</enumitem> | ||
|
||
<enumitem> | ||
<enumidentifier>OpenClosed</enumidentifier> | ||
<enumitemdescription> | ||
A right-open interval. | ||
The upper boundary is included in the interval, | ||
the lower boundary is not. | ||
</enumitemdescription> | ||
</enumitem> | ||
|
||
<enumitem> | ||
<enumidentifier>OpenOpen</enumidentifier> | ||
<enumitemdescription> | ||
An open interval. | ||
Neither boundary value is included in the interval. | ||
</enumitemdescription> | ||
</enumitem> | ||
|
||
</enumsynopsis> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, so far There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The DocBook 5.2 markup describes the markup in that manner: https://tdg.docbook.org/tdg/5.2/enumsynopsis (via the For reference, the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a pity, because this way automatic replacement is going to be much more difficult, since there are free form values in the generated enumsynopsis item, and we should somehow try to preserve them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether that's difficult? One just needs to ignore the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. classsynopsis elements are generated based on the current stub definitions for each class/interface/enum signature which are encountered on class synopses pages (https://github.com/php/php-src/blob/0ad2e4d997549c85aac61120a94ea3da0b709339/build/gen_stub.php#L5560) and then the respective elements are replaced altogether one by one (the This means that if there is anything inside classsynopsis elements which are not generatable based on the definitions in stubs, then those things will be removed. A workaround for enums could be that the enum case descriptions are retrieved from the manual pages and they are inserted into the generated elements... This complicates the process, but maybe it's not that difficult if this is going to be the preferred approach. Also, It has just came to my mind that these descriptions would result in enum definitions which are completely not valid PHP code 🤔 while for the rest of the symbols, we generate at least a remotely valid PHP code since a few years. |
||
</section> | ||
</partintro> | ||
</reference> | ||
<!-- Keep this comment at the end of the file | ||
Local variables: | ||
mode: sgml | ||
sgml-omittag:t | ||
sgml-shorttag:t | ||
sgml-minimize-attributes:nil | ||
sgml-always-quote-attributes:t | ||
sgml-indent-step:1 | ||
sgml-indent-data:t | ||
indent-tabs-mode:nil | ||
sgml-parent-document:nil | ||
sgml-default-dtd-file:"~/.phpdoc/manual.ced" | ||
sgml-exposed-tags:nil | ||
sgml-local-catalogs:nil | ||
sgml-local-ecat-files:nil | ||
End: | ||
vim600: syn=xml fen fdm=syntax fdl=2 si | ||
vim: et tw=78 syn=sgml | ||
vi: ts=1 sw=1 | ||
--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a FYI: we should also think about the markup for implemented interfaces, enum constants, methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right... I forgot that PHP enums can do this sort of stuff...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, and I've just realized that e.g.
fieldsynopsis
elements insideenumsynopsis
are not even allowed in DocBook. :/ (Or are they?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, they are not, because DocBook (rightfully) assumes that enums are just that, and not our weird thing based on objects.
I think we might need to use the
<classsynopsis>
tags when an enum has constants, properties, or methods. However, I would imagine this to be rare for internal enums.