Re: CVS Access
| From: | Herman Radtke | Date: | Sat, 23 Feb 2008 16:18:43 +0000 |
| Subject: | Re: CVS Access | ||
| References: | 1 2 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969378614@lists.php.net to get a copy of this message | ||
I made the changes Hannes suggested and also added a few things from
http://www.php.net/~helly/php/ext/spl/. Is
there anything else I need
to add/modify before I commit these changes? Thanks.
Index: append.xml
===================================================================
RCS file: /repository/phpdoc/en/reference/spl/arrayobject/append.xml,v
retrieving revision 1.3
diff -u -r1.3 append.xml
--- append.xml 24 Dec 2007 12:30:23 -0000 1.3
+++ append.xml 23 Feb 2008 16:13:29 -0000
@@ -3,7 +3,7 @@
<refentry xml:id="arrayobject.append" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ArrayObject::append</refname>
- <refpurpose>Appends the value</refpurpose>
+ <refpurpose>Append an element to an ArrayObject</refpurpose>
</refnamediv>
<refsect1 role="description">
<title>Description</title>
@@ -11,9 +11,60 @@
<type>void</type><methodname>ArrayObject::append</methodname>
<methodparam><type>mixed</type><parameter>newval</parameter></methodparam>
</methodsynopsis>
+ <para>Append a value to the object</para>
+ </refsect1>
+ <refsect1>
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>newval</parameter></term>
+ <listitem>
+ <para>
+ The new value to append
+ </para>
+ <warning>
+ <para>
+ this method cannot be called when the ArrayObject refers to an object
+ </para>
+ </warning>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><function>ArrayObject::append</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$array = array(0 => 'a',
+ 1 => 'b');
- &warn.undocumented.func;
+$arrayobject = new ArrayObject($array);
+$arrayobject->append('c');
+
+print_r($arrayobject);
+?>
+]]>
+ </programlisting>
+ &example.outputs;
+ <screen>
+<![CDATA[
+ArrayObject Object
+(
+ [0] => a
+ [1] => b
+ [2] => c
+)
+]]>
+ </screen>
+ </example>
+ </para>
</refsect1>
</refentry>
Index: count.xml
===================================================================
RCS file: /repository/phpdoc/en/reference/spl/arrayobject/count.xml,v
retrieving revision 1.3
diff -u -r1.3 count.xml
--- count.xml 24 Dec 2007 12:30:23 -0000 1.3
+++ count.xml 23 Feb 2008 16:15:28 -0000
@@ -3,7 +3,7 @@
<refentry xml:id="arrayobject.count" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ArrayObject::count</refname>
- <refpurpose>Return the number of elements in the Iterator</refpurpose>
+ <refpurpose>Count the number of elements in an Array Object</refpurpose>
</refnamediv>
<refsect1 role="description">
<title>Description</title>
@@ -11,10 +11,50 @@
<type>int</type><methodname>ArrayObject::count</methodname>
<void/>
</methodsynopsis>
+ </refsect1>
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ the number of elements in the array or the number of public properties in
+ the object.
+ </para>
+ </refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><function>ArrayObject::count</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$array = array(0 => 'a',
+ 1 => 'b',
+ 2 => 'c');
- &warn.undocumented.func;
+$arrayobject = new ArrayObject($array);
+
+echo count($arrayobject);
+?>
+]]>
+ </programlisting>
+ &example.outputs;
+ <screen>
+<![CDATA[
+3
+]]>
+ </screen>
+ </example>
+ </para>
</refsect1>
+ <refsect1 role="notes">
+ &reftitle.notes;
+ <para>
+ The count method is inherited from the Countable interface. While
it is possible to use this function
+ as a method of ArrayObject, the whole point of the interface is
the count() support as shown in the
+ example above.
+ </para>
+ </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
On Sun, Jan 13, 2008 at 2:12 AM, Hannes Magnusson
<hannes.magnusson@gmail.com> wrote:
> On Jan 12, 2008 10:25 PM, Herman Radtke <hermanradtke@gmail.com> wrote:
> > Hello documentation team,
> >
> > I am interested in helping to document php. I am developer in Long
> > Beach, CA and use php primarily for new web application development.
> > I want to give something back to the community as I am familiarizing
> > myself with some of more obscure parts of php.
> >
> > I noticed patches were requested from other new participants, so I
> > figure I would provide them in my initial post. The SPL ArrayObject
> > had no documentation, so I added some basic information to the count
> > and append methods to get people started.
>
> Awesome!
> The SPL docs really need some work. There are bunch of docs on
> http://www.php.net/~helly/php/ext/spl/ which can be
> copy&pasted
> (including examples) so it's a good starting point.
>
> I assume you will be doing more doc work - so feel free to request an
> CVS account on http://php.net/cvs-php (note the "tricky
> questions")
> and commit these patches yourself when the account has been opened.
> Note: Our editor (Philip Olson) is currently in vacation for the next
> few weeks so it could take some time for the account to be opened.
>
> Couple of comments:
>
>
> > Index: en/reference/spl/arrayobject/count.xml
> [snip]
>
> > +echo $arrayobject->count();
>
> This should be count($arrayobject);
>
>
>
> > Index: en/reference/spl/arrayobject/append.xml
> [snip]
>
> > +print_r($arrayobject[2]);
>
> Note the [2]
>
>
>
> > +?>
> >
> > +]]>
> > + </programlisting>
> > + &example.outputs;
> > + <screen>
> > +<![CDATA[
> > +ArrayObject Object ( [0] => a [1] => b [2] => c )
>
> This is a full dump of the object :)
> And example output should be displayed like when running via cli (or
> when clicking "view source" in your browser), i.e. with all the new
> lines.
>
> -Hannes
>