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.

Thank you for your time.


Index: en/reference/spl/arrayobject/count.xml
===================================================================
RCS file: /repository/phpdoc/en/reference/spl/arrayobject/count.xml,v
retrieving revision 1.3
diff -u -u -r1.3 count.xml
--- en/reference/spl/arrayobject/count.xml      24 Dec 2007 12:30:23
-0000     1.3
+++ en/reference/spl/arrayobject/count.xml      12 Jan 2008 21:22:18 -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,41 @@
    <type>int</type><methodname>ArrayObject::count</methodname>
    <void/>
   </methodsynopsis>
+ </refsect1>
+  <refsect1 role="returnvalues">
+  &reftitle.returnvalues;
+  <para>
+   The number of elements
+  </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 $arrayobject->count();
+?>

- </refsect1>
+]]>
+     </programlisting>
+     &example.outputs;
+     <screen>
+<![CDATA[
+3
+]]>
+     </screen>
+   </example>
+  </para>
+ </refsect1>
 </refentry>

 <!-- Keep this comment at the end of the file



Index: en/reference/spl/arrayobject/append.xml
===================================================================
RCS file: /repository/phpdoc/en/reference/spl/arrayobject/append.xml,v
retrieving revision 1.3
diff -u -u -r1.3 append.xml
--- en/reference/spl/arrayobject/append.xml     24 Dec 2007 12:30:23
-0000     1.3
+++ en/reference/spl/arrayobject/append.xml     12 Jan 2008 21:23:12 -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,50 @@
    <type>void</type><methodname>ArrayObject::append</methodname>
    <methodparam><type>mixed</type><parameter>newval</parameter></methodparam>
   </methodsynopsis>
+  <para>Append a value to the array object</para>
+ </refsect1>
+ <refsect1>
+  &reftitle.parameters;
+  <para>
+   <variablelist>
+    <varlistentry>
+     <term><parameter>newval</parameter></term>
+     <listitem>
+      <para>
+       The new value to append to the array object
+      </para>
+     </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[2]);
+?>

+]]>
+     </programlisting>
+     &example.outputs;
+     <screen>
+<![CDATA[
+ArrayObject Object ( [0] => a [1] => b [2] => c )
+]]>
+     </screen>
+   </example>
+  </para>
  </refsect1>
 </refentry>

Reply via email to