cvs: peardoc /en/package/php/php-codesniffer coding-standard-class.xml coding-standard-tutorial.xml

From: Date: Thu, 17 May 2007 03:45:37 +0000
Subject: cvs: peardoc /en/package/php/php-codesniffer coding-standard-class.xml coding-standard-tutorial.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-9723@lists.php.net to get a copy of this message
squiz Thu May 17 03:45:37 2007 UTC Modified files: /peardoc/en/package/php/php-codesniffer coding-standard-class.xml coding-standard-tutorial.xml Log: Updated docs for new getExcludedSniffs method in coding standard class + fixed some coding standard errors in the examples http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-codesniffer/coding-standard-class.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/php/php-codesniffer/coding-standard-class.xml diff -u peardoc/en/package/php/php-codesniffer/coding-standard-class.xml:1.1 peardoc/en/package/php/php-codesniffer/coding-standard-class.xml:1.2 --- peardoc/en/package/php/php-codesniffer/coding-standard-class.xml:1.1 Wed Apr 4 00:57:37 2007 +++ peardoc/en/package/php/php-codesniffer/coding-standard-class.xml Thu May 17 03:45:37 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="ISO-8859-1" ?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.php.php-codesniffer.coding-standard-class"> <refnamediv> <refname>Coding Standard Class Methods</refname> @@ -16,7 +16,7 @@ <refsect1> <title>The getIncludedSniffs() Method</title> <para> - This method allows you to tell PHP_CodeSniffer that, besides the code sniffs you have defined in your <filename>Sniffs</filename> directory, you want to include code sniffs from other coding standards. You can include single code sniffs, whole directories of code sniffs, or even an entire coding standard. + This method allows you to tell PHP_CodeSniffer that, besides the code sniffs you have defined in your <filename>Sniffs</filename> directory, you want to include code sniffs from other coding standards. You can include single code sniffs, whole directories of code sniffs, or an entire coding standard. </para> <para> The example below includes the <literal>MultipleStatementAlignment</literal> sniff from the <literal>Generic</literal> coding standard, all code sniffs in the <literal>Functions</literal> category of the <literal>Generic</literal> coding standard, and all code sniffs defined in the <literal>PEAR</literal> coding standard. @@ -33,7 +33,7 @@ * * @return array */ -function getIncludedSniffs() +public function getIncludedSniffs() { return array( 'PEAR', @@ -53,6 +53,54 @@ </note> </refsect1> + <refsect1> + <title>The getExcludedSniffs() Method</title> + <para> + This method allows you to tell PHP_CodeSniffer to exclude code sniffs from your own standard or any other standard you are including using the <function>getIncludedSniffs</function> method. You can exclude single code sniffs, whole directories of code sniffs, or an entire coding standard. + </para> + <para> + The example below includes the whole <literal>PEAR</literal> coding standard, except for the <literal>ControlSignature</literal> sniff. + </para> + <para> + <programlisting role="php"> +<![CDATA[ +<?php +/** + * Return a list of external sniffs to include with this standard. + * + * The MyStandard coding standard uses all PEAR sniffs except one. + * + * @return array + */ +public function getIncludedSniffs() +{ + return array( + 'PEAR', + ); + +}//end getIncludedSniffs() + + +/** + * Return a list of external sniffs to exclude from this standard. + * + * The MyStandard coding standard uses all PEAR sniffs except one. + * + * @return array + */ +public function getExcludedSniffs() +{ + return array( + 'PEAR/Sniffs/ControlStructures/ControlSignatureSniff', + ); + +}//end getExcludedSniffs() +?> +]]> + </programlisting> + </para> + </refsect1> + </refentry> http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-codesniffer/coding-standard-tutorial.xml?r1=1.4&r2=1.5&diff_format=u Index: peardoc/en/package/php/php-codesniffer/coding-standard-tutorial.xml diff -u peardoc/en/package/php/php-codesniffer/coding-standard-tutorial.xml:1.4 peardoc/en/package/php/php-codesniffer/coding-standard-tutorial.xml:1.5 --- peardoc/en/package/php/php-codesniffer/coding-standard-tutorial.xml:1.4 Fri May 4 03:59:32 2007 +++ peardoc/en/package/php/php-codesniffer/coding-standard-tutorial.xml Thu May 17 03:45:37 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="ISO-8859-1" ?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="package.php.php-codesniffer.coding-standard-tutorial"> <refnamediv> <refname>Coding Standard Tutorial</refname> @@ -60,13 +60,13 @@ * @package PHP_CodeSniffer * @author Your Name <you@domain.net> * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version CVS: $Id: coding-standard-tutorial.xml,v 1.4 2007/05/04 03:59:32 squiz Exp $ + * @version CVS: $Id: coding-standard-tutorial.xml,v 1.5 2007/05/17 03:45:37 squiz Exp $ * @link http://pear.php.net/package/PHP_CodeSniffer */ require_once 'PHP/CodeSniffer/Standards/CodingStandard.php'; - /** +/** * MyStandard Coding Standard. * * @category PHP @@ -165,7 +165,7 @@ * @package PHP_CodeSniffer * @author Your Name <you@domain.net> * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version CVS: $Id: coding-standard-tutorial.xml,v 1.4 2007/05/04 03:59:32 squiz Exp $ + * @version CVS: $Id: coding-standard-tutorial.xml,v 1.5 2007/05/17 03:45:37 squiz Exp $ * @link http://pear.php.net/package/PHP_CodeSniffer */

« previous php.pear.doc (#9723) next »