Re: cvs: peardoc /en/chapters standards.xml
| From: | Arnaud Limbourg | Date: | Wed, 07 Sep 2005 20:33:28 +0000 |
| Subject: | Re: cvs: peardoc /en/chapters standards.xml | ||
| References: | 1 | Groups: | php.pear.doc |
| Request: | Send a blank email to pear-doc+get-6742@lists.php.net to get a copy of this message | ||
Sorry about the line endings !
Arnaud.
Arnaud Limbourg wrote:
> arnaud Wed Sep 7 16:31:23 2005 EDT
>
> Modified files:
> /peardoc/en/chapters standards.xml
> Log:
> Fix #5312: wrong phpdocumentor tag used in example code
>
>
>
>
> ------------------------------------------------------------------------
>
>
>http://cvs.php.net/diff.php/peardoc/en/chapters/standards.xml?r1=1.37&r2=1.38&ty=u
> Index: peardoc/en/chapters/standards.xml
> diff -u peardoc/en/chapters/standards.xml:1.37 peardoc/en/chapters/standards.xml:1.38
> --- peardoc/en/chapters/standards.xml:1.37 Fri Sep 2 09:05:47 2005
> +++ peardoc/en/chapters/standards.xml Wed Sep 7 16:31:18 2005
> @@ -1,5 +1,5 @@
> <?xml version="1.0" encoding="iso-8859-1" ?>
> -<!-- $Revision: 1.37 $ -->
> +<!-- $Revision: 1.38 $ -->
>
> <chapter id="standards">
> <title>Coding Standards</title>
> @@ -173,142 +173,142 @@
> <para>
> Complete inline documentation comment blocks (docblocks)
> must be provided. Please read the
> - <link linkend="standards.sample">Sample File</link> and
> - <link linkend="standards.header">Header Comment Blocks</link>
> - sections of the Coding Standards to learn the specifics
> - of writing docblocks for PEAR packages.
> - Further information can be found on the
> - <ulink url="&url.phpdocumentor;">phpDocumentor</ulink> website.
> - </para>
> - <para>
> - Non-documentation comments are strongly encouraged. A general rule of
> - thumb is that if you look at a section of code and think
> - <quote>Wow, I don't want to try and describe that</quote>,
> - you need to comment it before you
> - forget how it works.
> - </para>
> - <para>
> - C style comments (/* */) and standard C++ comments (//) are both
> - fine. Use of Perl/shell style comments (#) is discouraged.
> - </para>
> - </sect1>
> -
> - <sect1 id="standards.including">
> - <title>Including Code</title>
> - <para>
> - Anywhere you are unconditionally including a class file, use
> - <command>require_once</command>. Anywhere you are conditionally
> - including a class file (for example, factory methods), use
> - <command>include_once</command>. Either of these will ensure
> - that class files are included only once. They share the same file
> - list, so you don't need to worry about mixing them - a file
> - included with <command>require_once</command> will not be
> - included again by <command>include_once</command>.
> - <note>
> - <simpara>
> - <command>include_once</command> and
> - <command>require_once</command> are statements, not
> - functions. Parentheses should not surround the subject filename.
> - </simpara>
> - </note>
> - </para>
> - </sect1>
> -
> - <sect1 id="standards.tags">
> - <title>PHP Code Tags</title>
> - <para>
> - <emphasis>Always</emphasis> use <literal><?php
> ?></literal> to
> - delimit PHP code, not the <literal><? ?></literal> shorthand.
> - This is required for PEAR compliance and is also the most portable
> - way to include PHP code on differing operating systems and setups.
> - </para>
> - </sect1>
> -
> - <sect1 id="standards.header">
> - <title>Header Comment Blocks</title>
> - <para>
> - All source code files in the PEAR repository shall contain a
> - <quote>page-level</quote> docblock at the top of each file
> - and a <quote>class-level</quote> docblock immediately above
> - each class. Below are examples of such docblocks.
> - </para>
> -
> - <para>
> - <programlisting role="php">
> - <![CDATA[
> + <link linkend="standards.sample">Sample File</link> and
> + <link linkend="standards.header">Header Comment Blocks</link>
> + sections of the Coding Standards to learn the specifics
> + of writing docblocks for PEAR packages.
> + Further information can be found on the
> + <ulink url="&url.phpdocumentor;">phpDocumentor</ulink> website.
> + </para>
> + <para>
> + Non-documentation comments are strongly encouraged. A general rule of
> + thumb is that if you look at a section of code and think
> + <quote>Wow, I don't want to try and describe that</quote>,
> + you need to comment it before you
> + forget how it works.
> + </para>
> + <para>
> + C style comments (/* */) and standard C++ comments (//) are both
> + fine. Use of Perl/shell style comments (#) is discouraged.
> + </para>
> + </sect1>
> +
> + <sect1 id="standards.including">
> + <title>Including Code</title>
> + <para>
> + Anywhere you are unconditionally including a class file, use
> + <command>require_once</command>. Anywhere you are conditionally
> + including a class file (for example, factory methods), use
> + <command>include_once</command>. Either of these will ensure
> + that class files are included only once. They share the same file
> + list, so you don't need to worry about mixing them - a file
> + included with <command>require_once</command> will not be
> + included again by <command>include_once</command>.
> + <note>
> + <simpara>
> + <command>include_once</command> and
> + <command>require_once</command> are statements, not
> + functions. Parentheses should not surround the subject filename.
> + </simpara>
> + </note>
> + </para>
> + </sect1>
> +
> + <sect1 id="standards.tags">
> + <title>PHP Code Tags</title>
> + <para>
> + <emphasis>Always</emphasis> use <literal><?php
> ?></literal> to
> + delimit PHP code, not the <literal><? ?></literal> shorthand.
> + This is required for PEAR compliance and is also the most portable
> + way to include PHP code on differing operating systems and setups.
> + </para>
> + </sect1>
> +
> + <sect1 id="standards.header">
> + <title>Header Comment Blocks</title>
> + <para>
> + All source code files in the PEAR repository shall contain a
> + <quote>page-level</quote> docblock at the top of each file
> + and a <quote>class-level</quote> docblock immediately above
> + each class. Below are examples of such docblocks.
> + </para>
> +
> + <para>
> + <programlisting role="php">
> + <![CDATA[
> <?php
>
> /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
>
> /**
> - * Short description for file
> - *
> - * Long description for file (if any)...
> - *
> - * PHP versions 4 and 5
> - *
> - * LICENSE: This source file is subject to version 3.0 of the PHP license
> - * that is available through the world-wide-web at the following URI:
> - * http://www.php.net/license/3_0.txt. If you did not receive
> a copy of
> - * the PHP License and are unable to obtain it through the web, please
> - * send a note to license@php.net so we can mail you a copy immediately.
> - *
> - * @category CategoryName
> - * @package PackageName
> - * @author Original Author <author@example.com>
> - * @author Another Author <another@example.com>
> - * @copyright 1997-2005 The PHP Group
> - * @license http://www.php.net/license/3_0.txt PHP License
> 3.0
> - * @version CVS: ]]>$<![CDATA[Id:$
> - * @link http://pear.php.net/package/PackageName
> - * @see NetOther, Net_Sample::Net_Sample()
> - * @since File available since Release 1.2.0
> - * @deprecated File deprecated in Release 2.0.0
> - */
> +* Short description for file
> +*
> +* Long description for file (if any)...
> +*
> +* PHP versions 4 and 5
> +*
> +* LICENSE: This source file is subject to version 3.0 of the PHP license
> +* that is available through the world-wide-web at the following URI:
> +* http://www.php.net/license/3_0.txt. If you did not receive
> a copy of
> +* the PHP License and are unable to obtain it through the web, please
> +* send a note to license@php.net so we can mail you a copy immediately.
> +*
> +* @category CategoryName
> +* @package PackageName
> +* @author Original Author <author@example.com>
> +* @author Another Author <another@example.com>
> +* @copyright 1997-2005 The PHP Group
> +* @license http://www.php.net/license/3_0.txt PHP License
> 3.0
> +* @version CVS: ]]>$<![CDATA[Id:$
> +* @link http://pear.php.net/package/PackageName
> +* @see NetOther, Net_Sample::Net_Sample()
> +* @since File available since Release 1.2.0
> +* @deprecated File deprecated in Release 2.0.0
> +*/
>
> /*
> - * Place includes, constant defines and $_GLOBAL settings here.
> - * Make sure they have appropriate docblocks to avoid phpDocumentor
> - * construing they are documented by the page-level docblock.
> - */
> +* Place includes, constant defines and $_GLOBAL settings here.
> +* Make sure they have appropriate docblocks to avoid phpDocumentor
> +* construing they are documented by the page-level docblock.
> +*/
>
> /**
> - * Short description for class
> - *
> - * Long description for class (if any)...
> - *
> - * @category CategoryName
> - * @package PackageName
> - * @author Original Author <author@example.com>
> - * @author Another Author <another@example.com>
> - * @copyright 1997-2005 The PHP Group
> - * @license http://www.php.net/license/3_0.txt PHP License
> 3.0
> - * @version Release: @package_version@
> - * @link http://pear.php.net/package/PackageName
> - * @see NetOther, Net_Sample::Net_Sample()
> - * @since Class available since Release 1.2.0
> - * @deprecated Class deprecated in Release 2.0.0
> - */
> +* Short description for class
> +*
> +* Long description for class (if any)...
> +*
> +* @category CategoryName
> +* @package PackageName
> +* @author Original Author <author@example.com>
> +* @author Another Author <another@example.com>
> +* @copyright 1997-2005 The PHP Group
> +* @license http://www.php.net/license/3_0.txt PHP License
> 3.0
> +* @version Release: @package_version@
> +* @link http://pear.php.net/package/PackageName
> +* @see NetOther, Net_Sample::Net_Sample()
> +* @since Class available since Release 1.2.0
> +* @deprecated Class deprecated in Release 2.0.0
> +*/
> class foo
> {
> }
>
> ?>
> - ]]>
> - </programlisting>
> - </para>
> -
> - <sect2 id="standards.header.variable">
> - <title>Required Tags That Have Variable Content</title>
> - <variablelist>
> - <varlistentry>
> - <term>Short Descriptions</term>
> - <listitem>
> - <para>
> - Short descriptions must be provided for all docblocks.
> - They should be a quick sentence, not the name of the item.
> - Please read the Coding Standard's
> - <link linkend="standards.sample">
> + ]]>
> + </programlisting>
> + </para>
> +
> + <sect2 id="standards.header.variable">
> + <title>Required Tags That Have Variable Content</title>
> + <variablelist>
> + <varlistentry>
> + <term>Short Descriptions</term>
> + <listitem>
> + <para>
> + Short descriptions must be provided for all docblocks.
> + They should be a quick sentence, not the name of the item.
> + Please read the Coding Standard's
> + <link linkend="standards.sample">
> Sample File</link> about how to write good descriptions.
> </para>
> </listitem>
> @@ -1043,14 +1043,14 @@
> * 'void' if nothing is returned.
> *
> * Here's an example of how to format examples:
> - * <sample>
> + * <code>
> * require_once 'Net/Sample.php';
> *
> * $s = new Net_Sample();
> * if (PEAR::isError($s)) {
> * echo $s->getMessage() . "\n";
> * }
> - * </sample>
> + * </code>
> *
> * @param string $arg1 the string to quote
> * @param int $arg2 an integer of how many problems happened.
>
>