cvs: pear /PhpDocumentor/phpDocumentor Errors.inc IntermediateParser.inc Io.inc Setup.inc.php /PhpDocumentor/tutorials/phpDocumentor manual.pkg
phpDocumentor.howto.pkg
| From: | Chuck Burgess | Date: | Thu, 15 Feb 2007 17:28:17 +0000 |
| Subject: | cvs: pear /PhpDocumentor/phpDocumentor Errors.inc IntermediateParser.inc Io.inc Setup.inc.php /PhpDocumentor/tutorials/phpDocumentor manual.pkg phpDocumentor.howto.pkg |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-44671@lists.php.net to get a copy of this message | ||
ashnazg Thu Feb 15 17:28:17 2007 UTC
Modified files:
/pear/PhpDocumentor/tutorials/phpDocumentor phpDocumentor.howto.pkg
manual.pkg
/pear/PhpDocumentor/phpDocumentor Io.inc IntermediateParser.inc
Errors.inc Setup.inc.php
Log:
sourceforge
[1044752] List undocumented classes/functions
[1622538] List undocumented classes/functions
http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg?r1=1.4&r2=1.5&diff_format=u Index: pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg diff -u pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg:1.4 pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg:1.5 --- pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg:1.4 Mon Dec 18 20:53:43 2006 +++ pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg Thu Feb 15 17:28:17 2007 @@ -827,13 +827,14 @@ <entry>-pp</entry> <entry>--parseprivate</entry> <entry>parse elements marked private with @access. Valid options are "on" - and "offn" default value is "off" + and "off" default value is "off" </entry> </row> <row> <entry>-q</entry> <entry>--quiet</entry> - <entry>do not display parsing/conversion messages. Useful for cron jobs</entry> + <entry>do not display parsing/conversion messages. Useful for cron jobs. Valid options are "on" + and "off" default value is "off"</entry> </row> <row> <entry>-ric</entry> @@ -864,6 +865,12 @@ exist, or Smarty will bail on attempting to compile the templates. </entry> </row> + <row> + <entry>-ue</entry> + <entry>--undocumentedelements</entry> + <entry>Enable warnings for undocumented elements. Useful for identifying classes and methods that haven't yet been documented. + Valid options are "on" and "offn" default value is "off"</entry> + </row> </tbody> </tgroup> </table> @@ -901,6 +908,10 @@ template to handle. Note that in version 1.2.0+, the unknown_tags array is passed to templates. </para> </refsect3> + <refsect3 id="{@id hidden}"> + <title>-dh, --hidden</title> + <para>Use this option to tell phpDocumentor to parse files that begin with a period (.)</para> + </refsect3> <refsect3 id="{@id defaultcategoryname}"> <title>-dn, --defaultcategoryname</title> <para>This will tell phpDocumentor to group any uncategorized elements into the primary @@ -962,10 +973,6 @@ </itemizedlist> </para> </refsect3> - <refsect3 id="{@id hidden}"> - <title>-h, --hidden</title> - <para>Use this option to tell phpDocumentor to parse files that begin with a period (.)</para> - </refsect3> <refsect3 id="{@id ignore}"> <title>-i, --ignore</title> <para>Use the -i option to exclude files and directories from parsing. The -i option recognizes the * and ? wildcards, like -f does. In addition, it is possible to ignore a subdirectory of any directory using "dirname/"</para> @@ -1103,6 +1110,10 @@ <title>-ti, --title</title> <para>Set the global title of the generated documentation</para> </refsect3> + <refsect3 id="{@id undocumentedelements}"> + <title>-ue, --undocumentedelements</title> + <para>This option tells phpDocumentor whether or not to suppress warnings about certain objects (classes, methods) that are not documented via a DocBlock comment. Use this to help identify objects that you still need to write documentation for.</para> + </refsect3> </refsect2> <refsect2 id="{@id config-files}"> <title>phpDocumentor's dynamic User-defined config files</title> http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/tutorials/phpDocumentor/manual.pkg?r1=1.3&r2=1.4&diff_format=u Index: pear/PhpDocumentor/tutorials/phpDocumentor/manual.pkg diff -u pear/PhpDocumentor/tutorials/phpDocumentor/manual.pkg:1.3 pear/PhpDocumentor/tutorials/phpDocumentor/manual.pkg:1.4 --- pear/PhpDocumentor/tutorials/phpDocumentor/manual.pkg:1.3 Tue Oct 24 13:04:21 2006 +++ pear/PhpDocumentor/tutorials/phpDocumentor/manual.pkg Thu Feb 15 17:28:17 2007 @@ -102,6 +102,12 @@ {@link mailto:william_hardeman@hands-solutions.com william_hardeman@hands-solutions.com} </authorblurb> </author> + <author> + Chuck Burgess + <authorblurb> + {@link mailto:ashnazg@php.net ashnazg@php.net} + </authorblurb> + </author> </authorgroup> </refsynopsisdiv> <refsect1 id="{@id intro}"> http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/phpDocumentor/Io.inc?r1=1.12&r2=1.13&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/Io.inc diff -u pear/PhpDocumentor/phpDocumentor/Io.inc:1.12 pear/PhpDocumentor/phpDocumentor/Io.inc:1.13 --- pear/PhpDocumentor/phpDocumentor/Io.inc:1.12 Tue May 23 13:09:26 2006 +++ pear/PhpDocumentor/phpDocumentor/Io.inc Thu Feb 15 17:28:17 2007 @@ -33,7 +33,7 @@ * @author Gregory Beaver <cellog@php.net> * @copyright 2000-2006 Joshua Eichorn, Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @version CVS: $Id: Io.inc,v 1.12 2006/05/23 13:09:26 cellog Exp $ + * @version CVS: $Id: Io.inc,v 1.13 2007/02/15 17:28:17 ashnazg Exp $ * @filesource * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor @@ -44,7 +44,7 @@ * * @author Joshua Eichorn <jeichorn@phpdoc.org> * @author Gregory Beaver <cellog@php.net> - * @version $Id: Io.inc,v 1.12 2006/05/23 13:09:26 cellog Exp $ + * @version $Id: Io.inc,v 1.13 2007/02/15 17:28:17 ashnazg Exp $ * @package phpDocumentor */ class Io @@ -61,7 +61,17 @@ * @var false|array */ var $ignore = false; - + /** + * A specific array of values that boolean-based arguments can understand, + * aided by the {@link decideOnOrOff()} helper method. + * @var array + */ + var $valid_booleans = array + ( + '', ' ', 'on', 'On', 'ON', 'y', 'Y', 'yes', 'Yes', 'YES', 'true', 'True', 'TRUE', '1', + 'off', 'Off', 'OFF', 'n', 'N', 'no', 'No', 'NO', 'false', 'False', 'FALSE', '0' + ); + /** * creates an array $this->phpDocOptions and sets program options in it. * Array is in the format of: @@ -104,12 +114,17 @@ $this->phpDocOptions['hidden']['tag'] = array("-dh", "--hidden"); $this->phpDocOptions['hidden']['desc'] = "set equal to on (-dh on) to descend into hidden directories (directories starting with '.'), default is off"; $this->phpDocOptions['hidden']['type'] = "set"; - $this->phpDocOptions['hidden']['validvalues'] = array('on', 'off'); + $this->phpDocOptions['hidden']['validvalues'] = $this->valid_booleans; $this->phpDocOptions['quiet']['tag'] = array("-q", "--quiet"); $this->phpDocOptions['quiet']['desc'] = "do not display parsing/conversion messages. Useful for cron jobs on/off default off"; $this->phpDocOptions['quiet']['type'] = "set"; - $this->phpDocOptions['quiet']['validvalues'] = array('on', 'off'); + $this->phpDocOptions['quiet']['validvalues'] = $this->valid_booleans; + + $this->phpDocOptions['undocumentedelements']['tag'] = array("-ue", "--undocumentedelements"); + $this->phpDocOptions['undocumentedelements']['desc'] = "Control whether or not warnings will be shown for undocumented elements. Useful for identifying classes and methods that haven't yet been documented on/off default off"; + $this->phpDocOptions['undocumentedelements']['type'] = "set"; + $this->phpDocOptions['undocumentedelements']['validvalues'] = $this->valid_booleans; $this->phpDocOptions['title']['tag'] = array("-ti","--title"); $this->phpDocOptions['title']['desc'] = "title of generated documentation, default is 'Generated Documentation'"; http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/phpDocumentor/IntermediateParser.inc?r1=1.17&r2=1.18&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/IntermediateParser.inc diff -u pear/PhpDocumentor/phpDocumentor/IntermediateParser.inc:1.17 pear/PhpDocumentor/phpDocumentor/IntermediateParser.inc:1.18 --- pear/PhpDocumentor/phpDocumentor/IntermediateParser.inc:1.17 Fri Dec 22 13:58:32 2006 +++ pear/PhpDocumentor/phpDocumentor/IntermediateParser.inc Thu Feb 15 17:28:17 2007 @@ -31,7 +31,7 @@ * @author Gregory Beaver <cellog@php.net> * @copyright 2002-2006 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @version CVS: $Id: IntermediateParser.inc,v 1.17 2006/12/22 13:58:32 ashnazg Exp $ + * @version CVS: $Id: IntermediateParser.inc,v 1.18 2007/02/15 17:28:17 ashnazg Exp $ * @filesource * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor @@ -53,7 +53,7 @@ * $docblock parameter of the parserElement * descendant object. * @author Gregory Beaver - * @version $Id: IntermediateParser.inc,v 1.17 2006/12/22 13:58:32 ashnazg Exp $ + * @version $Id: IntermediateParser.inc,v 1.18 2007/02/15 17:28:17 ashnazg Exp $ * @copyright 2002 Gregory Beaver * @package phpDocumentor */ @@ -246,7 +246,20 @@ * @tutorial phpDocumentor.howto.pkg#using.command-line.quiet */ var $quietMode = false; - + + /** + * set in {@link Setup.inc.php} to the value of the undocumentedElementWarnings commandline + * option. + * + * If this option is true, warnings about certain elements (classes, methods) + * that are not documented with DocBlocks will be shown while parsing, + * and will also be displayed in the errors.html page + * (other documentation is unaffected) + * @var boolean + * @tutorial phpDocumentor.howto.pkg#using.command-line.undocumentedelements + */ + var $undocumentedElementWarnings = false; + /** * used to keep track of inheritance at the smartest level possible for a * dumb computer @@ -640,6 +653,10 @@ if (empty($this->last)) { + if ($this->undocumentedElementWarnings) + { + addWarning(PDERROR_UNDOCUMENTED_ELEMENT,'Method',$data->getName(),'method'); + } if (isset($this->db_template)) // use the docblock template $this->last = phpDocumentor_clone($this->db_template); @@ -886,6 +903,10 @@ $this->data->clean = false; if (empty($this->last)) { + if ($this->undocumentedElementWarnings) + { + addWarning(PDERROR_UNDOCUMENTED_ELEMENT,'Class',$data->getName(),'Class'); + } if (isset($this->db_template)) // use the docblock template $this->last = phpDocumentor_clone($this->db_template); @@ -1844,6 +1865,18 @@ { $this->quietMode = $quietMode; } + + /** + * show warnings for undocumented elements + * + * If set to false, no warnings will be shown for undocumented elements. + * Useful for identifying classes and methods that haven't yet been documented. + * @param bool $undocumentedElementWarnings + */ + function setUndocumentedElementWarningsMode($undocumentedElementWarnings) + { + $this->undocumentedElementWarnings = $undocumentedElementWarnings; + } /** * set display of elements marked with @access private http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/phpDocumentor/Errors.inc?r1=1.8&r2=1.9&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/Errors.inc diff -u pear/PhpDocumentor/phpDocumentor/Errors.inc:1.8 pear/PhpDocumentor/phpDocumentor/Errors.inc:1.9 --- pear/PhpDocumentor/phpDocumentor/Errors.inc:1.8 Wed Aug 16 17:08:32 2006 +++ pear/PhpDocumentor/phpDocumentor/Errors.inc Thu Feb 15 17:28:17 2007 @@ -30,7 +30,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 2001-2006 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @version CVS: $Id: Errors.inc,v 1.8 2006/08/16 17:08:32 cellog Exp $ + * @version CVS: $Id: Errors.inc,v 1.9 2007/02/15 17:28:17 ashnazg Exp $ * @filesource * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor @@ -374,7 +374,10 @@ * warning triggered when @todo is used on an include element */ define("PDERROR_NOTODO_INCLUDE", 77); - +/** + * warning triggered when a class or method hasn't got docblock + */ +define("PDERROR_UNDOCUMENTED_ELEMENT", 78); /** * Error messages for phpDocumentor parser warnings * @global array $GLOBALS['phpDocumentor_warning_descrip'] @@ -410,6 +413,7 @@ PDERROR_NO_DOCBOOK_ID => 'Tutorial section %s "%s" has no id="{@id subsection}" tag ({@id} for refentry)', PDERROR_BEAUTIFYING_FAILED => 'Beautifying failed: %s', PDERROR_NOTODO_INCLUDE => '@todo on an include element is ignored (line %s, file %s)', + PDERROR_UNDOCUMENTED_ELEMENT => '%s "%s" has no %s-level DocBlock.', ); http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/phpDocumentor/Setup.inc.php?r1=1.18&r2=1.19&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/Setup.inc.php diff -u pear/PhpDocumentor/phpDocumentor/Setup.inc.php:1.18 pear/PhpDocumentor/phpDocumentor/Setup.inc.php:1.19 --- pear/PhpDocumentor/phpDocumentor/Setup.inc.php:1.18 Fri Feb 9 14:09:17 2007 +++ pear/PhpDocumentor/phpDocumentor/Setup.inc.php Thu Feb 15 17:28:17 2007 @@ -30,7 +30,7 @@ * @author Gregory Beaver <cellog@php.net> * @copyright 2002-2006 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @version CVS: $Id: Setup.inc.php,v 1.18 2007/02/09 14:09:17 ashnazg Exp $ + * @version CVS: $Id: Setup.inc.php,v 1.19 2007/02/15 17:28:17 ashnazg Exp $ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 @@ -262,6 +262,9 @@ // set to parse elements marked private with @access private $this->render->setParsePrivate((isset($_phpDocumentor_setting['parseprivate'])) ? decideOnOrOff($_phpDocumentor_setting['parseprivate']) : false); + // set to print warnings when undocumented elements are spotted + $this->render->setUndocumentedElementWarningsMode((isset($_phpDocumentor_setting['undocumentedelements'])) ? decideOnOrOff($_phpDocumentor_setting['undocumentedelements']) : false); + if (isset($_phpDocumentor_setting['ignoretags'])) { $ignoretags = explode(',', $_phpDocumentor_setting['ignoretags']); @@ -452,6 +455,11 @@ { $this->render->setQuietMode($flag); } + + function setUndocumentedElementWarnings($flag = true) + { + $this->render->setUndocumentedElementWarnings($flag); + } function setTargetDir($target) {
http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg?r1=1.4&r2=1.5&diff_format=u Index: pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg diff -u pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg:1.4 pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg:1.5 --- pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg:1.4 Mon Dec 18 20:53:43 2006 +++ pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg Thu Feb 15 17:28:17 2007 @@ -827,13 +827,14 @@ <entry>-pp</entry> <entry>--parseprivate</entry> <entry>parse elements marked private with @access. Valid options are "on" - and "offn" default value is "off" + and "off" default value is "off" </entry> </row> <row> <entry>-q</entry> <entry>--quiet</entry> - <entry>do not display parsing/conversion messages. Useful for cron jobs</entry> + <entry>do not display parsing/conversion messages. Useful for cron jobs. Valid options are "on" + and "off" default value is "off"</entry> </row> <row> <entry>-ric</entry> @@ -864,6 +865,12 @@ exist, or Smarty will bail on attempting to compile the templates. </entry> </row> + <row> + <entry>-ue</entry> + <entry>--undocumentedelements</entry> + <entry>Enable warnings for undocumented elements. Useful for identifying classes and methods that haven't yet been documented. + Valid options are "on" and "offn" default value is "off"</entry> + </row> </tbody> </tgroup> </table> @@ -901,6 +908,10 @@ template to handle. Note that in version 1.2.0+, the unknown_tags array is passed to templates. </para> </refsect3> + <refsect3 id="{@id hidden}"> + <title>-dh, --hidden</title> + <para>Use this option to tell phpDocumentor to parse files that begin with a period (.)</para> + </refsect3> <refsect3 id="{@id defaultcategoryname}"> <title>-dn, --defaultcategoryname</title> <para>This will tell phpDocumentor to group any uncategorized elements into the primary @@ -962,10 +973,6 @@ </itemizedlist> </para> </refsect3> - <refsect3 id="{@id hidden}"> - <title>-h, --hidden</title> - <para>Use this option to tell phpDocumentor to parse files that begin with a period (.)</para> - </refsect3> <refsect3 id="{@id ignore}"> <title>-i, --ignore</title> <para>Use the -i option to exclude files and directories from parsing. The -i option recognizes the * and ? wildcards, like -f does. In addition, it is possible to ignore a subdirectory of any directory using "dirname/"</para> @@ -1103,6 +1110,10 @@ <title>-ti, --title</title> <para>Set the global title of the generated documentation</para> </refsect3> + <refsect3 id="{@id undocumentedelements}"> + <title>-ue, --undocumentedelements</title> + <para>This option tells phpDocumentor whether or not to suppress warnings about certain objects (classes, methods) that are not documented via a DocBlock comment. Use this to help identify objects that you still need to write documentation for.</para> + </refsect3> </refsect2> <refsect2 id="{@id config-files}"> <title>phpDocumentor's dynamic User-defined config files</title> http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/tutorials/phpDocumentor/manual.pkg?r1=1.3&r2=1.4&diff_format=u Index: pear/PhpDocumentor/tutorials/phpDocumentor/manual.pkg diff -u pear/PhpDocumentor/tutorials/phpDocumentor/manual.pkg:1.3 pear/PhpDocumentor/tutorials/phpDocumentor/manual.pkg:1.4 --- pear/PhpDocumentor/tutorials/phpDocumentor/manual.pkg:1.3 Tue Oct 24 13:04:21 2006 +++ pear/PhpDocumentor/tutorials/phpDocumentor/manual.pkg Thu Feb 15 17:28:17 2007 @@ -102,6 +102,12 @@ {@link mailto:william_hardeman@hands-solutions.com william_hardeman@hands-solutions.com} </authorblurb> </author> + <author> + Chuck Burgess + <authorblurb> + {@link mailto:ashnazg@php.net ashnazg@php.net} + </authorblurb> + </author> </authorgroup> </refsynopsisdiv> <refsect1 id="{@id intro}"> http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/phpDocumentor/Io.inc?r1=1.12&r2=1.13&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/Io.inc diff -u pear/PhpDocumentor/phpDocumentor/Io.inc:1.12 pear/PhpDocumentor/phpDocumentor/Io.inc:1.13 --- pear/PhpDocumentor/phpDocumentor/Io.inc:1.12 Tue May 23 13:09:26 2006 +++ pear/PhpDocumentor/phpDocumentor/Io.inc Thu Feb 15 17:28:17 2007 @@ -33,7 +33,7 @@ * @author Gregory Beaver <cellog@php.net> * @copyright 2000-2006 Joshua Eichorn, Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @version CVS: $Id: Io.inc,v 1.12 2006/05/23 13:09:26 cellog Exp $ + * @version CVS: $Id: Io.inc,v 1.13 2007/02/15 17:28:17 ashnazg Exp $ * @filesource * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor @@ -44,7 +44,7 @@ * * @author Joshua Eichorn <jeichorn@phpdoc.org> * @author Gregory Beaver <cellog@php.net> - * @version $Id: Io.inc,v 1.12 2006/05/23 13:09:26 cellog Exp $ + * @version $Id: Io.inc,v 1.13 2007/02/15 17:28:17 ashnazg Exp $ * @package phpDocumentor */ class Io @@ -61,7 +61,17 @@ * @var false|array */ var $ignore = false; - + /** + * A specific array of values that boolean-based arguments can understand, + * aided by the {@link decideOnOrOff()} helper method. + * @var array + */ + var $valid_booleans = array + ( + '', ' ', 'on', 'On', 'ON', 'y', 'Y', 'yes', 'Yes', 'YES', 'true', 'True', 'TRUE', '1', + 'off', 'Off', 'OFF', 'n', 'N', 'no', 'No', 'NO', 'false', 'False', 'FALSE', '0' + ); + /** * creates an array $this->phpDocOptions and sets program options in it. * Array is in the format of: @@ -104,12 +114,17 @@ $this->phpDocOptions['hidden']['tag'] = array("-dh", "--hidden"); $this->phpDocOptions['hidden']['desc'] = "set equal to on (-dh on) to descend into hidden directories (directories starting with '.'), default is off"; $this->phpDocOptions['hidden']['type'] = "set"; - $this->phpDocOptions['hidden']['validvalues'] = array('on', 'off'); + $this->phpDocOptions['hidden']['validvalues'] = $this->valid_booleans; $this->phpDocOptions['quiet']['tag'] = array("-q", "--quiet"); $this->phpDocOptions['quiet']['desc'] = "do not display parsing/conversion messages. Useful for cron jobs on/off default off"; $this->phpDocOptions['quiet']['type'] = "set"; - $this->phpDocOptions['quiet']['validvalues'] = array('on', 'off'); + $this->phpDocOptions['quiet']['validvalues'] = $this->valid_booleans; + + $this->phpDocOptions['undocumentedelements']['tag'] = array("-ue", "--undocumentedelements"); + $this->phpDocOptions['undocumentedelements']['desc'] = "Control whether or not warnings will be shown for undocumented elements. Useful for identifying classes and methods that haven't yet been documented on/off default off"; + $this->phpDocOptions['undocumentedelements']['type'] = "set"; + $this->phpDocOptions['undocumentedelements']['validvalues'] = $this->valid_booleans; $this->phpDocOptions['title']['tag'] = array("-ti","--title"); $this->phpDocOptions['title']['desc'] = "title of generated documentation, default is 'Generated Documentation'"; http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/phpDocumentor/IntermediateParser.inc?r1=1.17&r2=1.18&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/IntermediateParser.inc diff -u pear/PhpDocumentor/phpDocumentor/IntermediateParser.inc:1.17 pear/PhpDocumentor/phpDocumentor/IntermediateParser.inc:1.18 --- pear/PhpDocumentor/phpDocumentor/IntermediateParser.inc:1.17 Fri Dec 22 13:58:32 2006 +++ pear/PhpDocumentor/phpDocumentor/IntermediateParser.inc Thu Feb 15 17:28:17 2007 @@ -31,7 +31,7 @@ * @author Gregory Beaver <cellog@php.net> * @copyright 2002-2006 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @version CVS: $Id: IntermediateParser.inc,v 1.17 2006/12/22 13:58:32 ashnazg Exp $ + * @version CVS: $Id: IntermediateParser.inc,v 1.18 2007/02/15 17:28:17 ashnazg Exp $ * @filesource * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor @@ -53,7 +53,7 @@ * $docblock parameter of the parserElement * descendant object. * @author Gregory Beaver - * @version $Id: IntermediateParser.inc,v 1.17 2006/12/22 13:58:32 ashnazg Exp $ + * @version $Id: IntermediateParser.inc,v 1.18 2007/02/15 17:28:17 ashnazg Exp $ * @copyright 2002 Gregory Beaver * @package phpDocumentor */ @@ -246,7 +246,20 @@ * @tutorial phpDocumentor.howto.pkg#using.command-line.quiet */ var $quietMode = false; - + + /** + * set in {@link Setup.inc.php} to the value of the undocumentedElementWarnings commandline + * option. + * + * If this option is true, warnings about certain elements (classes, methods) + * that are not documented with DocBlocks will be shown while parsing, + * and will also be displayed in the errors.html page + * (other documentation is unaffected) + * @var boolean + * @tutorial phpDocumentor.howto.pkg#using.command-line.undocumentedelements + */ + var $undocumentedElementWarnings = false; + /** * used to keep track of inheritance at the smartest level possible for a * dumb computer @@ -640,6 +653,10 @@ if (empty($this->last)) { + if ($this->undocumentedElementWarnings) + { + addWarning(PDERROR_UNDOCUMENTED_ELEMENT,'Method',$data->getName(),'method'); + } if (isset($this->db_template)) // use the docblock template $this->last = phpDocumentor_clone($this->db_template); @@ -886,6 +903,10 @@ $this->data->clean = false; if (empty($this->last)) { + if ($this->undocumentedElementWarnings) + { + addWarning(PDERROR_UNDOCUMENTED_ELEMENT,'Class',$data->getName(),'Class'); + } if (isset($this->db_template)) // use the docblock template $this->last = phpDocumentor_clone($this->db_template); @@ -1844,6 +1865,18 @@ { $this->quietMode = $quietMode; } + + /** + * show warnings for undocumented elements + * + * If set to false, no warnings will be shown for undocumented elements. + * Useful for identifying classes and methods that haven't yet been documented. + * @param bool $undocumentedElementWarnings + */ + function setUndocumentedElementWarningsMode($undocumentedElementWarnings) + { + $this->undocumentedElementWarnings = $undocumentedElementWarnings; + } /** * set display of elements marked with @access private http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/phpDocumentor/Errors.inc?r1=1.8&r2=1.9&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/Errors.inc diff -u pear/PhpDocumentor/phpDocumentor/Errors.inc:1.8 pear/PhpDocumentor/phpDocumentor/Errors.inc:1.9 --- pear/PhpDocumentor/phpDocumentor/Errors.inc:1.8 Wed Aug 16 17:08:32 2006 +++ pear/PhpDocumentor/phpDocumentor/Errors.inc Thu Feb 15 17:28:17 2007 @@ -30,7 +30,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 2001-2006 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @version CVS: $Id: Errors.inc,v 1.8 2006/08/16 17:08:32 cellog Exp $ + * @version CVS: $Id: Errors.inc,v 1.9 2007/02/15 17:28:17 ashnazg Exp $ * @filesource * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor @@ -374,7 +374,10 @@ * warning triggered when @todo is used on an include element */ define("PDERROR_NOTODO_INCLUDE", 77); - +/** + * warning triggered when a class or method hasn't got docblock + */ +define("PDERROR_UNDOCUMENTED_ELEMENT", 78); /** * Error messages for phpDocumentor parser warnings * @global array $GLOBALS['phpDocumentor_warning_descrip'] @@ -410,6 +413,7 @@ PDERROR_NO_DOCBOOK_ID => 'Tutorial section %s "%s" has no id="{@id subsection}" tag ({@id} for refentry)', PDERROR_BEAUTIFYING_FAILED => 'Beautifying failed: %s', PDERROR_NOTODO_INCLUDE => '@todo on an include element is ignored (line %s, file %s)', + PDERROR_UNDOCUMENTED_ELEMENT => '%s "%s" has no %s-level DocBlock.', ); http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/phpDocumentor/Setup.inc.php?r1=1.18&r2=1.19&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/Setup.inc.php diff -u pear/PhpDocumentor/phpDocumentor/Setup.inc.php:1.18 pear/PhpDocumentor/phpDocumentor/Setup.inc.php:1.19 --- pear/PhpDocumentor/phpDocumentor/Setup.inc.php:1.18 Fri Feb 9 14:09:17 2007 +++ pear/PhpDocumentor/phpDocumentor/Setup.inc.php Thu Feb 15 17:28:17 2007 @@ -30,7 +30,7 @@ * @author Gregory Beaver <cellog@php.net> * @copyright 2002-2006 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @version CVS: $Id: Setup.inc.php,v 1.18 2007/02/09 14:09:17 ashnazg Exp $ + * @version CVS: $Id: Setup.inc.php,v 1.19 2007/02/15 17:28:17 ashnazg Exp $ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 @@ -262,6 +262,9 @@ // set to parse elements marked private with @access private $this->render->setParsePrivate((isset($_phpDocumentor_setting['parseprivate'])) ? decideOnOrOff($_phpDocumentor_setting['parseprivate']) : false); + // set to print warnings when undocumented elements are spotted + $this->render->setUndocumentedElementWarningsMode((isset($_phpDocumentor_setting['undocumentedelements'])) ? decideOnOrOff($_phpDocumentor_setting['undocumentedelements']) : false); + if (isset($_phpDocumentor_setting['ignoretags'])) { $ignoretags = explode(',', $_phpDocumentor_setting['ignoretags']); @@ -452,6 +455,11 @@ { $this->render->setQuietMode($flag); } + + function setUndocumentedElementWarnings($flag = true) + { + $this->render->setUndocumentedElementWarnings($flag); + } function setTargetDir($target) {