-
Notifications
You must be signed in to change notification settings - Fork 824
8.3: Document Random\IntervalBoundary #3419
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
Changes from 2 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,75 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <reference xmlns="http://docbook.org/ns/docbook" xml:id="enum.random.intervalboundary" role="enum"> | ||
| <title>Random\IntervalBoundary</title> | ||
| <titleabbrev>Random\IntervalBoundary</titleabbrev> | ||
|
|
||
| <partintro> | ||
| <section xml:id="enum.random.intervalboundary.intro"> | ||
| &reftitle.intro; | ||
| <simpara> | ||
| The <enumname>Random\IntervalBoundary</enumname> cases determines if the | ||
| boundary values can be returned or not by | ||
| <methodname>Random\Randomizer::getFloat</methodname>. | ||
| </simpara> | ||
|
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 if I would make it specific to Perhaps something like:
|
||
| </section> | ||
|
|
||
| <section xml:id="enum.random.intervalboundary.synopsis"> | ||
| &reftitle.enumsynopsis; | ||
|
|
||
| <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. 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, and I've just realized that e.g. 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. 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 |
||
| <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> | ||
| The <parameter>min</parameter> value may be returned. | ||
| However, the <parameter>max</parameter> value will never be returned. | ||
| </enumitemdescription> | ||
|
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. A left-open interval. The lower boundary is included in the interval, the upper boundary is not. |
||
| </enumitem> | ||
|
|
||
| <enumitem> | ||
| <enumidentifier>ClosedClosed</enumidentifier> | ||
| <enumitemdescription> | ||
| Both the <parameter>min</parameter> and <parameter>max</parameter> value may be returned. | ||
|
||
| </enumitemdescription> | ||
| </enumitem> | ||
|
|
||
| <enumitem> | ||
| <enumidentifier>OpenClosed</enumidentifier> | ||
| <enumitemdescription> | ||
| The <parameter>max</parameter> value may be returned. | ||
|
||
| However, the <parameter>min</parameter> value will never be returned. | ||
| </enumitemdescription> | ||
| </enumitem> | ||
|
|
||
| <enumitem> | ||
| <enumidentifier>OpenOpen</enumidentifier> | ||
| <enumitemdescription> | ||
| Neither the <parameter>min</parameter> or <parameter>max</parameter> will ever be returned. | ||
|
||
| </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 | ||
| --> | ||
Uh oh!
There was an error while loading. Please reload this page.