Patch bugs #49005 and #49006
| From: | Moacir de Oliveira | Date: | Thu, 23 Jul 2009 15:34:18 +0000 |
| Subject: | Patch bugs #49005 and #49006 | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969380680@lists.php.net to get a copy of this message | ||
Patch for the bugs:
http://bugs.php.net/bug.php?id=49006
http://bugs.php.net/bug.php?id=49005
Index: phpdotnet/phd/Package/Default/Manpage.php =================================================================== --- phpdotnet/phd/Package/Default/Manpage.php (revision 284228) +++ phpdotnet/phd/Package/Default/Manpage.php (working copy) @@ -100,7 +100,7 @@ 'paramdef' => 'format_suppressed_tags', 'parameter' => array( /* DEFAULT */ 'format_suppressed_tags', - 'methodparam' => 'format_suppressed_tags', + 'methodparam' => 'format_parameter_method', 'code' => '\\fI', ), 'productname' => 'format_suppressed_tags', @@ -303,7 +303,7 @@ } public function format_parameter_text($value, $tag) { - return "\n\\fI$" . $value . "\\fP"; + return "\n\\fI" . ((isset($value[0]) && $value[0] == "$") ? "" : "$") . $value . "\\fP"; } public function format_parameter_term_text($value, $tag) { @@ -379,7 +379,8 @@ "optional" => $opt, "type" => "", "name" => "", - "initializer" => ""); + "initializer" => "", + "reference" => false); } return ""; } @@ -390,7 +391,8 @@ "optional" => false, "type" => "void", "name" => "", - "initializer" => ""); + "initializer" => "", + "reference" => false); } return ""; } @@ -400,6 +402,13 @@ return ""; } + public function format_parameter_method($open, $name, $attrs, $props) { + if ($open && isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) && $attrs[Reader::XMLNS_DOCBOOK]["role"] == "reference") { + $this->cchunk['methodsynopsis']['params'][count($this->cchunk['methodsynopsis']['params'])-1]['reference'] = true; + } + return ""; + } + public function format_parameter_method_text($value, $tag) { $this->cchunk['methodsynopsis']['params'][count($this->cchunk['methodsynopsis']['params'])-1]['name'] = $value; return ""; @@ -430,9 +439,14 @@ return "\n.br"; $params = array(); // write the formatted synopsis - foreach ($this->cchunk['methodsynopsis']['params'] as $parameter) - array_push( $params, ($parameter['optional'] ? "[" : "") . $parameter['type'] . - ($parameter['name'] ? " \\fI$" . $parameter['name'] . "\\fP" : "") . ($parameter['initializer'] ? " = " . $parameter['initializer'] : "") . ($parameter['optional'] ? "]" : "") ); + foreach ($this->cchunk['methodsynopsis']['params'] as $parameter) { + array_push($params, ($parameter['optional'] ? "[" : "") + . $parameter['type'] + . ($parameter['reference'] ? " \\fI&\\fP" : " ") + . ($parameter['name'] ? "\\fI$" . $parameter['name'] . "\\fP" : "") + . ($parameter['initializer'] ? " = " . $parameter['initializer'] : "") + . ($parameter['optional'] ? "]" : "") ); + } $ret = "\n(" . join($params, ", ") . ")"; $this->cchunk['methodsynopsis']['params'] = array();
Index: phpdotnet/phd/Package/Default/Manpage.php =================================================================== --- phpdotnet/phd/Package/Default/Manpage.php (revision 284228) +++ phpdotnet/phd/Package/Default/Manpage.php (working copy) @@ -100,7 +100,7 @@ 'paramdef' => 'format_suppressed_tags', 'parameter' => array( /* DEFAULT */ 'format_suppressed_tags', - 'methodparam' => 'format_suppressed_tags', + 'methodparam' => 'format_parameter_method', 'code' => '\\fI', ), 'productname' => 'format_suppressed_tags', @@ -303,7 +303,7 @@ } public function format_parameter_text($value, $tag) { - return "\n\\fI$" . $value . "\\fP"; + return "\n\\fI" . ((isset($value[0]) && $value[0] == "$") ? "" : "$") . $value . "\\fP"; } public function format_parameter_term_text($value, $tag) { @@ -379,7 +379,8 @@ "optional" => $opt, "type" => "", "name" => "", - "initializer" => ""); + "initializer" => "", + "reference" => false); } return ""; } @@ -390,7 +391,8 @@ "optional" => false, "type" => "void", "name" => "", - "initializer" => ""); + "initializer" => "", + "reference" => false); } return ""; } @@ -400,6 +402,13 @@ return ""; } + public function format_parameter_method($open, $name, $attrs, $props) { + if ($open && isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) && $attrs[Reader::XMLNS_DOCBOOK]["role"] == "reference") { + $this->cchunk['methodsynopsis']['params'][count($this->cchunk['methodsynopsis']['params'])-1]['reference'] = true; + } + return ""; + } + public function format_parameter_method_text($value, $tag) { $this->cchunk['methodsynopsis']['params'][count($this->cchunk['methodsynopsis']['params'])-1]['name'] = $value; return ""; @@ -430,9 +439,14 @@ return "\n.br"; $params = array(); // write the formatted synopsis - foreach ($this->cchunk['methodsynopsis']['params'] as $parameter) - array_push( $params, ($parameter['optional'] ? "[" : "") . $parameter['type'] . - ($parameter['name'] ? " \\fI$" . $parameter['name'] . "\\fP" : "") . ($parameter['initializer'] ? " = " . $parameter['initializer'] : "") . ($parameter['optional'] ? "]" : "") ); + foreach ($this->cchunk['methodsynopsis']['params'] as $parameter) { + array_push($params, ($parameter['optional'] ? "[" : "") + . $parameter['type'] + . ($parameter['reference'] ? " \\fI&\\fP" : " ") + . ($parameter['name'] ? "\\fI$" . $parameter['name'] . "\\fP" : "") + . ($parameter['initializer'] ? " = " . $parameter['initializer'] : "") + . ($parameter['optional'] ? "]" : "") ); + } $ret = "\n(" . join($params, ", ") . ")"; $this->cchunk['methodsynopsis']['params'] = array();