cvs: php4 /pear/PHPDoc/analyser PhpdocAnalyser.php PhpdocClassAnalyser.php PhpdocModuleAnalyser.php /pear/PHPDoc/exceptions PhpdocError.php
/pear/PHPDoc/filehandler PhpdocFileHandler.php /pear/PHPDoc/indexer PhpdocIndexer.php /pear/PHPDoc/parser PhpdocClassParser.php
PhpdocConstantParser.php PhpdocFunctionParser.php PhpdocParser.php PhpdocParserCore.php PhpdocParserRegExp.php PhpdocParserTags.php
PhpdocVariableParser.php /pear/PHPDoc/renderer/html PhpdocHTMLClassRenderer.php PhpdocHTMLDocumentRenderer.php PhpdocHTMLIndexRenderer.php
PhpdocHTMLModuleRenderer.php PhpdocHTMLWarningRenderer.php /pear/PHPDoc/warning PhpdocWarning.php /pear/PHPDoc/xmlexporter
PhpdocXMLClassExporter.php PhpdocXMLDocumentExporter.php PhpdocXMLExporter.php PhpdocXMLIndexExporter.php /pear/PHPDoc/xmlreader PhpdocXMLReader.php
/pear/PHPDoc/xmlwriter PhpdocXMLWriter.php
| From: | Ulf Wendel | Date: | Sun, 03 Dec 2000 22:37:40 +0000 |
| Subject: | cvs: php4 /pear/PHPDoc/analyser PhpdocAnalyser.php PhpdocClassAnalyser.php PhpdocModuleAnalyser.php /pear/PHPDoc/exceptions PhpdocError.php /pear/PHPDoc/filehandler PhpdocFileHandler.php /pear/PHPDoc/indexer PhpdocIndexer.php /pear/PHPDoc/parser PhpdocClassParser.php PhpdocConstantParser.php PhpdocFunctionParser.php PhpdocParser.php PhpdocParserCore.php PhpdocParserRegExp.php PhpdocParserTags.php PhpdocVariableParser.php /pear/PHPDoc/renderer/html PhpdocHTMLClassRenderer.php PhpdocHTMLDocumentRenderer.php PhpdocHTMLIndexRenderer.php PhpdocHTMLModuleRenderer.php PhpdocHTMLWarningRenderer.php /pear/PHPDoc/warning PhpdocWarning.php /pear/PHPDoc/xmlexporter PhpdocXMLClassExporter.php PhpdocXMLDocumentExporter.php PhpdocXMLExporter.php PhpdocXMLIndexExporter.php /pear/PHPDoc/xmlreader PhpdocXMLReader.php /pear/PHPDoc/xmlwriter PhpdocXMLWriter.php |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2909@lists.php.net to get a copy of this message | ||
uw Sun Dec 3 14:37:40 2000 EDT
Modified files:
/php4/pear/PHPDoc/analyser PhpdocAnalyser.php
PhpdocClassAnalyser.php
PhpdocModuleAnalyser.php
/php4/pear/PHPDoc/exceptions PhpdocError.php
/php4/pear/PHPDoc/filehandler PhpdocFileHandler.php
/php4/pear/PHPDoc/indexer PhpdocIndexer.php
/php4/pear/PHPDoc/parser PhpdocClassParser.php
PhpdocConstantParser.php
PhpdocFunctionParser.php PhpdocParser.php
PhpdocParserCore.php
PhpdocParserRegExp.php
PhpdocParserTags.php
PhpdocVariableParser.php
/php4/pear/PHPDoc/renderer/html PhpdocHTMLClassRenderer.php
PhpdocHTMLDocumentRenderer.php
PhpdocHTMLIndexRenderer.php
PhpdocHTMLModuleRenderer.php
PhpdocHTMLWarningRenderer.php
/php4/pear/PHPDoc/warning PhpdocWarning.php
/php4/pear/PHPDoc/xmlexporter PhpdocXMLClassExporter.php
PhpdocXMLDocumentExporter.php
PhpdocXMLExporter.php
PhpdocXMLIndexExporter.php
/php4/pear/PHPDoc/xmlreader PhpdocXMLReader.php
/php4/pear/PHPDoc/xmlwriter PhpdocXMLWriter.php
Log:
- doc comments refined
PHPDocs own Reportfile looks better now...
Index: php4/pear/PHPDoc/analyser/PhpdocAnalyser.php diff -u php4/pear/PHPDoc/analyser/PhpdocAnalyser.php:1.4 php4/pear/PHPDoc/analyser/PhpdocAnalyser.php:1.5 --- php4/pear/PHPDoc/analyser/PhpdocAnalyser.php:1.4 Sun Dec 3 08:47:14 2000 +++ php4/pear/PHPDoc/analyser/PhpdocAnalyser.php Sun Dec 3 14:37:36 2000 @@ -3,12 +3,12 @@ * Analyses parsing data. * * Analyse means: -* - update @brother/@sister -* - update @access/@return +* - update brother/sister +* - update access/return * - inherit elements * - inherit information * -* @version $Id: PhpdocAnalyser.php,v 1.4 2000/12/03 16:47:14 uw Exp $ +* @version $Id: PhpdocAnalyser.php,v 1.5 2000/12/03 22:37:36 uw Exp $ */ class PhpdocAnalyser extends PhpdocObject { @@ -22,7 +22,7 @@ /** * List of all elements of a certain class/module. * - * The array is used to look up @see references + * The array is used to look up see references * * @var array Format: elementlist[ eltype ][ elname ] = true * @see buildElementlist() @@ -66,17 +66,17 @@ } // end func analyse /** - * Handles @brother and @sister. + * Handles brother and sister. * * @abstract - * @see updateBrotherSister + * @see updateBrotherSisterElements() */ function updateBrothersSisters() { ; } // end func updateBrothersSisters /** - * Updates certain elements that use @brother and @sister. + * Updates certain elements that use brother and sister. * * @return boolean $ok */ @@ -87,8 +87,8 @@ /** * Copies fields from a brother or sister to the current element. * - * @param array Data of the target element that has a @brother/@sister tag - * @param array Data of the element that is referenced by @brother/@sister + * @param array Data of the target element that has a brother/sister tag + * @param array Data of the element that is referenced by brother/sister */ function copyBrotherSisterFields($target, $from) { @@ -101,7 +101,7 @@ } // end func copyBrotherSisterFields /** - * Updates the @access and @return tag values. + * Updates the access and return tag values. * * @see updateAccessReturnElements(), updateAccessElements() * @abstract @@ -111,12 +111,12 @@ } // end func updateAccessReturn /** - * Updates @access and @return for certain elements. + * Updates access and return for certain elements. * * This function should only be used to update functions. * Functions that have the same name as the class (constructors) - * get @return void and @access public. Functions without - * @access get @access public and functions without @return get @return void. + * get return void and access public. Functions without + * access get access public and functions without return get return void. * * @return boolean $ok * @see updateAccessReturn() @@ -127,7 +127,7 @@ } // end func updateAccessReturnElements /** - * Updates @access tags. + * Updates access tags. * * @see updateAccessReturnElements() * @abstract @@ -137,7 +137,7 @@ } // end func updateAccessElements /** - * Compares the @param tags with the function head found. + * Compares the param tags with the function head found. * * @abstract */ @@ -155,7 +155,7 @@ } // end func findUndocumented /** - * Checks all @see references in the given classes/modulegroup. + * Checks all see references in the given classes/modulegroup. * * @abstract */ @@ -164,7 +164,7 @@ } // end func checkSee /** - * Checks @see references in the given elementlist. + * Checks see references in the given elementlist. * * @abstract */ @@ -183,10 +183,10 @@ } // end func buildElementlist /** - * Compares the argument list generated from the function head with the @param tags found. + * Compares the argument list generated from the function head with the param tags found. * * PHPDoc is able to recognize these documentation mistakes: - * - too few or too many @param tags + * - too few or too many param tags * - name does not match or is missing * - type does not match or is missing * - trouble with inherited elements Index: php4/pear/PHPDoc/analyser/PhpdocClassAnalyser.php diff -u php4/pear/PHPDoc/analyser/PhpdocClassAnalyser.php:1.3 php4/pear/PHPDoc/analyser/PhpdocClassAnalyser.php:1.4 --- php4/pear/PHPDoc/analyser/PhpdocClassAnalyser.php:1.3 Sun Dec 3 08:47:14 2000 +++ php4/pear/PHPDoc/analyser/PhpdocClassAnalyser.php Sun Dec 3 14:37:36 2000 @@ -2,30 +2,34 @@ /** * Analyses a class. * -* @version $Id: PhpdocClassAnalyser.php,v 1.3 2000/12/03 16:47:14 uw Exp $ +* @version $Id: PhpdocClassAnalyser.php,v 1.4 2000/12/03 22:37:36 uw Exp $ */ class PhpdocClassAnalyser extends PhpdocAnalyser { /** * Class data. + * * @var array */ var $classes = array(); /** * Name of the baseclass of the given classes. + * * @var string */ var $baseclass = ""; /** * Ordered list of all classes. - * @var string + * + * @var array */ var $classlist = array(); /** * List of not inherited elements. + * * @var array */ var $notinherited = array( @@ -78,6 +82,7 @@ /** * Puuuh - findUndocumented() needs this. + * * @var array * @see findUndocumented() */ @@ -340,6 +345,11 @@ } // end func updateBrothersSisters + /** + * @param string Name of the class to update + * @param string Elementtype: functions, variables, ... + * @return boolean + */ function updateBrotherSisterElements($classname, $type) { if (!isset($this->classes[$classname][$type])) @@ -388,13 +398,13 @@ } // end func updateAccessReturn /** - * Updates @access and @return for certain elements. + * Updates access and return for certain elements. * * This function should only be used to update functions. * Functions that have the same name as the class (constructors) - * get @return void and @access public. Functions without - * @access get @access public and functions without @return get - * @return void. + * get return void and access public. Functions without + * access get access public and functions without return get + * return void. * * @param string Classname * @param string Element type: functions (, variables, consts, uses) @@ -425,7 +435,7 @@ } // end func updateAccessReturnElements /** - * Updates @access tags. + * Updates access tags. * * @param string Classname * @param string Element type: functions, variables, consts (, uses) @@ -470,7 +480,7 @@ } // end func checkSee /** - * Checks @see references in the given element array (functions, variables...) + * Checks see references in the given element array (functions, variables...) * * References to variables and functions within the same class get checked. * It the references element does not exist, the reference gets deleted and @@ -491,7 +501,7 @@ reset($element["see"]["var"]); while (list($k, $variable) = each($element["see"]["var"])) - if (!isset($this->elementlist["variables"][$variable["name"]])) { + if (!isset($this->elementlist["variables"][strtolower($variable["name"])])) { $this->warn->addDocWarning($this->classes[$classname]["filename"], "variables", $elname, "@see referrs to the variable '" . $variable["name"] . "' which is not defined in the class. Entry gets ignored.", "mismatch"); unset($this->classes[$classname][$eltype][$elname]["see"]["var"][$k]); } @@ -502,7 +512,7 @@ reset($element["see"]["function"]); while (list($k, $function) = each($element["see"]["function"])) - if (!isset($this->elementlist["functions"][substr($function["name"], 0, -2)])) { + if (!isset($this->elementlist["functions"][strtolower(substr($function["name"], 0, -2))])) { $this->warn->addDocWarning($this->classes[$classname]["filename"], "functions", $elname, "@see referrs to the function '" . $function["name"] . "' which is not defined in the class. Entry gets ignored.", "mismatch"); unset($this->classes[$classname][$eltype][$elname]["see"]["function"][$k]); } Index: php4/pear/PHPDoc/analyser/PhpdocModuleAnalyser.php diff -u php4/pear/PHPDoc/analyser/PhpdocModuleAnalyser.php:1.3 php4/pear/PHPDoc/analyser/PhpdocModuleAnalyser.php:1.4 --- php4/pear/PHPDoc/analyser/PhpdocModuleAnalyser.php:1.3 Sun Dec 3 08:47:14 2000 +++ php4/pear/PHPDoc/analyser/PhpdocModuleAnalyser.php Sun Dec 3 14:37:36 2000 @@ -2,7 +2,7 @@ /** * Analyses a modulegroup. * -* @version $Id: PhpdocModuleAnalyser.php,v 1.3 2000/12/03 16:47:14 uw Exp $ +* @version $Id: PhpdocModuleAnalyser.php,v 1.4 2000/12/03 22:37:36 uw Exp $ */ class PhpdocModuleAnalyser extends PhpdocAnalyser { @@ -165,6 +165,12 @@ } // end func updateBrothersSisters + /** + * @param string Modulegroupname + * @param string Modulename + * @param string Elementtype: functions, variables. + * @return boolean + */ function updateBrotherSisterElements($group, $modulename, $type) { if (!isset($this->modulegroup[$group][$modulename][$type])) @@ -212,6 +218,12 @@ } // end func updateAccessReturn + /** + * @param string Modulegroup + * @param string Modulename + * @param string Elementtype: functions, variables, consts. + * @return boolean + */ function updateAccessReturnElements($group, $modulename, $type) { if (!isset($this->modulegroup[$group][$modulename][$type])) @@ -230,6 +242,12 @@ } // end func updateAccessReturnElements + /** + * @param string Modulegroup + * @param string Modulename + * @param string Elementtype: functions, variables, consts. + * @return boolean + */ function updateAccessElements($group, $modulename, $type) { if (!isset($this->modulegroup[$group][$modulename][$type])) @@ -273,13 +291,14 @@ } // end func checkSee /** - * Checks @see references in the given element array (functions, variables...) + * Checks see references in the given element array (functions, variables...) * * References to variables and functions within the same module get checked. * It the references element does not exist, the reference gets deleted and * a doc warning gets generated. * * @param array List of functions, variables,... + * @param string Name of the modulegroup that contains the given elements. * @param string Name of the module that contains the given elements. * @param string Elementtype: functions, variables, consts, uses. */ @@ -294,7 +313,7 @@ reset($element["see"]["var"]); while (list($k, $variable) = each($element["see"]["var"])) - if (!isset($this->elementlist["variables"][$variable["name"]])) { + if (!isset($this->elementlist["variables"][strtolower($variable["name"])])) { $this->warn->addDocWarning($this->modulegroup[$modulegroup][$modulename]["filename"], "variables", $elname, "@see referrs to the variable '" . $variable["name"] . "' which is not defined in the class. Entry gets ignored.", "mismatch"); unset($this->modulegroup[$modulegroup][$modulename][$eltype][$elname]["see"]["var"][$k]); } @@ -305,7 +324,7 @@ reset($element["see"]["function"]); while (list($k, $function) = each($element["see"]["function"])) - if (!isset($this->elementlist["functions"][substr($function["name"], 0, -2)])) { + if (!isset($this->elementlist["functions"][strtolower(substr($function["name"], 0, -2))])) { $this->warn->addDocWarning($this->modulegroup[$modulename]["filename"], "functions", $elname, "@see referrs to the function '" . $function["name"] . "' which is not defined in the class. Entry gets ignored.", "mismatch"); unset($this->modulegroup[$modulegroup][$modulename][$eltype][$elname]["see"]["function"][$k]); } Index: php4/pear/PHPDoc/exceptions/PhpdocError.php diff -u php4/pear/PHPDoc/exceptions/PhpdocError.php:1.1 php4/pear/PHPDoc/exceptions/PhpdocError.php:1.2 --- php4/pear/PHPDoc/exceptions/PhpdocError.php:1.1 Sun Oct 8 03:03:18 2000 +++ php4/pear/PHPDoc/exceptions/PhpdocError.php Sun Dec 3 14:37:36 2000 @@ -10,7 +10,7 @@ * The class is widely equal to the PEAR error handling class PEAR_ERROR. * * @author Ulf Wendel <ulf.wendel@phpdoc.de> -* @version 1.0 +* @version $Id: PhpdocError.php,v 1.2 2000/12/03 22:37:36 uw Exp $ * @package PHPDoc */ class PhpdocError { @@ -45,7 +45,7 @@ * Use getMessage() to access it. * * @var string $message - * @see PhpdocError + * @see PhpdocError() */ var $message = ""; @@ -58,7 +58,7 @@ /** * Line number where the error occured. - * @var int $line + * @var integer $line * @see PhpdocError() */ var $line = 0; @@ -76,6 +76,7 @@ /** * Sets the error message, filename and linenumber. + * * @param string Errormessage * @param string Name of the file where the error occured, use __FILE__ for this * @param string Linenumber where the error occured, use __LINE__ for this Index: php4/pear/PHPDoc/filehandler/PhpdocFileHandler.php diff -u php4/pear/PHPDoc/filehandler/PhpdocFileHandler.php:1.1 php4/pear/PHPDoc/filehandler/PhpdocFileHandler.php:1.2 --- php4/pear/PHPDoc/filehandler/PhpdocFileHandler.php:1.1 Sun Oct 8 03:03:19 2000 +++ php4/pear/PHPDoc/filehandler/PhpdocFileHandler.php Sun Dec 3 14:37:36 2000 @@ -2,29 +2,28 @@ /** * File handling functions in phpdoc. * -* @version 0.1alpha +* @version $Id $ * @author Ulf Wendel <ulf@redsys.de> */ class PhpdocFileHandler extends PhpdocObject { /** * Filepath. The path is automatically added in front of all filenames + * * @var string $path * @see setFilePath() - * @access private */ var $path = ""; /** * Reads a list of files or one file. - * @param string $files filename - * @param array $files list of filenames, $k => $filename - * @return array $contents file contents indexed by filename + * + * @param mixed Filename or an array filenames, $k => $filename * @throws PhpdocError * @access public */ - function Get($files) { - if (""==$files) { + function get($files) { + if ("" == $files) { $this->err[] = new PhpdocError("No files specified.", __FILE__, __LINE__); return array("", ""); } @@ -36,14 +35,15 @@ $together = ""; reset($files); - while (list($k, $filename)=each($files)) + while (list($k, $filename) = each($files)) $contents[$filename] = $this->getFile($filename); return $contents; - } // end func Get + } // end func get - /** + /** * Sets the filepath. The path is automatically added in front of all filenames + * * @param string $path * @return bool $ok * @access public @@ -54,13 +54,13 @@ /** * Reads a file. + * * @param string $filename * @return string $content * @throws PhpdocError - * @access private */ function getFile($filename) { - if (""==$filename) { + if ("" == $filename) { $this->err[] = new PhpdocError("getFile(), no filename specified.", __FILE__, __LINE__); return ""; } @@ -75,11 +75,22 @@ $content = fread($fh, filesize($filename)); fclose($fh); + return $content; } // end func getFile - function appendToFile($filename, $content, $directory="") { - if (""==$filename || ""==$content) { + /** + * Appends a string to a file. + * + * @param string Filename + * @param string Content to append + * @param string Directory prefix + * @throw PHPDocError + * @return boolean + * @todo ... add a function boldy. + */ + function appendToFile($filename, $content, $directory = "") { + if ("" == $filename || "" == $content) { $this->err[] = new PhpdocError("No filename and/or no content given.", __FILE__, __LINE__); return false; } @@ -87,7 +98,6 @@ $fh = @fopen($filename, "a"); if (!$fh) { print $filename; - ### PANIK return false; } @@ -102,9 +112,15 @@ * * Create or overrides a file in a specified directory. If the * directory does not exists, it attempts to create it. + * + * @param string + * @param string + * @param string + * @throws PHPDocError + * @return boolean */ - function createFile($filename, $content, $directory="") { - if (""==$filename || ""==$content) { + function createFile($filename, $content, $directory = "") { + if ("" == $filename || "" == $content) { $this->err[] = new PhpdocError("No filename or no content given.", __FILE__, __LINE__); return false; } @@ -123,6 +139,7 @@ /** * Returns a list of files in a specified directory + * * @param string $directory * @param mixed $suffix Suffix of the files returned * @param boolean $flag_subdir include subdirectories? @@ -131,16 +148,16 @@ * @return array $files * @throws PhpdocError */ - function getFilesInDirectory($directory, $suffix="", $flag_subdir = true, $files = "") { - if (""==$directory) { + function getFilesInDirectory($directory, $suffix = "", $flag_subdir = true, $files = "") { + if ("" == $directory) { $this->err[] = new PhpdocError("No directory specified", __FILE__, __LINE__); return array(); } - if ("/"!=substr($directory, -1)) - $directory.= "/"; + if ("/" != substr($directory, -1)) + $directory .= "/"; - if (""==$suffix) + if ("" == $suffix) $flag_all = true; else { @@ -151,8 +168,8 @@ $suffix = array($suffix); reset($suffix); - while (list($k, $v)=each($suffix)) - $allowed[".".$v] = true; + while (list($k, $v) = each($suffix)) + $allowed[".$v"] = true; } @@ -164,6 +181,7 @@ $this->err[] = new PhpdocError("Can't open '$directory' for reading.", __FILE__, __LINE__); return array(); } + while ($file = readdir($dh)) { if ("." == $file || ".." == $file) continue; Index: php4/pear/PHPDoc/indexer/PhpdocIndexer.php diff -u php4/pear/PHPDoc/indexer/PhpdocIndexer.php:1.1 php4/pear/PHPDoc/indexer/PhpdocIndexer.php:1.2 --- php4/pear/PHPDoc/indexer/PhpdocIndexer.php:1.1 Sun Oct 8 03:03:19 2000 +++ php4/pear/PHPDoc/indexer/PhpdocIndexer.php Sun Dec 3 14:37:37 2000 @@ -3,36 +3,41 @@ * Builds Indexlists with the result from the * * @author Ulf Wendel <ulf.wendel@redsys.de> -* @version 0.3alpha +* @version $Id: PhpdocIndexer.php,v 1.2 2000/12/03 22:37:37 uw Exp $ */ class PhpdocIndexer extends PhpdocObject { /** * Array of all packages. - * @var $packages + * + * @var array */ var $packages = array(); /** * Current classtree. + * * @var array */ var $classtree = array(); /** * Current modulegroup. + * * @var array */ var $modulegroup = array(); /** * Array of all elements (functions, variables, constant, included files, classes, packages). - * @var + * + * @var array */ var $elements = array(); /** * Array of fields that get added to the elementlist + * * @var array */ var $elementFields = array("functions", "variables", "consts", "uses"); @@ -115,6 +120,7 @@ ); $data = $this->packages; $this->packages = array(); + return $data; } // end func getPackages @@ -148,12 +154,12 @@ ); reset($this->elementFields); - while (list($k, $field)=each($this->elementFields)) { + while (list($k, $field) = each($this->elementFields)) { if (!isset($elements[$field])) continue; reset($elements[$field]); - while (list($name, $data)=each($elements[$field])) { + while (list($name, $data) = each($elements[$field])) { if ("variables" == $field) { Index: php4/pear/PHPDoc/parser/PhpdocClassParser.php diff -u php4/pear/PHPDoc/parser/PhpdocClassParser.php:1.1 php4/pear/PHPDoc/parser/PhpdocClassParser.php:1.2 --- php4/pear/PHPDoc/parser/PhpdocClassParser.php:1.1 Sun Oct 8 03:03:19 2000 +++ php4/pear/PHPDoc/parser/PhpdocClassParser.php Sun Dec 3 14:37:37 2000 @@ -2,8 +2,7 @@ /** * Parses phpcode to extract classes and their documentation. * -* @version 0.2 -* @author Ulf Wendel, ulf@redsys.de +* @version $Id: PhpdocClassParser.php,v 1.2 2000/12/03 22:37:37 uw Exp $ */ class PhpdocClassParser extends PhpdocFunctionParser { @@ -14,15 +13,14 @@ * See $emptyClass to see the internal structure. * * @var array $classes - * @see emptyClass + * @see $emptyClass */ var $classes = array(); /** * Default values of a class - * @var array $emptyClass - * @see classes, analyseClassParagraph * + * @var array $emptyClass */ var $emptyClass = array ( "name" => "", @@ -32,6 +30,7 @@ /** * Array of tags that are allowed in front of the class keyword + * * @var array $classTags * @see analyseClassParagraph() */ Index: php4/pear/PHPDoc/parser/PhpdocConstantParser.php diff -u php4/pear/PHPDoc/parser/PhpdocConstantParser.php:1.3 php4/pear/PHPDoc/parser/PhpdocConstantParser.php:1.4 --- php4/pear/PHPDoc/parser/PhpdocConstantParser.php:1.3 Sun Dec 3 11:31:30 2000 +++ php4/pear/PHPDoc/parser/PhpdocConstantParser.php Sun Dec 3 14:37:37 2000 @@ -2,8 +2,7 @@ /** * Extracts define statements and their documentation from php code. * -* @author Ulf Wendel <ulf.wendel@redsys.de> -* @version $Id: PhpdocConstantParser.php,v 1.3 2000/12/03 19:31:30 uw Exp $ +* @version $Id: PhpdocConstantParser.php,v 1.4 2000/12/03 22:37:37 uw Exp $ */ class PhpdocConstantParser extends PhpdocUseParser { @@ -19,7 +18,7 @@ ); /** - * Doc Tags allowed with @const[ant] + * Doc Tags allowed with const[ant]. * * @var array */ @@ -72,7 +71,7 @@ } // end func analyseConstant /** - * Compares the data from the parser with the optional @const[ant] tags + * Compares the data from the parser with the optional const[ant] tags * @param array Hash with the data of the current constant paragraph * @return array $constant */ Index: php4/pear/PHPDoc/parser/PhpdocFunctionParser.php diff -u php4/pear/PHPDoc/parser/PhpdocFunctionParser.php:1.1 php4/pear/PHPDoc/parser/PhpdocFunctionParser.php:1.2 --- php4/pear/PHPDoc/parser/PhpdocFunctionParser.php:1.1 Sun Oct 8 03:03:19 2000 +++ php4/pear/PHPDoc/parser/PhpdocFunctionParser.php Sun Dec 3 14:37:37 2000 @@ -1,18 +1,17 @@ <?php /** -* Looks for documented and undocumented functions within a block of php code -* @author Ulf Wendel <ulf@redsys.de> -* @version 0.2 +* Looks for documented and undocumented functions within a block of php code. +* +* @version $Id: PhpdocFunctionParser.php,v 1.2 2000/12/03 22:37:37 uw Exp $ */ class PhpdocFunctionParser extends PhpdocVariableParser { /** * Internal structur of a function. + * * @var array $emptyFunction - * @see functions, analyseFunctionParagraph() */ var $emptyFunction = array( - "name" => "", "undoc" => true, Index: php4/pear/PHPDoc/parser/PhpdocParser.php diff -u php4/pear/PHPDoc/parser/PhpdocParser.php:1.1 php4/pear/PHPDoc/parser/PhpdocParser.php:1.2 --- php4/pear/PHPDoc/parser/PhpdocParser.php:1.1 Sun Oct 8 03:03:19 2000 +++ php4/pear/PHPDoc/parser/PhpdocParser.php Sun Dec 3 14:37:37 2000 @@ -2,7 +2,9 @@ /** * "Main" class of the Parser collection. * -* Note that a lot of communication is done by using shared instance variables. +* Note that a lot of communication is done using shared instance variables. +* +* @version $Id: PhpdocParser.php,v 1.2 2000/12/03 22:37:37 uw Exp $ */ class PhpdocParser extends PhpdocClassParser { @@ -19,7 +21,9 @@ /** * Array of PHP Sourcecode Files to examine. + * * The array keys hold the filenames, the array values the file content. + * * @var array * @see parse() */ @@ -27,14 +31,16 @@ /** * Mapping from classnames to filenames + * * @var array */ var $classnamesToFilenames = array(); /** * Hash with the data of the current class tree (one parentclass with all children). + * * @var array - * @see modules + * @see $modules */ var $classes = array(); @@ -46,43 +52,50 @@ /** * List of all files containing classes. + * * @var array */ var $classfiles = array(); /** * Hash of all class trees. + * * @var array */ var $classtree = array(); /** * List of all files containing modules. + * * @var array */ var $modulefiles = array(); /** * List of all module groups. + * * @var array */ var $modulegroups = array(); /** * Hash with the data of the current module group. + * * @var array - * @see classes + * @see $classes */ var $modules = array(); /** * Hash of all packages found. + * * @var array */ var $packages = array(); /** * Flag indicating that getClassTree() was called. + * * @var boolean * @see getClassTree() */ @@ -90,13 +103,15 @@ /** * Flag indicating that getModulegroup was called. + * * @var boolean - * @see getModulegroup + * @see getModulegroup() */ var $flag_modulegroup = false; /** - * Name of the base class of the current class tree + * Name of the base class of the current class tree. + * * @var string * @see getClassTree() */ @@ -104,6 +119,7 @@ /** * Creates an instance of PhpdocWarning and calls buildComplexRegExps() to initialize the object. + * * @param boolean If true the parser prints status messages. * @see $warn, buildComplexRegExps() */ @@ -132,14 +148,14 @@ */ function preparse() { - if (0==count($this->phpfiles)) { + if (0 == count($this->phpfiles)) { $this->err[] = new PHPDocError("Can't parse - no files defined.", __FILE__, __LINE__); return false; } $para = array(); reset($this->phpfiles); - while (list($filename, $phpcode)=each($this->phpfiles)) + while (list($filename, $phpcode) = each($this->phpfiles)) $para[$filename] = $this->getModulesAndClasses($phpcode); $this->findModulegroups($para); @@ -148,7 +164,6 @@ return true; } // end func preparse - /** * Returns the data of one parentclass and all it's subclasses or false. * @@ -157,7 +172,7 @@ * * @return mixed $classes Hash with the data of the current class tree or false. * @access public - * @see getModulegroup(), %baseclasses + * @see getModulegroup(), $baseclasses */ function getClassTree() { @@ -167,7 +182,7 @@ $this->flag_classtree = true; } - if (list($classname, $filename)=each($this->baseclasses)) { + if (list($classname, $filename) = each($this->baseclasses)) { $this->classes = array(); $this->current_baseclass = $classname; @@ -201,12 +216,12 @@ $this->flag_modulegroup = true; } - if (list($group, $modules)=each($this->modulegroups)) { + if (list($group, $modules) = each($this->modulegroups)) { $this->modules = array(); - while (list($modulename, $files)=each($modules)) { + while (list($modulename, $files) = each($modules)) { reset($files); - while (list($k, $filename)=each($files)) + while (list($k, $filename) = each($files)) $this->addModule($group, $filename); } @@ -275,7 +290,7 @@ // Add some informations from the classtree that was build by the prescan to the class. $fields = array("subclasses", "noparent", "path", "baseclass"); reset($fields); - while (list($k, $field)=each($fields)) + while (list($k, $field) = each($fields)) if (isset($this->classtree[$filename][$classname][$field])) $result[$field] = $this->classtree[$filename][$classname][$field]; @@ -291,6 +306,7 @@ /** * Adds recursively subclasses to the specified class. + * * @param string Name of the class that might contain subclasses * @see addClass() */ @@ -299,7 +315,7 @@ if (isset($this->classes[$classname]["subclasses"])) { $subclasses = $this->classes[$classname]["subclasses"]; - while (list($subclass, $v)=each($subclasses)) + while (list($subclass, $v) = each($subclasses)) $this->addClass($subclass, $this->classnamesToFilenames[$subclass]); } @@ -315,14 +331,14 @@ function findModulegroups($para) { reset($para); - while (list($filename, $data)=each($para)) { + while (list($filename, $data) = each($para)) { if (isset($data["modules"]["name"])) { - $name = (""!=$data["modules"]["name"]) ? $data["modules"]["name"] : $filename; - $group = (""!=$data["modules"]["group"]) ? $data["modules"]["group"] : $name; + $name = ("" != $data["modules"]["name"]) ? $data["modules"]["name"] : $filename; + $group = ("" != $data["modules"]["group"]) ? $data["modules"]["group"] : $name; - if (0!=count($data["classes"])) { + if (0 != count($data["classes"])) { // As we do not have a real parser that returns a parsing tree we can't // handle modules and classes in one file. Drop a note to the user. $this->warn->addDocWarning( $filename, "module", $name, "PHPDoc is confused: module files must not contain classes. Doc will probably be broken, module gets ignored.", "collision" ); @@ -350,7 +366,7 @@ function findClassTrees($para) { reset($para); - while(list($filename, $data)=each($para)) { + while(list($filename, $data) = each($para)) { if (0!=count($data["classes"])) { @@ -393,7 +409,7 @@ if ($flag_noparent) $this->classtree[$filename][$classname]["noparent"] = $flag_noparent; - $base = (0==count($path)) ? true : false; + $base = (0 == count($path)) ? true : false; if ($base) $this->baseclasses[$classname] = $filename; else @@ -407,8 +423,9 @@ /** * Returns the mapping array from classnames to filenames - * @return array $this->classnamesToFilenames - * @see classnamesToFilenames + * + * @return array + * @see $classnamesToFilenames */ function getClassnamesToFilenames() { return $this->classnamesToFilenames; @@ -422,7 +439,7 @@ * @access public */ function setPhpSourcecodeFiles($phpfiles) { - if (!is_array($phpfiles) || 0==count($phpfiles)) + if (!is_array($phpfiles) || 0 == count($phpfiles)) return false; $this->phpfiles = $phpfiles; Index: php4/pear/PHPDoc/parser/PhpdocParserCore.php diff -u php4/pear/PHPDoc/parser/PhpdocParserCore.php:1.2 php4/pear/PHPDoc/parser/PhpdocParserCore.php:1.3 --- php4/pear/PHPDoc/parser/PhpdocParserCore.php:1.2 Sat Dec 2 16:37:59 2000 +++ php4/pear/PHPDoc/parser/PhpdocParserCore.php Sun Dec 3 14:37:37 2000 @@ -5,8 +5,7 @@ * Provides basic parser functions to extract doc comments, analyse tags and variable * declarations. * -* @author Ulf Wendel <ulf@redsys.de> -* @version 0.3 +* @version $Id: PhpdocParserCore.php,v 1.3 2000/12/03 22:37:37 uw Exp $ */ class PhpdocParserCore extends PhpdocParserTags { @@ -555,7 +554,6 @@ * different syntax for arrays. By default function parameters are expected. * @return array $vartype $vartype[0] = type, $vartype[1] = value, $vartype[2] = raw value - * @see */ function getVariableTypeAndValue($code, $flag_args = true) { Index: php4/pear/PHPDoc/parser/PhpdocParserRegExp.php diff -u php4/pear/PHPDoc/parser/PhpdocParserRegExp.php:1.3 php4/pear/PHPDoc/parser/PhpdocParserRegExp.php:1.4 --- php4/pear/PHPDoc/parser/PhpdocParserRegExp.php:1.3 Sun Dec 3 11:31:30 2000 +++ php4/pear/PHPDoc/parser/PhpdocParserRegExp.php Sun Dec 3 14:37:37 2000 @@ -7,8 +7,7 @@ * possible I decided to define all regular expressions in one class. * From a programming point of view there's no need to do so. * -* @author Ulf Wendel <ulf@redsys.de> -* @version $Id: PhpdocParserRegExp.php,v 1.3 2000/12/03 19:31:30 uw Exp $ +* @version $Id: PhpdocParserRegExp.php,v 1.4 2000/12/03 22:37:37 uw Exp $ */ class PhpdocParserRegExp extends PhpdocObject { @@ -97,7 +96,7 @@ * As with $PHP_COMPLEX all complex expressions are build using basic * ones in buildComplexRegExps(). * - * @var array Regular expressions matching @see and optional objectnames. + * @var array Regular expressions matching see and optional objectnames. * @final * @see buildComplexRegexps(), $C_BASE */ Index: php4/pear/PHPDoc/parser/PhpdocParserTags.php diff -u php4/pear/PHPDoc/parser/PhpdocParserTags.php:1.3 php4/pear/PHPDoc/parser/PhpdocParserTags.php:1.4 --- php4/pear/PHPDoc/parser/PhpdocParserTags.php:1.3 Sun Dec 3 11:31:30 2000 +++ php4/pear/PHPDoc/parser/PhpdocParserTags.php Sun Dec 3 14:37:37 2000 @@ -2,7 +2,7 @@ /** * Functions used to parse PHPDoc Tags. * -* @version $Id: PhpdocParserTags.php,v 1.3 2000/12/03 19:31:30 uw Exp $ +* @version $Id: PhpdocParserTags.php,v 1.4 2000/12/03 22:37:37 uw Exp $ */ class PhpdocParserTags extends PhpdocParserRegExp { @@ -556,7 +556,7 @@ } // end func analyseTags /** - * Helperfunction to analyse @see tags + * Helperfunction to analyse see tags * * @param array Array return by preg_match() * @return array $see[0] = error, $see[1] = data @@ -652,8 +652,8 @@ * Find the position of the next phpdoc tag. * * @param string $phpdoc - * @param int $offset - * @return array $t 0 => tag, 1 => offset + * @param integer $offset + * @return array $tag 0 => tag, 1 => offset * @access private * @see findTags() */ Index: php4/pear/PHPDoc/parser/PhpdocVariableParser.php diff -u php4/pear/PHPDoc/parser/PhpdocVariableParser.php:1.2 php4/pear/PHPDoc/parser/PhpdocVariableParser.php:1.3 --- php4/pear/PHPDoc/parser/PhpdocVariableParser.php:1.2 Sun Dec 3 11:31:30 2000 +++ php4/pear/PHPDoc/parser/PhpdocVariableParser.php Sun Dec 3 14:37:37 2000 @@ -2,16 +2,14 @@ /** * Extract class variables and their documentation from phpcode * -* @author Ulf Wendel <ulf@redsys.de> -* @version $Id: PhpdocVariableParser.php,v 1.2 2000/12/03 19:31:30 uw Exp $ +* @version $Id: PhpdocVariableParser.php,v 1.3 2000/12/03 22:37:37 uw Exp $ */ class PhpdocVariableParser extends PhpdocModuleParser { /** * Array with default values of a variable * - * @var array $emptyVariable - * @see variables, analyseVariableParagraph() + * @var array $emptyVariable */ var $emptyVariable = array( "name" => "", @@ -84,7 +82,7 @@ } // end func analyseVariables /** - * Compares the @var tag informations with the analyse of the source code. + * Compares the var tag informations with the analyse of the source code. * * @param array $variable * @return array $variable Index: php4/pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php diff -u php4/pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php:1.3 php4/pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php:1.4 --- php4/pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php:1.3 Sun Dec 3 06:36:01 2000 +++ php4/pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php Sun Dec 3 14:37:37 2000 @@ -1,6 +1,8 @@ <?php /** * Renders classes. +* +* @version $Id: PhpdocHTMLClassRenderer.php,v 1.4 2000/12/03 22:37:37 uw Exp $ */ class PhpdocHTMLClassRenderer extends PhpdocHTMLDocumentRenderer { @@ -24,6 +26,7 @@ * @param string XML file path * @param string Template file path * @param string Name of the current application + * @param string Filename extension * @see setPath(), setTemplateRoot() */ function PhpdocHTMLClassRenderer($path, $templateRoot, $application, $extension = ".html") { @@ -40,7 +43,8 @@ } // end constructor /** - * Renders a class + * Renders a class. + * * @param string XML source file * @param string Name of the HTML target file. * @access public @@ -150,7 +154,10 @@ /** * Renders a list of a certain inherited element. * - * @see renderInheritedElements() + * @param array List of inherited elements. + * @param string Templateblockname + * @param string Element type: function, variable... + * @see renderInherited() */ function renderInheritedElements($inherited, $block, $type) { Index: php4/pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php diff -u php4/pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php:1.3 php4/pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php:1.4 --- php4/pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php:1.3 Sun Dec 3 06:36:01 2000 +++ php4/pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php Sun Dec 3 14:37:37 2000 @@ -1,6 +1,8 @@ <?php /** * Provides functioninality to render modules and classes. +* +* @version $Id: PhpdocHTMLDocumentRenderer.php,v 1.4 2000/12/03 22:37:37 uw Exp $ */ class PhpdocHTMLDocumentRenderer extends PhpdocHTMLRenderer { @@ -10,7 +12,7 @@ * @var string $undocumented * @access public */ - var $undocmented = "Warning: documentation is missing."; + var $undocumented = "Warning: documentation is missing."; /** * Array of functions found in the xml document. @@ -28,6 +30,7 @@ /** * Array of constants. + * * @var array $constants */ var $constants = array(); @@ -54,7 +57,7 @@ ); /** - * Known types for @include. + * Types of include statements. * * @var array $usesTypes * @see renderUses() @@ -193,7 +196,7 @@ } // end func renderUses /** - * Adds a detailed list of all @included files to the template. + * Adds a detailed list of all included files to the template. * * The function assumes that there is a block names "usesdetail" and within the block * a block names "usesdetail_loop" in the template. @@ -237,7 +240,7 @@ } // end func renderUsesDetail /** - * Adds a summary of all @included files to the template. + * Adds a summary of all included files to the template. * * The function assumes that there is a block names "usessummary" and within * the block another block names "usessummary_loop" in the template. @@ -455,6 +458,7 @@ /** * Converts the XML parameter array into formatted string. + * * @param array XML parameter array * @return string Formatted parameter string */ @@ -504,7 +508,7 @@ } // end func getParameter /** - * Renders a block with references to other source elements, @see. + * Renders a block with references to other source elements. * * @param array XML references array * @param string optional template blockname prefix @@ -561,7 +565,7 @@ } // end func renderSee /** - * Renders an author list, @author. + * Renders an author list. * * @param array XML author array * @param string optional template blockname prefix @@ -599,7 +603,7 @@ } // end func renderAuthors /** - * Renders a list of external links, @link. + * Renders a list of external links. * * @param array XML link array * @param string optional template blockname prefix @@ -634,7 +638,7 @@ } // end func renderLinks /** - * Renders a list of exceptions, @throws. + * Renders a list of exceptions. * * @param array XML array * @param string optional template blockname prefix @@ -663,7 +667,7 @@ } // end func renderThrows /** - * Renders a list of global elements, @global + * Renders a list of global elements. * * @param array XML globals array * @param string optional template blockname prefix Index: php4/pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php diff -u php4/pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.3 php4/pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.4 --- php4/pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.3 Sun Dec 3 06:36:01 2000 +++ php4/pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php Sun Dec 3 14:37:37 2000 @@ -48,6 +48,7 @@ * @param string XML file path * @param string Template file path * @param string Name of the application + * @param string Filename extension * @see setPath(), setTemplateRoot() */ function PhpdocHTMLIndexRenderer($path, $templateRoot, $application, $extension = ".html") { Index: php4/pear/PHPDoc/renderer/html/PhpdocHTMLModuleRenderer.php diff -u php4/pear/PHPDoc/renderer/html/PhpdocHTMLModuleRenderer.php:1.3 php4/pear/PHPDoc/renderer/html/PhpdocHTMLModuleRenderer.php:1.4 --- php4/pear/PHPDoc/renderer/html/PhpdocHTMLModuleRenderer.php:1.3 Sun Dec 3 06:36:01 2000 +++ php4/pear/PHPDoc/renderer/html/PhpdocHTMLModuleRenderer.php Sun Dec 3 14:37:37 2000 @@ -1,6 +1,8 @@ <?php /** * Renders modules. +* +* @version $Id: PhpdocHTMLModuleRenderer.php,v 1.4 2000/12/03 22:37:37 uw Exp $ */ class PhpdocHTMLModuleRenderer extends PhpdocHTMLDocumentRenderer { @@ -10,6 +12,7 @@ * @param string XML file path * @param string Template file path * @param string Name of the current application + * @param string Filename extension * @see setPath(), setTemplateRoot() */ function PhpdocHTMLModuleRenderer($path, $templateRoot, $application, $extension = ".html") { Index: php4/pear/PHPDoc/renderer/html/PhpdocHTMLWarningRenderer.php diff -u php4/pear/PHPDoc/renderer/html/PhpdocHTMLWarningRenderer.php:1.3 php4/pear/PHPDoc/renderer/html/PhpdocHTMLWarningRenderer.php:1.4 --- php4/pear/PHPDoc/renderer/html/PhpdocHTMLWarningRenderer.php:1.3 Sun Dec 3 06:36:01 2000 +++ php4/pear/PHPDoc/renderer/html/PhpdocHTMLWarningRenderer.php Sun Dec 3 14:37:37 2000 @@ -10,6 +10,7 @@ * @param string XML file path * @param string Template file path * @param string Name of the application + * @param string Filename extension * @see setPath(), setTemplateRoot() */ function PhpdocHTMLWarningRenderer($path, $templateRoot, $application, $extension = ".html") { Index: php4/pear/PHPDoc/warning/PhpdocWarning.php diff -u php4/pear/PHPDoc/warning/PhpdocWarning.php:1.1 php4/pear/PHPDoc/warning/PhpdocWarning.php:1.2 --- php4/pear/PHPDoc/warning/PhpdocWarning.php:1.1 Sun Oct 8 03:03:20 2000 +++ php4/pear/PHPDoc/warning/PhpdocWarning.php Sun Dec 3 14:37:38 2000 @@ -4,6 +4,8 @@ * * The base of the report generator module is this container. It's currently * pretty simple and will change later on... +* +* @version $Id: PhpdocWarning.php,v 1.2 2000/12/03 22:37:38 uw Exp $ */ class PhpdocWarning extends PhpdocObject { @@ -15,7 +17,7 @@ /** * Counter containing the number of documentation warnings. - * @var int + * @var integer * @see getNumDocWarnings(), getNumWarnings() */ var $num_doc_warnings = 0; @@ -26,7 +28,7 @@ * @param string Kind of the element that caused the error: module, class, function, variable, use, const * @param string Name of the class/function/... that caused the warning * @param string Warning message itself - * @para, string Type of the error: missing, mismatch, syntax, ... + * @param string Type of the error: missing, mismatch, syntax, ... * @access public * @see addDocWarning() */ Index: php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php diff -u php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.1 php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.2 --- php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.1 Sun Oct 8 03:03:21 2000 +++ php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php Sun Dec 3 14:37:38 2000 @@ -2,18 +2,13 @@ /** * Exports the data of a class as an xml file. * -* @author Ulf Wendel <ulf.wendel@phpdoc.de> -* @version 1.0 +* @version $Id: PhpdocXMLClassExporter.php,v 1.2 2000/12/03 22:37:38 uw Exp $ */ class PhpdocXMLClassExporter extends PhpdocXMLDocumentExporter { - function PhpdocXMLClassExporter() { - $this->PHPDocXMLExporter(); - } // end constructor - /** * Variable container attributes. - * @var array $variableAttriutes + * @var array $variableAttributes */ var $variableAttributes = array( "name" => "CDATA", @@ -40,6 +35,10 @@ var $fileprefix = "class_"; + function PhpdocXMLClassExporter() { + $this->PHPDocXMLExporter(); + } // end constructor + function create() { $attribs = $this->getAttributes($this->result, $this->classAttributes); @@ -89,16 +88,16 @@ function inheritedOverridenXML($data, $tag) { reset($data); - while (list($type, $elements)=each($data)) { + while (list($type, $elements) = each($data)) { reset($elements); - while (list($from, $data2)=each($elements)) { + while (list($from, $data2) = each($elements)) { $attribs = $this->getAttributes( array ("type" => $type, "src" => $from), $this->inheritedOverridenAttributes); $this->xmlwriter->startElement($tag, "", $attribs, false); reset($data2); - while (list($name, $v)=each($data2)) + while (list($name, $v) = each($data2)) $this->xmlwriter->addElement("element", $name); $this->xmlwriter->endElement($tag, true); @@ -111,16 +110,17 @@ /** * Writes the "path" (inheritance chain) of an element. + * * @param array */ function pathXML($path) { - if (0==count($path)) + if (0 == count($path)) return; $this->xmlwriter->startElement("path", "", "", false); reset($path); - while (list($k, $parent)=each($path)) + while (list($k, $parent) = each($path)) $this->xmlwriter->addElement("parent", $parent); $this->xmlwriter->endElement("path", true); @@ -129,27 +129,29 @@ /** * Adds a baseclass container to the generated xml. + * * @param string Name of the baseclass */ function baseclassXML($base) { - if (""!=$base) + if ("" != $base) $this->xmlwriter->addElement("baseclass", $base); } // end func baseclassXML /** * Adds a list of subclasses to the generated xml. + * * @param array */ function subclassesXML($subclasses) { - if (0==count($subclasses)) + if (0 == count($subclasses)) return; $this->xmlwriter->startElement("subclasses", "", "", false, true); reset($subclasses); - while(list($subclass, $v)=each($subclasses)) + while(list($subclass, $v) = each($subclasses)) $this->xmlwriter->addElement("subclass", $subclass); $this->xmlwriter->endElement("subclasses", true); @@ -157,12 +159,14 @@ } // end func subclassesXML /** - * Writes class variables to + * Adds class variables to the XMl document. + * + * @param array */ function variablesXML($variables) { reset($variables); - while (list($variable, $data)=each($variables)) { + while (list($variable, $data) = each($variables)) { $attribs = $this->getAttributes($data, $this->variableAttributes); $this->xmlwriter->startElement("variable", $data["value"], $attribs, false); Index: php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php diff -u php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php:1.1 php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php:1.2 --- php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php:1.1 Sun Oct 8 03:03:21 2000 +++ php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php Sun Dec 3 14:37:38 2000 @@ -1,11 +1,14 @@ <?php /** * Base of the class and module exporter. +* +* @version $Id: PhpdocXMLDocumentExporter.php,v 1.2 2000/12/03 22:37:38 uw Exp $ */ class PhpdocXMLDocumentExporter extends PhpdocXMLExporter { /** * Mapping from internal result array index name to xml tag name. + * * @var array $docTags */ var $docTags = array( @@ -24,6 +27,7 @@ /** * Attributes of the <see> container. + * * @var array $seeAttributes */ var $seeAttributes = array( @@ -33,18 +37,21 @@ /** * Attributes of the <link> container. + * * @var array $linkAttributes */ var $linkAttributes = array( "url" => "CDATA" ); /** * Attributes of the <author> container. + * * @var array $authorAttributes */ var $authorAttributes = array( "email" => "CDATA" ); /** * Attributes of <inherited> and <overriden> container. + * * @var array $inheritedOverridenAttributes */ var $inheritedOverridenAttributes = array( @@ -54,6 +61,7 @@ /** * Attributes of the <constant> container. + * * @var array $constAttributes */ var $constAttributes = array( @@ -65,6 +73,7 @@ /** * Attribues of the <uses> container. + * * @var array $usesAttributes */ var $usesAttributes = array( @@ -75,6 +84,7 @@ /** * Attribues of the <function> container. + * * @var array $functionAttributes */ var $functionAttributes = array( @@ -87,7 +97,8 @@ /** * Attributes of the <return> container. - * @var array $returnAttribues + * + * @var array $returnAttributes */ var $returnAttributes = array( "name" => "CDATA", @@ -96,6 +107,7 @@ /** * Attributes of the <global> container. + * * @var array $globalAttributes */ var $globalAttributes = array( @@ -105,6 +117,7 @@ /** * Attributes of the <param> container. + * * @var array $paramAttributes */ var $paramAttributes = array( @@ -116,6 +129,7 @@ /** * Writes a <file> container. + * * @param string $file filename */ function filenameXML($file) { @@ -123,12 +137,13 @@ } // end func filenameXML /** - * Adds all constants (define(), @const) to the xml document. + * Adds all constants (define(), const) to the xml document. + * * @param array Array of constants * @return boolean Returns false on failure otherwise true */ function constsXML($consts) { - if (!is_array($consts) || 0==count($consts)) + if (!is_array($consts) || 0 == count($consts)) return true; reset($consts); @@ -144,6 +159,11 @@ return true; } // end func constsXML + /** + * Adds a list of used files (include, require...) to the xml document. + * + * @param array + */ function usesXML($uses) { if (!is_array($uses)) { $this->err[] = new PhpdocError("No array given.", __FILE__, __LINE__); @@ -151,7 +171,7 @@ } reset($uses); - while (list($k, $data)=each($uses)) { + while (list($k, $data) = each($uses)) { $attribs = $this->getAttributes($data, $this->usesAttributes); $this->xmlwriter->startElement("uses", "", $attribs, false, true); @@ -163,14 +183,19 @@ return true; } // end func usesXML + /** + * Adds a list of functions to the xml file. + * + * @param array + */ function functionsXML($functions) { if (!is_array($functions)) { $this->err[] = new PhpdocError("No array given.", __FILE__, __LINE__); return false; } -#$this->introspection("functions", $functions); + reset($functions); - while (list($k, $data)=each($functions)) { + while (list($k, $data) = each($functions)) { $attribs = $this->getAttributes($data, $this->functionAttributes); $this->xmlwriter->startElement("function", "", $attribs, false, true); @@ -181,6 +206,11 @@ } // end functionsXML + /** + * Adds a documentation block (author, links, see, params...) to the xml document + * + * @param array + */ function docXML($data) { $this->xmlwriter->startElement("doc", "", "", false, true); @@ -229,31 +259,46 @@ } reset($this->docTags); - while (list($field, $tag)=each($this->docTags)) + while (list($field, $tag) = each($this->docTags)) if (isset($data[$field])) $this->xmlwriter->addElement($tag, $data[$field], ""); $this->xmlwriter->endElement("doc", true); } // end func docXML + /** + * Adds <global> container to the xml document. + * + * @param array + */ function globalsXML($globals) { reset($globals); - while (list($k, $data)=each($globals)) { + while (list($k, $data) = each($globals)) { $attribs = $this->getAttributes($data, $this->globalAttributes); $this->xmlwriter->addElement("global", (isset($data["desc"])) ? $data["desc"] : "", $attribs); } } // end func globalsXML + /** + * Adds <throws> container to the xml document. + * + * @param array + */ function throwsXML($exceptions) { reset($exceptions); - while (list($k, $exception)=each($exceptions)) + while (list($k, $exception) = each($exceptions)) $this->xmlwriter->addElement("throws", $exception, "", true); } // end func throwsXML + /** + * Adds <return> container to the xml document. + * + * @param array + */ function returnXML($return) { $desc = ""; @@ -276,20 +321,30 @@ } // end func returnXML + /** + * Adds <parameter> container to the xml document. + * + * @param array + */ function paramsXML($params) { reset($params); - while (list($k, $data)=each($params)) { + while (list($k, $data) = each($params)) { $attribs = $this->getAttributes($data, $this->paramAttributes); $this->xmlwriter->addElement("parameter", (isset($data["desc"])) ? $data["desc"] : "", $attribs); } } // end func paramsXML + /** + * Adds <author> container to the xml document. + * + * @param array + */ function authorXML($authors) { reset($authors); - while (list($k, $data)=each($authors)) { + while (list($k, $data) = each($authors)) { $attribs = array(); @@ -306,10 +361,15 @@ } // end func authorXML + /** + * Adds <link> container to the xml document. + * + * @param array + */ function linkXML($links) { reset($links); - while (list($k, $data)=each($links)) { + while (list($k, $data) = each($links)) { $attribs = array( "url" => array( @@ -323,13 +383,18 @@ } // end func linkXML + /** + * Adds <see> container to the xml document. + * + * @param array + */ function seeXML($see) { reset($see); - while (list($type, $data)=each($see)) { + while (list($type, $data) = each($see)) { reset($data); - while (list($k, $data2)=each($data)) { + while (list($k, $data2) = each($data)) { $attribs = array( "type" => array( Index: php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php diff -u php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php:1.1 php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php:1.2 --- php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php:1.1 Sun Oct 8 03:03:21 2000 +++ php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php Sun Dec 3 14:37:38 2000 @@ -1,8 +1,8 @@ <?php /** * Exporter used to export phpdoc internals data structures as xml documents. -* @author Ulf Wendel <ulf.wendel@phpdoc.de> -* @version 1.0 +* +* @version $Id: PhpdocXMLExporter.php,v 1.2 2000/12/03 22:37:38 uw Exp $ */ class PhpdocXMLExporter extends PhpdocObject { @@ -72,7 +72,7 @@ */ function export($result, $xmlfile="") { - if (0==count($result)) + if (0 == count($result)) return; $this->result = $result; @@ -84,7 +84,7 @@ $this->xmlwriter->endElement("phpdoc", true); - if (""==$xmlfile) + if ("" == $xmlfile) $xmlfile = $this->result["name"]; /* @@ -105,6 +105,9 @@ } // end func export + /** + * @param array + */ function setResult($result) { $this->result = $result; $this->create(); Index: php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php diff -u php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php:1.1 php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php:1.2 --- php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php:1.1 Sun Oct 8 03:03:21 2000 +++ php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php Sun Dec 3 14:37:38 2000 @@ -1,17 +1,21 @@ <?php /** -* Creates XML index files +* Creates XML index files. +* +* @version $Id: PhpdocXMLIndexExporter.php,v 1.2 2000/12/03 22:37:38 uw Exp $ */ class PhpdocXMLIndexExporter extends PhpdocXMLExporter { /** * Chapter tag attributes + * * @var array */ var $chapterAttributes = array( "name" => "CDATA" ); /** * Element tag attributes. + * * @var array() */ var $elementAttributes = array( @@ -40,7 +44,7 @@ $this->xmlwriter->startElement("phpdoc"); reset($modulegroup); - list($group, $modules)=each($modulegroup); + list($group, $modules) = each($modulegroup); $attribs = array( "name" => array( "type" => "CDATA", "value" => $group) ); $this->xmlwriter->startElement("modulegroup", "", $attribs); @@ -78,10 +82,10 @@ $this->xmlwriter->startElement("package", "", $attribs); reset($elementlist); - while (list($type, $elements)=each($elementlist)) { + while (list($type, $elements) = each($elementlist)) { - $container = ("classes"==$type) ? "class" : "module"; - while (list($k, $element)=each($elements)) { + $container = ("classes" == $type) ? "class" : "module"; + while (list($k, $element) = each($elements)) { $attribs = array( "name" => array("type" => "CDATA", "value" => $element)); $this->xmlwriter->addElement($container, "", $attribs); @@ -104,7 +108,8 @@ /** * Exports a classtree * - * @param array + * @param array Classtree + * @param string Name of the baseclass of the classtree * @access public */ function exportClasstree(&$classtree, $baseclass) { @@ -118,13 +123,13 @@ $this->xmlwriter->startElement("classtree", "", $attribs); reset($classtree); - while (list($parentclass, $subclasses)=each($classtree)) { + while (list($parentclass, $subclasses) = each($classtree)) { $attribs = array("name" => array("type" => "CDATA", "value" => $parentclass)); $this->xmlwriter->startElement("class", "", $attribs); reset($subclasses); - while (list($subclass, $v)=each($subclasses)) + while (list($subclass, $v) = each($subclasses)) $this->xmlwriter->addElement("subclass", $subclass); $this->xmlwriter->endElement("class"); @@ -135,7 +140,7 @@ $this->xmlwriter->endElement("phpdoc"); $baseclass = $this->nameToURL($baseclass); - $this->xmlwriter->export($this->path."classtree_$baseclass.xml"); + $this->xmlwriter->export($this->path . "classtree_$baseclass.xml"); $this->xmlwriter->free(); } // end func exportClasstree @@ -155,16 +160,16 @@ $this->xmlwriter->startElement("index"); reset($elementlist); - while (list($index, $elements)=each($elementlist)) { + while (list($index, $elements) = each($elementlist)) { $attrib = array( "char" => array( "type" => "CDATA", "value" => $index ) ); $this->xmlwriter->startElement("chapter", "", $attrib); reset($elements); - while (list($name, $element)=each($elements)) { + while (list($name, $element) = each($elements)) { reset($element); - while (list($k, $eldata)=each($element)) { + while (list($k, $eldata) = each($element)) { $attribs = $this->getAttributes($eldata, $this->elementAttributes); $attribs["name"] = array( "type" => "CDATA", "value" => $name ); $this->xmlwriter->addElement("element", $eldata["sdesc"], $attribs); Index: php4/pear/PHPDoc/xmlreader/PhpdocXMLReader.php diff -u php4/pear/PHPDoc/xmlreader/PhpdocXMLReader.php:1.1 php4/pear/PHPDoc/xmlreader/PhpdocXMLReader.php:1.2 --- php4/pear/PHPDoc/xmlreader/PhpdocXMLReader.php:1.1 Sun Oct 8 03:03:21 2000 +++ php4/pear/PHPDoc/xmlreader/PhpdocXMLReader.php Sun Dec 3 14:37:38 2000 @@ -2,12 +2,13 @@ /** * Reads XML documents into a multi dimensional Array. * -* @author Ulf Wendel <ulf.wendel@phpdoc.de> +* @version $Id: PhpdocXMLReader.php,v 1.2 2000/12/03 22:37:38 uw Exp $ */ class PhpdocXMLReader extends PhpdocObject { /** * PHPDocFileHandler object. + * * @var object PhpdocFileHandler * @see createFileHandler() */ @@ -15,6 +16,7 @@ /** * Values array from xml_parse_into_struct(). + * * @var array * @see parse(), stripCloseFromStructvalues(), importXML() */ @@ -64,6 +66,7 @@ /** * Creates a PhpdocFileHandler object and saves it to $filehandler if it does not already exist. + * * @see $filehandler */ function createFilehandler() { @@ -83,8 +86,8 @@ $values = array(); reset($this->structvalues); - while (list($k, $v)=each($this->structvalues)) - if ("close"!=$v["type"]) + while (list($k, $v) = each($this->structvalues)) + if ("close" != $v["type"]) $values[] = $v; $this->structvalues = $values; @@ -99,8 +102,8 @@ * - no XML DOM * - no eval(), this can't be optimized by the compiler * - * @param int - * @param int + * @param integer + * @param integer * @return array $data[0] = daten, $data[1] = some index value used for the recursion * @see addToArray() */ @@ -151,7 +154,7 @@ * @param array * @return array $target */ - function addToArray($target, $key, $value="", $attributes = "", $inner="") { + function addToArray($target, $key, $value="", $attributes = "", $inner = "") { if (!isset($target[$key]["value"]) && !isset($target[$key][0])) { @@ -160,7 +163,7 @@ if (""!=$attributes) { reset($attributes); - while (list($k, $v)=each($attributes)) + while (list($k, $v) = each($attributes)) $target[$key][$k] = $this->xmldecode($v); } @@ -174,10 +177,10 @@ $target[$key] = array(); $target[$key][0] = $oldvalue; - if (""!=$inner) + if ("" != $inner) $target[$key][1] = $inner; - if (""!=$attributes) { + if ("" != $attributes) { reset($attributes); while (list($k, $v)=each($attributes)) $target[$key][1][$k] = $this->xmldecode($v); @@ -189,12 +192,12 @@ $index = count($target[$key]); - if (""!=$inner) + if ("" != $inner) $target[$key][$index] = $inner; if (""!=$attributes) { reset($attributes); - while (list($k, $v)=each($attributes)) + while (list($k, $v) = each($attributes)) $target[$key][$index][$k] = $this->xmldecode($v); } @@ -207,6 +210,12 @@ return $target; } // end func addToArray + /** + * Replaces some basic entities with their character counterparts. + * + * @param string String to decode + * @return string Decoded string + */ function xmldecode($value) { #return preg_replace( array("@<@", "@>@", "@'@", "@"@", "@&@"), array("<", ">", "'", '"', "&"), $value); return utf8_decode(preg_replace( array("@<@", "@>@", "@'@", "@"@", "@&@"), array("<", ">", "'", '"', "&"), $value)); Index: php4/pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php diff -u php4/pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php:1.2 php4/pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php:1.3 --- php4/pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php:1.2 Sun Dec 3 12:30:42 2000 +++ php4/pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php Sun Dec 3 14:37:39 2000 @@ -7,7 +7,7 @@ * functions to handle attributes and hides file handling tasks. * * @author Ulf Wendel <ulf.wendel@phpdoc.de> -* @version $Id: PhpdocXMLWriter.php,v 1.2 2000/12/03 20:30:42 uw Exp $ +* @version $Id: PhpdocXMLWriter.php,v 1.3 2000/12/03 22:37:39 uw Exp $ */ class PhpdocXMLWriter extends PhpdocObject { @@ -29,7 +29,7 @@ * Filehandler used for IO operations * * @var object PhpdocFilehandler - * @see PhpdocXMLWriter + * @see PhpdocXMLWriter() */ var $fileHandler;
Index: php4/pear/PHPDoc/analyser/PhpdocAnalyser.php diff -u php4/pear/PHPDoc/analyser/PhpdocAnalyser.php:1.4 php4/pear/PHPDoc/analyser/PhpdocAnalyser.php:1.5 --- php4/pear/PHPDoc/analyser/PhpdocAnalyser.php:1.4 Sun Dec 3 08:47:14 2000 +++ php4/pear/PHPDoc/analyser/PhpdocAnalyser.php Sun Dec 3 14:37:36 2000 @@ -3,12 +3,12 @@ * Analyses parsing data. * * Analyse means: -* - update @brother/@sister -* - update @access/@return +* - update brother/sister +* - update access/return * - inherit elements * - inherit information * -* @version $Id: PhpdocAnalyser.php,v 1.4 2000/12/03 16:47:14 uw Exp $ +* @version $Id: PhpdocAnalyser.php,v 1.5 2000/12/03 22:37:36 uw Exp $ */ class PhpdocAnalyser extends PhpdocObject { @@ -22,7 +22,7 @@ /** * List of all elements of a certain class/module. * - * The array is used to look up @see references + * The array is used to look up see references * * @var array Format: elementlist[ eltype ][ elname ] = true * @see buildElementlist() @@ -66,17 +66,17 @@ } // end func analyse /** - * Handles @brother and @sister. + * Handles brother and sister. * * @abstract - * @see updateBrotherSister + * @see updateBrotherSisterElements() */ function updateBrothersSisters() { ; } // end func updateBrothersSisters /** - * Updates certain elements that use @brother and @sister. + * Updates certain elements that use brother and sister. * * @return boolean $ok */ @@ -87,8 +87,8 @@ /** * Copies fields from a brother or sister to the current element. * - * @param array Data of the target element that has a @brother/@sister tag - * @param array Data of the element that is referenced by @brother/@sister + * @param array Data of the target element that has a brother/sister tag + * @param array Data of the element that is referenced by brother/sister */ function copyBrotherSisterFields($target, $from) { @@ -101,7 +101,7 @@ } // end func copyBrotherSisterFields /** - * Updates the @access and @return tag values. + * Updates the access and return tag values. * * @see updateAccessReturnElements(), updateAccessElements() * @abstract @@ -111,12 +111,12 @@ } // end func updateAccessReturn /** - * Updates @access and @return for certain elements. + * Updates access and return for certain elements. * * This function should only be used to update functions. * Functions that have the same name as the class (constructors) - * get @return void and @access public. Functions without - * @access get @access public and functions without @return get @return void. + * get return void and access public. Functions without + * access get access public and functions without return get return void. * * @return boolean $ok * @see updateAccessReturn() @@ -127,7 +127,7 @@ } // end func updateAccessReturnElements /** - * Updates @access tags. + * Updates access tags. * * @see updateAccessReturnElements() * @abstract @@ -137,7 +137,7 @@ } // end func updateAccessElements /** - * Compares the @param tags with the function head found. + * Compares the param tags with the function head found. * * @abstract */ @@ -155,7 +155,7 @@ } // end func findUndocumented /** - * Checks all @see references in the given classes/modulegroup. + * Checks all see references in the given classes/modulegroup. * * @abstract */ @@ -164,7 +164,7 @@ } // end func checkSee /** - * Checks @see references in the given elementlist. + * Checks see references in the given elementlist. * * @abstract */ @@ -183,10 +183,10 @@ } // end func buildElementlist /** - * Compares the argument list generated from the function head with the @param tags found. + * Compares the argument list generated from the function head with the param tags found. * * PHPDoc is able to recognize these documentation mistakes: - * - too few or too many @param tags + * - too few or too many param tags * - name does not match or is missing * - type does not match or is missing * - trouble with inherited elements Index: php4/pear/PHPDoc/analyser/PhpdocClassAnalyser.php diff -u php4/pear/PHPDoc/analyser/PhpdocClassAnalyser.php:1.3 php4/pear/PHPDoc/analyser/PhpdocClassAnalyser.php:1.4 --- php4/pear/PHPDoc/analyser/PhpdocClassAnalyser.php:1.3 Sun Dec 3 08:47:14 2000 +++ php4/pear/PHPDoc/analyser/PhpdocClassAnalyser.php Sun Dec 3 14:37:36 2000 @@ -2,30 +2,34 @@ /** * Analyses a class. * -* @version $Id: PhpdocClassAnalyser.php,v 1.3 2000/12/03 16:47:14 uw Exp $ +* @version $Id: PhpdocClassAnalyser.php,v 1.4 2000/12/03 22:37:36 uw Exp $ */ class PhpdocClassAnalyser extends PhpdocAnalyser { /** * Class data. + * * @var array */ var $classes = array(); /** * Name of the baseclass of the given classes. + * * @var string */ var $baseclass = ""; /** * Ordered list of all classes. - * @var string + * + * @var array */ var $classlist = array(); /** * List of not inherited elements. + * * @var array */ var $notinherited = array( @@ -78,6 +82,7 @@ /** * Puuuh - findUndocumented() needs this. + * * @var array * @see findUndocumented() */ @@ -340,6 +345,11 @@ } // end func updateBrothersSisters + /** + * @param string Name of the class to update + * @param string Elementtype: functions, variables, ... + * @return boolean + */ function updateBrotherSisterElements($classname, $type) { if (!isset($this->classes[$classname][$type])) @@ -388,13 +398,13 @@ } // end func updateAccessReturn /** - * Updates @access and @return for certain elements. + * Updates access and return for certain elements. * * This function should only be used to update functions. * Functions that have the same name as the class (constructors) - * get @return void and @access public. Functions without - * @access get @access public and functions without @return get - * @return void. + * get return void and access public. Functions without + * access get access public and functions without return get + * return void. * * @param string Classname * @param string Element type: functions (, variables, consts, uses) @@ -425,7 +435,7 @@ } // end func updateAccessReturnElements /** - * Updates @access tags. + * Updates access tags. * * @param string Classname * @param string Element type: functions, variables, consts (, uses) @@ -470,7 +480,7 @@ } // end func checkSee /** - * Checks @see references in the given element array (functions, variables...) + * Checks see references in the given element array (functions, variables...) * * References to variables and functions within the same class get checked. * It the references element does not exist, the reference gets deleted and @@ -491,7 +501,7 @@ reset($element["see"]["var"]); while (list($k, $variable) = each($element["see"]["var"])) - if (!isset($this->elementlist["variables"][$variable["name"]])) { + if (!isset($this->elementlist["variables"][strtolower($variable["name"])])) { $this->warn->addDocWarning($this->classes[$classname]["filename"], "variables", $elname, "@see referrs to the variable '" . $variable["name"] . "' which is not defined in the class. Entry gets ignored.", "mismatch"); unset($this->classes[$classname][$eltype][$elname]["see"]["var"][$k]); } @@ -502,7 +512,7 @@ reset($element["see"]["function"]); while (list($k, $function) = each($element["see"]["function"])) - if (!isset($this->elementlist["functions"][substr($function["name"], 0, -2)])) { + if (!isset($this->elementlist["functions"][strtolower(substr($function["name"], 0, -2))])) { $this->warn->addDocWarning($this->classes[$classname]["filename"], "functions", $elname, "@see referrs to the function '" . $function["name"] . "' which is not defined in the class. Entry gets ignored.", "mismatch"); unset($this->classes[$classname][$eltype][$elname]["see"]["function"][$k]); } Index: php4/pear/PHPDoc/analyser/PhpdocModuleAnalyser.php diff -u php4/pear/PHPDoc/analyser/PhpdocModuleAnalyser.php:1.3 php4/pear/PHPDoc/analyser/PhpdocModuleAnalyser.php:1.4 --- php4/pear/PHPDoc/analyser/PhpdocModuleAnalyser.php:1.3 Sun Dec 3 08:47:14 2000 +++ php4/pear/PHPDoc/analyser/PhpdocModuleAnalyser.php Sun Dec 3 14:37:36 2000 @@ -2,7 +2,7 @@ /** * Analyses a modulegroup. * -* @version $Id: PhpdocModuleAnalyser.php,v 1.3 2000/12/03 16:47:14 uw Exp $ +* @version $Id: PhpdocModuleAnalyser.php,v 1.4 2000/12/03 22:37:36 uw Exp $ */ class PhpdocModuleAnalyser extends PhpdocAnalyser { @@ -165,6 +165,12 @@ } // end func updateBrothersSisters + /** + * @param string Modulegroupname + * @param string Modulename + * @param string Elementtype: functions, variables. + * @return boolean + */ function updateBrotherSisterElements($group, $modulename, $type) { if (!isset($this->modulegroup[$group][$modulename][$type])) @@ -212,6 +218,12 @@ } // end func updateAccessReturn + /** + * @param string Modulegroup + * @param string Modulename + * @param string Elementtype: functions, variables, consts. + * @return boolean + */ function updateAccessReturnElements($group, $modulename, $type) { if (!isset($this->modulegroup[$group][$modulename][$type])) @@ -230,6 +242,12 @@ } // end func updateAccessReturnElements + /** + * @param string Modulegroup + * @param string Modulename + * @param string Elementtype: functions, variables, consts. + * @return boolean + */ function updateAccessElements($group, $modulename, $type) { if (!isset($this->modulegroup[$group][$modulename][$type])) @@ -273,13 +291,14 @@ } // end func checkSee /** - * Checks @see references in the given element array (functions, variables...) + * Checks see references in the given element array (functions, variables...) * * References to variables and functions within the same module get checked. * It the references element does not exist, the reference gets deleted and * a doc warning gets generated. * * @param array List of functions, variables,... + * @param string Name of the modulegroup that contains the given elements. * @param string Name of the module that contains the given elements. * @param string Elementtype: functions, variables, consts, uses. */ @@ -294,7 +313,7 @@ reset($element["see"]["var"]); while (list($k, $variable) = each($element["see"]["var"])) - if (!isset($this->elementlist["variables"][$variable["name"]])) { + if (!isset($this->elementlist["variables"][strtolower($variable["name"])])) { $this->warn->addDocWarning($this->modulegroup[$modulegroup][$modulename]["filename"], "variables", $elname, "@see referrs to the variable '" . $variable["name"] . "' which is not defined in the class. Entry gets ignored.", "mismatch"); unset($this->modulegroup[$modulegroup][$modulename][$eltype][$elname]["see"]["var"][$k]); } @@ -305,7 +324,7 @@ reset($element["see"]["function"]); while (list($k, $function) = each($element["see"]["function"])) - if (!isset($this->elementlist["functions"][substr($function["name"], 0, -2)])) { + if (!isset($this->elementlist["functions"][strtolower(substr($function["name"], 0, -2))])) { $this->warn->addDocWarning($this->modulegroup[$modulename]["filename"], "functions", $elname, "@see referrs to the function '" . $function["name"] . "' which is not defined in the class. Entry gets ignored.", "mismatch"); unset($this->modulegroup[$modulegroup][$modulename][$eltype][$elname]["see"]["function"][$k]); } Index: php4/pear/PHPDoc/exceptions/PhpdocError.php diff -u php4/pear/PHPDoc/exceptions/PhpdocError.php:1.1 php4/pear/PHPDoc/exceptions/PhpdocError.php:1.2 --- php4/pear/PHPDoc/exceptions/PhpdocError.php:1.1 Sun Oct 8 03:03:18 2000 +++ php4/pear/PHPDoc/exceptions/PhpdocError.php Sun Dec 3 14:37:36 2000 @@ -10,7 +10,7 @@ * The class is widely equal to the PEAR error handling class PEAR_ERROR. * * @author Ulf Wendel <ulf.wendel@phpdoc.de> -* @version 1.0 +* @version $Id: PhpdocError.php,v 1.2 2000/12/03 22:37:36 uw Exp $ * @package PHPDoc */ class PhpdocError { @@ -45,7 +45,7 @@ * Use getMessage() to access it. * * @var string $message - * @see PhpdocError + * @see PhpdocError() */ var $message = ""; @@ -58,7 +58,7 @@ /** * Line number where the error occured. - * @var int $line + * @var integer $line * @see PhpdocError() */ var $line = 0; @@ -76,6 +76,7 @@ /** * Sets the error message, filename and linenumber. + * * @param string Errormessage * @param string Name of the file where the error occured, use __FILE__ for this * @param string Linenumber where the error occured, use __LINE__ for this Index: php4/pear/PHPDoc/filehandler/PhpdocFileHandler.php diff -u php4/pear/PHPDoc/filehandler/PhpdocFileHandler.php:1.1 php4/pear/PHPDoc/filehandler/PhpdocFileHandler.php:1.2 --- php4/pear/PHPDoc/filehandler/PhpdocFileHandler.php:1.1 Sun Oct 8 03:03:19 2000 +++ php4/pear/PHPDoc/filehandler/PhpdocFileHandler.php Sun Dec 3 14:37:36 2000 @@ -2,29 +2,28 @@ /** * File handling functions in phpdoc. * -* @version 0.1alpha +* @version $Id $ * @author Ulf Wendel <ulf@redsys.de> */ class PhpdocFileHandler extends PhpdocObject { /** * Filepath. The path is automatically added in front of all filenames + * * @var string $path * @see setFilePath() - * @access private */ var $path = ""; /** * Reads a list of files or one file. - * @param string $files filename - * @param array $files list of filenames, $k => $filename - * @return array $contents file contents indexed by filename + * + * @param mixed Filename or an array filenames, $k => $filename * @throws PhpdocError * @access public */ - function Get($files) { - if (""==$files) { + function get($files) { + if ("" == $files) { $this->err[] = new PhpdocError("No files specified.", __FILE__, __LINE__); return array("", ""); } @@ -36,14 +35,15 @@ $together = ""; reset($files); - while (list($k, $filename)=each($files)) + while (list($k, $filename) = each($files)) $contents[$filename] = $this->getFile($filename); return $contents; - } // end func Get + } // end func get - /** + /** * Sets the filepath. The path is automatically added in front of all filenames + * * @param string $path * @return bool $ok * @access public @@ -54,13 +54,13 @@ /** * Reads a file. + * * @param string $filename * @return string $content * @throws PhpdocError - * @access private */ function getFile($filename) { - if (""==$filename) { + if ("" == $filename) { $this->err[] = new PhpdocError("getFile(), no filename specified.", __FILE__, __LINE__); return ""; } @@ -75,11 +75,22 @@ $content = fread($fh, filesize($filename)); fclose($fh); + return $content; } // end func getFile - function appendToFile($filename, $content, $directory="") { - if (""==$filename || ""==$content) { + /** + * Appends a string to a file. + * + * @param string Filename + * @param string Content to append + * @param string Directory prefix + * @throw PHPDocError + * @return boolean + * @todo ... add a function boldy. + */ + function appendToFile($filename, $content, $directory = "") { + if ("" == $filename || "" == $content) { $this->err[] = new PhpdocError("No filename and/or no content given.", __FILE__, __LINE__); return false; } @@ -87,7 +98,6 @@ $fh = @fopen($filename, "a"); if (!$fh) { print $filename; - ### PANIK return false; } @@ -102,9 +112,15 @@ * * Create or overrides a file in a specified directory. If the * directory does not exists, it attempts to create it. + * + * @param string + * @param string + * @param string + * @throws PHPDocError + * @return boolean */ - function createFile($filename, $content, $directory="") { - if (""==$filename || ""==$content) { + function createFile($filename, $content, $directory = "") { + if ("" == $filename || "" == $content) { $this->err[] = new PhpdocError("No filename or no content given.", __FILE__, __LINE__); return false; } @@ -123,6 +139,7 @@ /** * Returns a list of files in a specified directory + * * @param string $directory * @param mixed $suffix Suffix of the files returned * @param boolean $flag_subdir include subdirectories? @@ -131,16 +148,16 @@ * @return array $files * @throws PhpdocError */ - function getFilesInDirectory($directory, $suffix="", $flag_subdir = true, $files = "") { - if (""==$directory) { + function getFilesInDirectory($directory, $suffix = "", $flag_subdir = true, $files = "") { + if ("" == $directory) { $this->err[] = new PhpdocError("No directory specified", __FILE__, __LINE__); return array(); } - if ("/"!=substr($directory, -1)) - $directory.= "/"; + if ("/" != substr($directory, -1)) + $directory .= "/"; - if (""==$suffix) + if ("" == $suffix) $flag_all = true; else { @@ -151,8 +168,8 @@ $suffix = array($suffix); reset($suffix); - while (list($k, $v)=each($suffix)) - $allowed[".".$v] = true; + while (list($k, $v) = each($suffix)) + $allowed[".$v"] = true; } @@ -164,6 +181,7 @@ $this->err[] = new PhpdocError("Can't open '$directory' for reading.", __FILE__, __LINE__); return array(); } + while ($file = readdir($dh)) { if ("." == $file || ".." == $file) continue; Index: php4/pear/PHPDoc/indexer/PhpdocIndexer.php diff -u php4/pear/PHPDoc/indexer/PhpdocIndexer.php:1.1 php4/pear/PHPDoc/indexer/PhpdocIndexer.php:1.2 --- php4/pear/PHPDoc/indexer/PhpdocIndexer.php:1.1 Sun Oct 8 03:03:19 2000 +++ php4/pear/PHPDoc/indexer/PhpdocIndexer.php Sun Dec 3 14:37:37 2000 @@ -3,36 +3,41 @@ * Builds Indexlists with the result from the * * @author Ulf Wendel <ulf.wendel@redsys.de> -* @version 0.3alpha +* @version $Id: PhpdocIndexer.php,v 1.2 2000/12/03 22:37:37 uw Exp $ */ class PhpdocIndexer extends PhpdocObject { /** * Array of all packages. - * @var $packages + * + * @var array */ var $packages = array(); /** * Current classtree. + * * @var array */ var $classtree = array(); /** * Current modulegroup. + * * @var array */ var $modulegroup = array(); /** * Array of all elements (functions, variables, constant, included files, classes, packages). - * @var + * + * @var array */ var $elements = array(); /** * Array of fields that get added to the elementlist + * * @var array */ var $elementFields = array("functions", "variables", "consts", "uses"); @@ -115,6 +120,7 @@ ); $data = $this->packages; $this->packages = array(); + return $data; } // end func getPackages @@ -148,12 +154,12 @@ ); reset($this->elementFields); - while (list($k, $field)=each($this->elementFields)) { + while (list($k, $field) = each($this->elementFields)) { if (!isset($elements[$field])) continue; reset($elements[$field]); - while (list($name, $data)=each($elements[$field])) { + while (list($name, $data) = each($elements[$field])) { if ("variables" == $field) { Index: php4/pear/PHPDoc/parser/PhpdocClassParser.php diff -u php4/pear/PHPDoc/parser/PhpdocClassParser.php:1.1 php4/pear/PHPDoc/parser/PhpdocClassParser.php:1.2 --- php4/pear/PHPDoc/parser/PhpdocClassParser.php:1.1 Sun Oct 8 03:03:19 2000 +++ php4/pear/PHPDoc/parser/PhpdocClassParser.php Sun Dec 3 14:37:37 2000 @@ -2,8 +2,7 @@ /** * Parses phpcode to extract classes and their documentation. * -* @version 0.2 -* @author Ulf Wendel, ulf@redsys.de +* @version $Id: PhpdocClassParser.php,v 1.2 2000/12/03 22:37:37 uw Exp $ */ class PhpdocClassParser extends PhpdocFunctionParser { @@ -14,15 +13,14 @@ * See $emptyClass to see the internal structure. * * @var array $classes - * @see emptyClass + * @see $emptyClass */ var $classes = array(); /** * Default values of a class - * @var array $emptyClass - * @see classes, analyseClassParagraph * + * @var array $emptyClass */ var $emptyClass = array ( "name" => "", @@ -32,6 +30,7 @@ /** * Array of tags that are allowed in front of the class keyword + * * @var array $classTags * @see analyseClassParagraph() */ Index: php4/pear/PHPDoc/parser/PhpdocConstantParser.php diff -u php4/pear/PHPDoc/parser/PhpdocConstantParser.php:1.3 php4/pear/PHPDoc/parser/PhpdocConstantParser.php:1.4 --- php4/pear/PHPDoc/parser/PhpdocConstantParser.php:1.3 Sun Dec 3 11:31:30 2000 +++ php4/pear/PHPDoc/parser/PhpdocConstantParser.php Sun Dec 3 14:37:37 2000 @@ -2,8 +2,7 @@ /** * Extracts define statements and their documentation from php code. * -* @author Ulf Wendel <ulf.wendel@redsys.de> -* @version $Id: PhpdocConstantParser.php,v 1.3 2000/12/03 19:31:30 uw Exp $ +* @version $Id: PhpdocConstantParser.php,v 1.4 2000/12/03 22:37:37 uw Exp $ */ class PhpdocConstantParser extends PhpdocUseParser { @@ -19,7 +18,7 @@ ); /** - * Doc Tags allowed with @const[ant] + * Doc Tags allowed with const[ant]. * * @var array */ @@ -72,7 +71,7 @@ } // end func analyseConstant /** - * Compares the data from the parser with the optional @const[ant] tags + * Compares the data from the parser with the optional const[ant] tags * @param array Hash with the data of the current constant paragraph * @return array $constant */ Index: php4/pear/PHPDoc/parser/PhpdocFunctionParser.php diff -u php4/pear/PHPDoc/parser/PhpdocFunctionParser.php:1.1 php4/pear/PHPDoc/parser/PhpdocFunctionParser.php:1.2 --- php4/pear/PHPDoc/parser/PhpdocFunctionParser.php:1.1 Sun Oct 8 03:03:19 2000 +++ php4/pear/PHPDoc/parser/PhpdocFunctionParser.php Sun Dec 3 14:37:37 2000 @@ -1,18 +1,17 @@ <?php /** -* Looks for documented and undocumented functions within a block of php code -* @author Ulf Wendel <ulf@redsys.de> -* @version 0.2 +* Looks for documented and undocumented functions within a block of php code. +* +* @version $Id: PhpdocFunctionParser.php,v 1.2 2000/12/03 22:37:37 uw Exp $ */ class PhpdocFunctionParser extends PhpdocVariableParser { /** * Internal structur of a function. + * * @var array $emptyFunction - * @see functions, analyseFunctionParagraph() */ var $emptyFunction = array( - "name" => "", "undoc" => true, Index: php4/pear/PHPDoc/parser/PhpdocParser.php diff -u php4/pear/PHPDoc/parser/PhpdocParser.php:1.1 php4/pear/PHPDoc/parser/PhpdocParser.php:1.2 --- php4/pear/PHPDoc/parser/PhpdocParser.php:1.1 Sun Oct 8 03:03:19 2000 +++ php4/pear/PHPDoc/parser/PhpdocParser.php Sun Dec 3 14:37:37 2000 @@ -2,7 +2,9 @@ /** * "Main" class of the Parser collection. * -* Note that a lot of communication is done by using shared instance variables. +* Note that a lot of communication is done using shared instance variables. +* +* @version $Id: PhpdocParser.php,v 1.2 2000/12/03 22:37:37 uw Exp $ */ class PhpdocParser extends PhpdocClassParser { @@ -19,7 +21,9 @@ /** * Array of PHP Sourcecode Files to examine. + * * The array keys hold the filenames, the array values the file content. + * * @var array * @see parse() */ @@ -27,14 +31,16 @@ /** * Mapping from classnames to filenames + * * @var array */ var $classnamesToFilenames = array(); /** * Hash with the data of the current class tree (one parentclass with all children). + * * @var array - * @see modules + * @see $modules */ var $classes = array(); @@ -46,43 +52,50 @@ /** * List of all files containing classes. + * * @var array */ var $classfiles = array(); /** * Hash of all class trees. + * * @var array */ var $classtree = array(); /** * List of all files containing modules. + * * @var array */ var $modulefiles = array(); /** * List of all module groups. + * * @var array */ var $modulegroups = array(); /** * Hash with the data of the current module group. + * * @var array - * @see classes + * @see $classes */ var $modules = array(); /** * Hash of all packages found. + * * @var array */ var $packages = array(); /** * Flag indicating that getClassTree() was called. + * * @var boolean * @see getClassTree() */ @@ -90,13 +103,15 @@ /** * Flag indicating that getModulegroup was called. + * * @var boolean - * @see getModulegroup + * @see getModulegroup() */ var $flag_modulegroup = false; /** - * Name of the base class of the current class tree + * Name of the base class of the current class tree. + * * @var string * @see getClassTree() */ @@ -104,6 +119,7 @@ /** * Creates an instance of PhpdocWarning and calls buildComplexRegExps() to initialize the object. + * * @param boolean If true the parser prints status messages. * @see $warn, buildComplexRegExps() */ @@ -132,14 +148,14 @@ */ function preparse() { - if (0==count($this->phpfiles)) { + if (0 == count($this->phpfiles)) { $this->err[] = new PHPDocError("Can't parse - no files defined.", __FILE__, __LINE__); return false; } $para = array(); reset($this->phpfiles); - while (list($filename, $phpcode)=each($this->phpfiles)) + while (list($filename, $phpcode) = each($this->phpfiles)) $para[$filename] = $this->getModulesAndClasses($phpcode); $this->findModulegroups($para); @@ -148,7 +164,6 @@ return true; } // end func preparse - /** * Returns the data of one parentclass and all it's subclasses or false. * @@ -157,7 +172,7 @@ * * @return mixed $classes Hash with the data of the current class tree or false. * @access public - * @see getModulegroup(), %baseclasses + * @see getModulegroup(), $baseclasses */ function getClassTree() { @@ -167,7 +182,7 @@ $this->flag_classtree = true; } - if (list($classname, $filename)=each($this->baseclasses)) { + if (list($classname, $filename) = each($this->baseclasses)) { $this->classes = array(); $this->current_baseclass = $classname; @@ -201,12 +216,12 @@ $this->flag_modulegroup = true; } - if (list($group, $modules)=each($this->modulegroups)) { + if (list($group, $modules) = each($this->modulegroups)) { $this->modules = array(); - while (list($modulename, $files)=each($modules)) { + while (list($modulename, $files) = each($modules)) { reset($files); - while (list($k, $filename)=each($files)) + while (list($k, $filename) = each($files)) $this->addModule($group, $filename); } @@ -275,7 +290,7 @@ // Add some informations from the classtree that was build by the prescan to the class. $fields = array("subclasses", "noparent", "path", "baseclass"); reset($fields); - while (list($k, $field)=each($fields)) + while (list($k, $field) = each($fields)) if (isset($this->classtree[$filename][$classname][$field])) $result[$field] = $this->classtree[$filename][$classname][$field]; @@ -291,6 +306,7 @@ /** * Adds recursively subclasses to the specified class. + * * @param string Name of the class that might contain subclasses * @see addClass() */ @@ -299,7 +315,7 @@ if (isset($this->classes[$classname]["subclasses"])) { $subclasses = $this->classes[$classname]["subclasses"]; - while (list($subclass, $v)=each($subclasses)) + while (list($subclass, $v) = each($subclasses)) $this->addClass($subclass, $this->classnamesToFilenames[$subclass]); } @@ -315,14 +331,14 @@ function findModulegroups($para) { reset($para); - while (list($filename, $data)=each($para)) { + while (list($filename, $data) = each($para)) { if (isset($data["modules"]["name"])) { - $name = (""!=$data["modules"]["name"]) ? $data["modules"]["name"] : $filename; - $group = (""!=$data["modules"]["group"]) ? $data["modules"]["group"] : $name; + $name = ("" != $data["modules"]["name"]) ? $data["modules"]["name"] : $filename; + $group = ("" != $data["modules"]["group"]) ? $data["modules"]["group"] : $name; - if (0!=count($data["classes"])) { + if (0 != count($data["classes"])) { // As we do not have a real parser that returns a parsing tree we can't // handle modules and classes in one file. Drop a note to the user. $this->warn->addDocWarning( $filename, "module", $name, "PHPDoc is confused: module files must not contain classes. Doc will probably be broken, module gets ignored.", "collision" ); @@ -350,7 +366,7 @@ function findClassTrees($para) { reset($para); - while(list($filename, $data)=each($para)) { + while(list($filename, $data) = each($para)) { if (0!=count($data["classes"])) { @@ -393,7 +409,7 @@ if ($flag_noparent) $this->classtree[$filename][$classname]["noparent"] = $flag_noparent; - $base = (0==count($path)) ? true : false; + $base = (0 == count($path)) ? true : false; if ($base) $this->baseclasses[$classname] = $filename; else @@ -407,8 +423,9 @@ /** * Returns the mapping array from classnames to filenames - * @return array $this->classnamesToFilenames - * @see classnamesToFilenames + * + * @return array + * @see $classnamesToFilenames */ function getClassnamesToFilenames() { return $this->classnamesToFilenames; @@ -422,7 +439,7 @@ * @access public */ function setPhpSourcecodeFiles($phpfiles) { - if (!is_array($phpfiles) || 0==count($phpfiles)) + if (!is_array($phpfiles) || 0 == count($phpfiles)) return false; $this->phpfiles = $phpfiles; Index: php4/pear/PHPDoc/parser/PhpdocParserCore.php diff -u php4/pear/PHPDoc/parser/PhpdocParserCore.php:1.2 php4/pear/PHPDoc/parser/PhpdocParserCore.php:1.3 --- php4/pear/PHPDoc/parser/PhpdocParserCore.php:1.2 Sat Dec 2 16:37:59 2000 +++ php4/pear/PHPDoc/parser/PhpdocParserCore.php Sun Dec 3 14:37:37 2000 @@ -5,8 +5,7 @@ * Provides basic parser functions to extract doc comments, analyse tags and variable * declarations. * -* @author Ulf Wendel <ulf@redsys.de> -* @version 0.3 +* @version $Id: PhpdocParserCore.php,v 1.3 2000/12/03 22:37:37 uw Exp $ */ class PhpdocParserCore extends PhpdocParserTags { @@ -555,7 +554,6 @@ * different syntax for arrays. By default function parameters are expected. * @return array $vartype $vartype[0] = type, $vartype[1] = value, $vartype[2] = raw value - * @see */ function getVariableTypeAndValue($code, $flag_args = true) { Index: php4/pear/PHPDoc/parser/PhpdocParserRegExp.php diff -u php4/pear/PHPDoc/parser/PhpdocParserRegExp.php:1.3 php4/pear/PHPDoc/parser/PhpdocParserRegExp.php:1.4 --- php4/pear/PHPDoc/parser/PhpdocParserRegExp.php:1.3 Sun Dec 3 11:31:30 2000 +++ php4/pear/PHPDoc/parser/PhpdocParserRegExp.php Sun Dec 3 14:37:37 2000 @@ -7,8 +7,7 @@ * possible I decided to define all regular expressions in one class. * From a programming point of view there's no need to do so. * -* @author Ulf Wendel <ulf@redsys.de> -* @version $Id: PhpdocParserRegExp.php,v 1.3 2000/12/03 19:31:30 uw Exp $ +* @version $Id: PhpdocParserRegExp.php,v 1.4 2000/12/03 22:37:37 uw Exp $ */ class PhpdocParserRegExp extends PhpdocObject { @@ -97,7 +96,7 @@ * As with $PHP_COMPLEX all complex expressions are build using basic * ones in buildComplexRegExps(). * - * @var array Regular expressions matching @see and optional objectnames. + * @var array Regular expressions matching see and optional objectnames. * @final * @see buildComplexRegexps(), $C_BASE */ Index: php4/pear/PHPDoc/parser/PhpdocParserTags.php diff -u php4/pear/PHPDoc/parser/PhpdocParserTags.php:1.3 php4/pear/PHPDoc/parser/PhpdocParserTags.php:1.4 --- php4/pear/PHPDoc/parser/PhpdocParserTags.php:1.3 Sun Dec 3 11:31:30 2000 +++ php4/pear/PHPDoc/parser/PhpdocParserTags.php Sun Dec 3 14:37:37 2000 @@ -2,7 +2,7 @@ /** * Functions used to parse PHPDoc Tags. * -* @version $Id: PhpdocParserTags.php,v 1.3 2000/12/03 19:31:30 uw Exp $ +* @version $Id: PhpdocParserTags.php,v 1.4 2000/12/03 22:37:37 uw Exp $ */ class PhpdocParserTags extends PhpdocParserRegExp { @@ -556,7 +556,7 @@ } // end func analyseTags /** - * Helperfunction to analyse @see tags + * Helperfunction to analyse see tags * * @param array Array return by preg_match() * @return array $see[0] = error, $see[1] = data @@ -652,8 +652,8 @@ * Find the position of the next phpdoc tag. * * @param string $phpdoc - * @param int $offset - * @return array $t 0 => tag, 1 => offset + * @param integer $offset + * @return array $tag 0 => tag, 1 => offset * @access private * @see findTags() */ Index: php4/pear/PHPDoc/parser/PhpdocVariableParser.php diff -u php4/pear/PHPDoc/parser/PhpdocVariableParser.php:1.2 php4/pear/PHPDoc/parser/PhpdocVariableParser.php:1.3 --- php4/pear/PHPDoc/parser/PhpdocVariableParser.php:1.2 Sun Dec 3 11:31:30 2000 +++ php4/pear/PHPDoc/parser/PhpdocVariableParser.php Sun Dec 3 14:37:37 2000 @@ -2,16 +2,14 @@ /** * Extract class variables and their documentation from phpcode * -* @author Ulf Wendel <ulf@redsys.de> -* @version $Id: PhpdocVariableParser.php,v 1.2 2000/12/03 19:31:30 uw Exp $ +* @version $Id: PhpdocVariableParser.php,v 1.3 2000/12/03 22:37:37 uw Exp $ */ class PhpdocVariableParser extends PhpdocModuleParser { /** * Array with default values of a variable * - * @var array $emptyVariable - * @see variables, analyseVariableParagraph() + * @var array $emptyVariable */ var $emptyVariable = array( "name" => "", @@ -84,7 +82,7 @@ } // end func analyseVariables /** - * Compares the @var tag informations with the analyse of the source code. + * Compares the var tag informations with the analyse of the source code. * * @param array $variable * @return array $variable Index: php4/pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php diff -u php4/pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php:1.3 php4/pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php:1.4 --- php4/pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php:1.3 Sun Dec 3 06:36:01 2000 +++ php4/pear/PHPDoc/renderer/html/PhpdocHTMLClassRenderer.php Sun Dec 3 14:37:37 2000 @@ -1,6 +1,8 @@ <?php /** * Renders classes. +* +* @version $Id: PhpdocHTMLClassRenderer.php,v 1.4 2000/12/03 22:37:37 uw Exp $ */ class PhpdocHTMLClassRenderer extends PhpdocHTMLDocumentRenderer { @@ -24,6 +26,7 @@ * @param string XML file path * @param string Template file path * @param string Name of the current application + * @param string Filename extension * @see setPath(), setTemplateRoot() */ function PhpdocHTMLClassRenderer($path, $templateRoot, $application, $extension = ".html") { @@ -40,7 +43,8 @@ } // end constructor /** - * Renders a class + * Renders a class. + * * @param string XML source file * @param string Name of the HTML target file. * @access public @@ -150,7 +154,10 @@ /** * Renders a list of a certain inherited element. * - * @see renderInheritedElements() + * @param array List of inherited elements. + * @param string Templateblockname + * @param string Element type: function, variable... + * @see renderInherited() */ function renderInheritedElements($inherited, $block, $type) { Index: php4/pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php diff -u php4/pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php:1.3 php4/pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php:1.4 --- php4/pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php:1.3 Sun Dec 3 06:36:01 2000 +++ php4/pear/PHPDoc/renderer/html/PhpdocHTMLDocumentRenderer.php Sun Dec 3 14:37:37 2000 @@ -1,6 +1,8 @@ <?php /** * Provides functioninality to render modules and classes. +* +* @version $Id: PhpdocHTMLDocumentRenderer.php,v 1.4 2000/12/03 22:37:37 uw Exp $ */ class PhpdocHTMLDocumentRenderer extends PhpdocHTMLRenderer { @@ -10,7 +12,7 @@ * @var string $undocumented * @access public */ - var $undocmented = "Warning: documentation is missing."; + var $undocumented = "Warning: documentation is missing."; /** * Array of functions found in the xml document. @@ -28,6 +30,7 @@ /** * Array of constants. + * * @var array $constants */ var $constants = array(); @@ -54,7 +57,7 @@ ); /** - * Known types for @include. + * Types of include statements. * * @var array $usesTypes * @see renderUses() @@ -193,7 +196,7 @@ } // end func renderUses /** - * Adds a detailed list of all @included files to the template. + * Adds a detailed list of all included files to the template. * * The function assumes that there is a block names "usesdetail" and within the block * a block names "usesdetail_loop" in the template. @@ -237,7 +240,7 @@ } // end func renderUsesDetail /** - * Adds a summary of all @included files to the template. + * Adds a summary of all included files to the template. * * The function assumes that there is a block names "usessummary" and within * the block another block names "usessummary_loop" in the template. @@ -455,6 +458,7 @@ /** * Converts the XML parameter array into formatted string. + * * @param array XML parameter array * @return string Formatted parameter string */ @@ -504,7 +508,7 @@ } // end func getParameter /** - * Renders a block with references to other source elements, @see. + * Renders a block with references to other source elements. * * @param array XML references array * @param string optional template blockname prefix @@ -561,7 +565,7 @@ } // end func renderSee /** - * Renders an author list, @author. + * Renders an author list. * * @param array XML author array * @param string optional template blockname prefix @@ -599,7 +603,7 @@ } // end func renderAuthors /** - * Renders a list of external links, @link. + * Renders a list of external links. * * @param array XML link array * @param string optional template blockname prefix @@ -634,7 +638,7 @@ } // end func renderLinks /** - * Renders a list of exceptions, @throws. + * Renders a list of exceptions. * * @param array XML array * @param string optional template blockname prefix @@ -663,7 +667,7 @@ } // end func renderThrows /** - * Renders a list of global elements, @global + * Renders a list of global elements. * * @param array XML globals array * @param string optional template blockname prefix Index: php4/pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php diff -u php4/pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.3 php4/pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.4 --- php4/pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.3 Sun Dec 3 06:36:01 2000 +++ php4/pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php Sun Dec 3 14:37:37 2000 @@ -48,6 +48,7 @@ * @param string XML file path * @param string Template file path * @param string Name of the application + * @param string Filename extension * @see setPath(), setTemplateRoot() */ function PhpdocHTMLIndexRenderer($path, $templateRoot, $application, $extension = ".html") { Index: php4/pear/PHPDoc/renderer/html/PhpdocHTMLModuleRenderer.php diff -u php4/pear/PHPDoc/renderer/html/PhpdocHTMLModuleRenderer.php:1.3 php4/pear/PHPDoc/renderer/html/PhpdocHTMLModuleRenderer.php:1.4 --- php4/pear/PHPDoc/renderer/html/PhpdocHTMLModuleRenderer.php:1.3 Sun Dec 3 06:36:01 2000 +++ php4/pear/PHPDoc/renderer/html/PhpdocHTMLModuleRenderer.php Sun Dec 3 14:37:37 2000 @@ -1,6 +1,8 @@ <?php /** * Renders modules. +* +* @version $Id: PhpdocHTMLModuleRenderer.php,v 1.4 2000/12/03 22:37:37 uw Exp $ */ class PhpdocHTMLModuleRenderer extends PhpdocHTMLDocumentRenderer { @@ -10,6 +12,7 @@ * @param string XML file path * @param string Template file path * @param string Name of the current application + * @param string Filename extension * @see setPath(), setTemplateRoot() */ function PhpdocHTMLModuleRenderer($path, $templateRoot, $application, $extension = ".html") { Index: php4/pear/PHPDoc/renderer/html/PhpdocHTMLWarningRenderer.php diff -u php4/pear/PHPDoc/renderer/html/PhpdocHTMLWarningRenderer.php:1.3 php4/pear/PHPDoc/renderer/html/PhpdocHTMLWarningRenderer.php:1.4 --- php4/pear/PHPDoc/renderer/html/PhpdocHTMLWarningRenderer.php:1.3 Sun Dec 3 06:36:01 2000 +++ php4/pear/PHPDoc/renderer/html/PhpdocHTMLWarningRenderer.php Sun Dec 3 14:37:37 2000 @@ -10,6 +10,7 @@ * @param string XML file path * @param string Template file path * @param string Name of the application + * @param string Filename extension * @see setPath(), setTemplateRoot() */ function PhpdocHTMLWarningRenderer($path, $templateRoot, $application, $extension = ".html") { Index: php4/pear/PHPDoc/warning/PhpdocWarning.php diff -u php4/pear/PHPDoc/warning/PhpdocWarning.php:1.1 php4/pear/PHPDoc/warning/PhpdocWarning.php:1.2 --- php4/pear/PHPDoc/warning/PhpdocWarning.php:1.1 Sun Oct 8 03:03:20 2000 +++ php4/pear/PHPDoc/warning/PhpdocWarning.php Sun Dec 3 14:37:38 2000 @@ -4,6 +4,8 @@ * * The base of the report generator module is this container. It's currently * pretty simple and will change later on... +* +* @version $Id: PhpdocWarning.php,v 1.2 2000/12/03 22:37:38 uw Exp $ */ class PhpdocWarning extends PhpdocObject { @@ -15,7 +17,7 @@ /** * Counter containing the number of documentation warnings. - * @var int + * @var integer * @see getNumDocWarnings(), getNumWarnings() */ var $num_doc_warnings = 0; @@ -26,7 +28,7 @@ * @param string Kind of the element that caused the error: module, class, function, variable, use, const * @param string Name of the class/function/... that caused the warning * @param string Warning message itself - * @para, string Type of the error: missing, mismatch, syntax, ... + * @param string Type of the error: missing, mismatch, syntax, ... * @access public * @see addDocWarning() */ Index: php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php diff -u php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.1 php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.2 --- php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php:1.1 Sun Oct 8 03:03:21 2000 +++ php4/pear/PHPDoc/xmlexporter/PhpdocXMLClassExporter.php Sun Dec 3 14:37:38 2000 @@ -2,18 +2,13 @@ /** * Exports the data of a class as an xml file. * -* @author Ulf Wendel <ulf.wendel@phpdoc.de> -* @version 1.0 +* @version $Id: PhpdocXMLClassExporter.php,v 1.2 2000/12/03 22:37:38 uw Exp $ */ class PhpdocXMLClassExporter extends PhpdocXMLDocumentExporter { - function PhpdocXMLClassExporter() { - $this->PHPDocXMLExporter(); - } // end constructor - /** * Variable container attributes. - * @var array $variableAttriutes + * @var array $variableAttributes */ var $variableAttributes = array( "name" => "CDATA", @@ -40,6 +35,10 @@ var $fileprefix = "class_"; + function PhpdocXMLClassExporter() { + $this->PHPDocXMLExporter(); + } // end constructor + function create() { $attribs = $this->getAttributes($this->result, $this->classAttributes); @@ -89,16 +88,16 @@ function inheritedOverridenXML($data, $tag) { reset($data); - while (list($type, $elements)=each($data)) { + while (list($type, $elements) = each($data)) { reset($elements); - while (list($from, $data2)=each($elements)) { + while (list($from, $data2) = each($elements)) { $attribs = $this->getAttributes( array ("type" => $type, "src" => $from), $this->inheritedOverridenAttributes); $this->xmlwriter->startElement($tag, "", $attribs, false); reset($data2); - while (list($name, $v)=each($data2)) + while (list($name, $v) = each($data2)) $this->xmlwriter->addElement("element", $name); $this->xmlwriter->endElement($tag, true); @@ -111,16 +110,17 @@ /** * Writes the "path" (inheritance chain) of an element. + * * @param array */ function pathXML($path) { - if (0==count($path)) + if (0 == count($path)) return; $this->xmlwriter->startElement("path", "", "", false); reset($path); - while (list($k, $parent)=each($path)) + while (list($k, $parent) = each($path)) $this->xmlwriter->addElement("parent", $parent); $this->xmlwriter->endElement("path", true); @@ -129,27 +129,29 @@ /** * Adds a baseclass container to the generated xml. + * * @param string Name of the baseclass */ function baseclassXML($base) { - if (""!=$base) + if ("" != $base) $this->xmlwriter->addElement("baseclass", $base); } // end func baseclassXML /** * Adds a list of subclasses to the generated xml. + * * @param array */ function subclassesXML($subclasses) { - if (0==count($subclasses)) + if (0 == count($subclasses)) return; $this->xmlwriter->startElement("subclasses", "", "", false, true); reset($subclasses); - while(list($subclass, $v)=each($subclasses)) + while(list($subclass, $v) = each($subclasses)) $this->xmlwriter->addElement("subclass", $subclass); $this->xmlwriter->endElement("subclasses", true); @@ -157,12 +159,14 @@ } // end func subclassesXML /** - * Writes class variables to + * Adds class variables to the XMl document. + * + * @param array */ function variablesXML($variables) { reset($variables); - while (list($variable, $data)=each($variables)) { + while (list($variable, $data) = each($variables)) { $attribs = $this->getAttributes($data, $this->variableAttributes); $this->xmlwriter->startElement("variable", $data["value"], $attribs, false); Index: php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php diff -u php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php:1.1 php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php:1.2 --- php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php:1.1 Sun Oct 8 03:03:21 2000 +++ php4/pear/PHPDoc/xmlexporter/PhpdocXMLDocumentExporter.php Sun Dec 3 14:37:38 2000 @@ -1,11 +1,14 @@ <?php /** * Base of the class and module exporter. +* +* @version $Id: PhpdocXMLDocumentExporter.php,v 1.2 2000/12/03 22:37:38 uw Exp $ */ class PhpdocXMLDocumentExporter extends PhpdocXMLExporter { /** * Mapping from internal result array index name to xml tag name. + * * @var array $docTags */ var $docTags = array( @@ -24,6 +27,7 @@ /** * Attributes of the <see> container. + * * @var array $seeAttributes */ var $seeAttributes = array( @@ -33,18 +37,21 @@ /** * Attributes of the <link> container. + * * @var array $linkAttributes */ var $linkAttributes = array( "url" => "CDATA" ); /** * Attributes of the <author> container. + * * @var array $authorAttributes */ var $authorAttributes = array( "email" => "CDATA" ); /** * Attributes of <inherited> and <overriden> container. + * * @var array $inheritedOverridenAttributes */ var $inheritedOverridenAttributes = array( @@ -54,6 +61,7 @@ /** * Attributes of the <constant> container. + * * @var array $constAttributes */ var $constAttributes = array( @@ -65,6 +73,7 @@ /** * Attribues of the <uses> container. + * * @var array $usesAttributes */ var $usesAttributes = array( @@ -75,6 +84,7 @@ /** * Attribues of the <function> container. + * * @var array $functionAttributes */ var $functionAttributes = array( @@ -87,7 +97,8 @@ /** * Attributes of the <return> container. - * @var array $returnAttribues + * + * @var array $returnAttributes */ var $returnAttributes = array( "name" => "CDATA", @@ -96,6 +107,7 @@ /** * Attributes of the <global> container. + * * @var array $globalAttributes */ var $globalAttributes = array( @@ -105,6 +117,7 @@ /** * Attributes of the <param> container. + * * @var array $paramAttributes */ var $paramAttributes = array( @@ -116,6 +129,7 @@ /** * Writes a <file> container. + * * @param string $file filename */ function filenameXML($file) { @@ -123,12 +137,13 @@ } // end func filenameXML /** - * Adds all constants (define(), @const) to the xml document. + * Adds all constants (define(), const) to the xml document. + * * @param array Array of constants * @return boolean Returns false on failure otherwise true */ function constsXML($consts) { - if (!is_array($consts) || 0==count($consts)) + if (!is_array($consts) || 0 == count($consts)) return true; reset($consts); @@ -144,6 +159,11 @@ return true; } // end func constsXML + /** + * Adds a list of used files (include, require...) to the xml document. + * + * @param array + */ function usesXML($uses) { if (!is_array($uses)) { $this->err[] = new PhpdocError("No array given.", __FILE__, __LINE__); @@ -151,7 +171,7 @@ } reset($uses); - while (list($k, $data)=each($uses)) { + while (list($k, $data) = each($uses)) { $attribs = $this->getAttributes($data, $this->usesAttributes); $this->xmlwriter->startElement("uses", "", $attribs, false, true); @@ -163,14 +183,19 @@ return true; } // end func usesXML + /** + * Adds a list of functions to the xml file. + * + * @param array + */ function functionsXML($functions) { if (!is_array($functions)) { $this->err[] = new PhpdocError("No array given.", __FILE__, __LINE__); return false; } -#$this->introspection("functions", $functions); + reset($functions); - while (list($k, $data)=each($functions)) { + while (list($k, $data) = each($functions)) { $attribs = $this->getAttributes($data, $this->functionAttributes); $this->xmlwriter->startElement("function", "", $attribs, false, true); @@ -181,6 +206,11 @@ } // end functionsXML + /** + * Adds a documentation block (author, links, see, params...) to the xml document + * + * @param array + */ function docXML($data) { $this->xmlwriter->startElement("doc", "", "", false, true); @@ -229,31 +259,46 @@ } reset($this->docTags); - while (list($field, $tag)=each($this->docTags)) + while (list($field, $tag) = each($this->docTags)) if (isset($data[$field])) $this->xmlwriter->addElement($tag, $data[$field], ""); $this->xmlwriter->endElement("doc", true); } // end func docXML + /** + * Adds <global> container to the xml document. + * + * @param array + */ function globalsXML($globals) { reset($globals); - while (list($k, $data)=each($globals)) { + while (list($k, $data) = each($globals)) { $attribs = $this->getAttributes($data, $this->globalAttributes); $this->xmlwriter->addElement("global", (isset($data["desc"])) ? $data["desc"] : "", $attribs); } } // end func globalsXML + /** + * Adds <throws> container to the xml document. + * + * @param array + */ function throwsXML($exceptions) { reset($exceptions); - while (list($k, $exception)=each($exceptions)) + while (list($k, $exception) = each($exceptions)) $this->xmlwriter->addElement("throws", $exception, "", true); } // end func throwsXML + /** + * Adds <return> container to the xml document. + * + * @param array + */ function returnXML($return) { $desc = ""; @@ -276,20 +321,30 @@ } // end func returnXML + /** + * Adds <parameter> container to the xml document. + * + * @param array + */ function paramsXML($params) { reset($params); - while (list($k, $data)=each($params)) { + while (list($k, $data) = each($params)) { $attribs = $this->getAttributes($data, $this->paramAttributes); $this->xmlwriter->addElement("parameter", (isset($data["desc"])) ? $data["desc"] : "", $attribs); } } // end func paramsXML + /** + * Adds <author> container to the xml document. + * + * @param array + */ function authorXML($authors) { reset($authors); - while (list($k, $data)=each($authors)) { + while (list($k, $data) = each($authors)) { $attribs = array(); @@ -306,10 +361,15 @@ } // end func authorXML + /** + * Adds <link> container to the xml document. + * + * @param array + */ function linkXML($links) { reset($links); - while (list($k, $data)=each($links)) { + while (list($k, $data) = each($links)) { $attribs = array( "url" => array( @@ -323,13 +383,18 @@ } // end func linkXML + /** + * Adds <see> container to the xml document. + * + * @param array + */ function seeXML($see) { reset($see); - while (list($type, $data)=each($see)) { + while (list($type, $data) = each($see)) { reset($data); - while (list($k, $data2)=each($data)) { + while (list($k, $data2) = each($data)) { $attribs = array( "type" => array( Index: php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php diff -u php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php:1.1 php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php:1.2 --- php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php:1.1 Sun Oct 8 03:03:21 2000 +++ php4/pear/PHPDoc/xmlexporter/PhpdocXMLExporter.php Sun Dec 3 14:37:38 2000 @@ -1,8 +1,8 @@ <?php /** * Exporter used to export phpdoc internals data structures as xml documents. -* @author Ulf Wendel <ulf.wendel@phpdoc.de> -* @version 1.0 +* +* @version $Id: PhpdocXMLExporter.php,v 1.2 2000/12/03 22:37:38 uw Exp $ */ class PhpdocXMLExporter extends PhpdocObject { @@ -72,7 +72,7 @@ */ function export($result, $xmlfile="") { - if (0==count($result)) + if (0 == count($result)) return; $this->result = $result; @@ -84,7 +84,7 @@ $this->xmlwriter->endElement("phpdoc", true); - if (""==$xmlfile) + if ("" == $xmlfile) $xmlfile = $this->result["name"]; /* @@ -105,6 +105,9 @@ } // end func export + /** + * @param array + */ function setResult($result) { $this->result = $result; $this->create(); Index: php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php diff -u php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php:1.1 php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php:1.2 --- php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php:1.1 Sun Oct 8 03:03:21 2000 +++ php4/pear/PHPDoc/xmlexporter/PhpdocXMLIndexExporter.php Sun Dec 3 14:37:38 2000 @@ -1,17 +1,21 @@ <?php /** -* Creates XML index files +* Creates XML index files. +* +* @version $Id: PhpdocXMLIndexExporter.php,v 1.2 2000/12/03 22:37:38 uw Exp $ */ class PhpdocXMLIndexExporter extends PhpdocXMLExporter { /** * Chapter tag attributes + * * @var array */ var $chapterAttributes = array( "name" => "CDATA" ); /** * Element tag attributes. + * * @var array() */ var $elementAttributes = array( @@ -40,7 +44,7 @@ $this->xmlwriter->startElement("phpdoc"); reset($modulegroup); - list($group, $modules)=each($modulegroup); + list($group, $modules) = each($modulegroup); $attribs = array( "name" => array( "type" => "CDATA", "value" => $group) ); $this->xmlwriter->startElement("modulegroup", "", $attribs); @@ -78,10 +82,10 @@ $this->xmlwriter->startElement("package", "", $attribs); reset($elementlist); - while (list($type, $elements)=each($elementlist)) { + while (list($type, $elements) = each($elementlist)) { - $container = ("classes"==$type) ? "class" : "module"; - while (list($k, $element)=each($elements)) { + $container = ("classes" == $type) ? "class" : "module"; + while (list($k, $element) = each($elements)) { $attribs = array( "name" => array("type" => "CDATA", "value" => $element)); $this->xmlwriter->addElement($container, "", $attribs); @@ -104,7 +108,8 @@ /** * Exports a classtree * - * @param array + * @param array Classtree + * @param string Name of the baseclass of the classtree * @access public */ function exportClasstree(&$classtree, $baseclass) { @@ -118,13 +123,13 @@ $this->xmlwriter->startElement("classtree", "", $attribs); reset($classtree); - while (list($parentclass, $subclasses)=each($classtree)) { + while (list($parentclass, $subclasses) = each($classtree)) { $attribs = array("name" => array("type" => "CDATA", "value" => $parentclass)); $this->xmlwriter->startElement("class", "", $attribs); reset($subclasses); - while (list($subclass, $v)=each($subclasses)) + while (list($subclass, $v) = each($subclasses)) $this->xmlwriter->addElement("subclass", $subclass); $this->xmlwriter->endElement("class"); @@ -135,7 +140,7 @@ $this->xmlwriter->endElement("phpdoc"); $baseclass = $this->nameToURL($baseclass); - $this->xmlwriter->export($this->path."classtree_$baseclass.xml"); + $this->xmlwriter->export($this->path . "classtree_$baseclass.xml"); $this->xmlwriter->free(); } // end func exportClasstree @@ -155,16 +160,16 @@ $this->xmlwriter->startElement("index"); reset($elementlist); - while (list($index, $elements)=each($elementlist)) { + while (list($index, $elements) = each($elementlist)) { $attrib = array( "char" => array( "type" => "CDATA", "value" => $index ) ); $this->xmlwriter->startElement("chapter", "", $attrib); reset($elements); - while (list($name, $element)=each($elements)) { + while (list($name, $element) = each($elements)) { reset($element); - while (list($k, $eldata)=each($element)) { + while (list($k, $eldata) = each($element)) { $attribs = $this->getAttributes($eldata, $this->elementAttributes); $attribs["name"] = array( "type" => "CDATA", "value" => $name ); $this->xmlwriter->addElement("element", $eldata["sdesc"], $attribs); Index: php4/pear/PHPDoc/xmlreader/PhpdocXMLReader.php diff -u php4/pear/PHPDoc/xmlreader/PhpdocXMLReader.php:1.1 php4/pear/PHPDoc/xmlreader/PhpdocXMLReader.php:1.2 --- php4/pear/PHPDoc/xmlreader/PhpdocXMLReader.php:1.1 Sun Oct 8 03:03:21 2000 +++ php4/pear/PHPDoc/xmlreader/PhpdocXMLReader.php Sun Dec 3 14:37:38 2000 @@ -2,12 +2,13 @@ /** * Reads XML documents into a multi dimensional Array. * -* @author Ulf Wendel <ulf.wendel@phpdoc.de> +* @version $Id: PhpdocXMLReader.php,v 1.2 2000/12/03 22:37:38 uw Exp $ */ class PhpdocXMLReader extends PhpdocObject { /** * PHPDocFileHandler object. + * * @var object PhpdocFileHandler * @see createFileHandler() */ @@ -15,6 +16,7 @@ /** * Values array from xml_parse_into_struct(). + * * @var array * @see parse(), stripCloseFromStructvalues(), importXML() */ @@ -64,6 +66,7 @@ /** * Creates a PhpdocFileHandler object and saves it to $filehandler if it does not already exist. + * * @see $filehandler */ function createFilehandler() { @@ -83,8 +86,8 @@ $values = array(); reset($this->structvalues); - while (list($k, $v)=each($this->structvalues)) - if ("close"!=$v["type"]) + while (list($k, $v) = each($this->structvalues)) + if ("close" != $v["type"]) $values[] = $v; $this->structvalues = $values; @@ -99,8 +102,8 @@ * - no XML DOM * - no eval(), this can't be optimized by the compiler * - * @param int - * @param int + * @param integer + * @param integer * @return array $data[0] = daten, $data[1] = some index value used for the recursion * @see addToArray() */ @@ -151,7 +154,7 @@ * @param array * @return array $target */ - function addToArray($target, $key, $value="", $attributes = "", $inner="") { + function addToArray($target, $key, $value="", $attributes = "", $inner = "") { if (!isset($target[$key]["value"]) && !isset($target[$key][0])) { @@ -160,7 +163,7 @@ if (""!=$attributes) { reset($attributes); - while (list($k, $v)=each($attributes)) + while (list($k, $v) = each($attributes)) $target[$key][$k] = $this->xmldecode($v); } @@ -174,10 +177,10 @@ $target[$key] = array(); $target[$key][0] = $oldvalue; - if (""!=$inner) + if ("" != $inner) $target[$key][1] = $inner; - if (""!=$attributes) { + if ("" != $attributes) { reset($attributes); while (list($k, $v)=each($attributes)) $target[$key][1][$k] = $this->xmldecode($v); @@ -189,12 +192,12 @@ $index = count($target[$key]); - if (""!=$inner) + if ("" != $inner) $target[$key][$index] = $inner; if (""!=$attributes) { reset($attributes); - while (list($k, $v)=each($attributes)) + while (list($k, $v) = each($attributes)) $target[$key][$index][$k] = $this->xmldecode($v); } @@ -207,6 +210,12 @@ return $target; } // end func addToArray + /** + * Replaces some basic entities with their character counterparts. + * + * @param string String to decode + * @return string Decoded string + */ function xmldecode($value) { #return preg_replace( array("@<@", "@>@", "@'@", "@"@", "@&@"), array("<", ">", "'", '"', "&"), $value); return utf8_decode(preg_replace( array("@<@", "@>@", "@'@", "@"@", "@&@"), array("<", ">", "'", '"', "&"), $value)); Index: php4/pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php diff -u php4/pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php:1.2 php4/pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php:1.3 --- php4/pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php:1.2 Sun Dec 3 12:30:42 2000 +++ php4/pear/PHPDoc/xmlwriter/PhpdocXMLWriter.php Sun Dec 3 14:37:39 2000 @@ -7,7 +7,7 @@ * functions to handle attributes and hides file handling tasks. * * @author Ulf Wendel <ulf.wendel@phpdoc.de> -* @version $Id: PhpdocXMLWriter.php,v 1.2 2000/12/03 20:30:42 uw Exp $ +* @version $Id: PhpdocXMLWriter.php,v 1.3 2000/12/03 22:37:39 uw Exp $ */ class PhpdocXMLWriter extends PhpdocObject { @@ -29,7 +29,7 @@ * Filehandler used for IO operations * * @var object PhpdocFilehandler - * @see PhpdocXMLWriter + * @see PhpdocXMLWriter() */ var $fileHandler;