Re: Inherited Constants?
| From: | Peter Cowburn | Date: | Wed, 19 Sep 2018 20:19:46 +0000 |
| Subject: | Re: Inherited Constants? | ||
| References: | 1 2 3 4 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969387029@lists.php.net to get a copy of this message | ||
On 19 September 2018 at 10:28, Christoph M. Becker <cmbecker69@gmx.de>
wrote:
> On 10.09.2018 at 17:04, Christoph M. Becker wrote:
>
> > On 09.09.2018 at 19:30, Peter Cowburn wrote:
> >
> >> On 9 September 2018 at 17:10, Christoph M. Becker <cmbecker69@gmx.de>
> wrote:
> >>
> >>> The PHP manual includes the inherited properties and methods for
> >>> subclasses. However, inherited constants are not included.[1] Is this
> >>> on purpose?
> >>
> >> It would be nice to see the inherited constants, in the same way as we
> have
> >> for properties and methods, so long as they're clearly marked as
> inherited
> >> (as properties and methods are).
> >
> > Fine, I'll see to it. :)
>
> I've committed a PoC[1] which is quite nice[2], in my opinion.
Nice. :)
> However, the xpointer expression
>
> xpointer(id('class.*')/db:partintro/db:section/db:classsynopsis/db:
> fieldsynopsis)
>
> would also include properties of the parent class. Can it be improved
> to distinguish between constants and properties?
Adding in a predicate looking for the classsynopsisinfo that comes just
before these fieldsynopsis elements should suffice, I think. Something
along the lines of:
xpointer(id('class.myawesomeclass')/db:partintro/db:section/db:classsynopsis/db:fieldsynopsis[preceding-sibling::db:classsynopsisinfo[1][@role='comment'
and text()='&Constants;']])
Or should we just group both under “Inherited constants and properties�?
>
> Should the classname skeleton[3] also be updated with the solution we'll
> choose?
>
Yup, and the docgen script as well (
http://svn.php.net/viewvc/phpdoc/doc-base/trunk/scripts/docgen/),
since
they're the two recommended ways of adding new doc files in the tutorial (
http://doc.php.net/tutorial/editing.php).
>
> [1]
> <http://svn.php.net/viewvc?view=revision&revision=345650>
> [2] <http://php.net/manual/en/class.spltempfileobject.php¡UéÙ
> áÒT²¡å÷á¬>
> [3]
> <http://svn.php.net/viewvc/phpdoc/doc-base/trunk/RFC/
> skeletons/classname.xml>
>
> --
> Christoph M. Becker
>