3 // +----------------------------------------------------------------------+
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997-2002 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.02 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
13 // | obtain it through the world-wide-web, please send a note to |
14 // | license@php.net so we can mail you a copy immediately. |
15 // +----------------------------------------------------------------------+
16 // | Authors: Alan Knowles <alan@akbkhome.com> |
17 // +----------------------------------------------------------------------+
21 * Phpdoc data container
23 * @package PHP_CodeDoc
25 * @author Alan Knowles <alan@akbkhome.com>
29 require_once 'Param.php';
31 class PHP_CodeDoc_Data_PhpDoc {
32 var $long = ""; // name of parameter
33 var $short = ""; // default value
34 var $original; // original text of comment
35 var $param = array(); //@param type $varname description
36 var $return; //@return type description
37 var $access; //@access public or private
38 var $author; //@author author name
39 var $copyright; //@copyright name date
40 var $version; //@version version
41 var $see; //@see name of another element that can be documented, produces a link to it in the documentation
42 var $link; //@link a url
43 var $since; //@since a version or a date
44 var $deprecacted; //@deprecated|@deprec description
45 var $magic; //@magic phpdoc.de compatibility
46 var $todo; //@todo phpdoc.de compatibility
47 var $exception; //@exception Javadoc-compatible, use as needed
48 var $throws; //@throws Javadoc-compatible, use as needed
49 var $var; //@var type a data type for a class variable
50 var $package; //@package package name
52 var $subpackage; //@subpackage sub package name, groupings inside of a project
54 function __construct()
56 $this->return = new PHP_CodeDoc_Data_Param();
62 $ret = '<p>'. $this->long .'</p>';
63 $ret = preg_replace('/\n\s+\n/','</p><p>',$ret);
65 $bits = explode('```', $ret);
67 if (count($bits) > 1) {
68 $otag = $tag ='<br/><code style="white-space: pre">';
70 foreach($bits as $b) {
71 //if ($tag == '</code><br/>') {
72 // $b = preg_replace('/\n/', "<br/>\n", $b);
75 $tag = $tag == $otag ? '</code><br/>' : $otag;