svn: /phd/branches/PHD_0_4/formats/ manpage.php

From: Date: Mon, 27 Jul 2009 14:52:48 +0000
Subject: svn: /phd/branches/PHD_0_4/formats/ manpage.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-4528@lists.php.net to get a copy of this message
moacir Mon, 27 Jul 2009 14:52:48 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=286414 Log: fixing bugs #49005 and #49006 Bugs: http://bugs.php.net/49005 (Closed) Reference sign missing http://bugs.php.net/49006 (Closed) Wrong argument grouping Changed paths: U phd/branches/PHD_0_4/formats/manpage.php Modified: phd/branches/PHD_0_4/formats/manpage.php =================================================================== --- phd/branches/PHD_0_4/formats/manpage.php 2009-07-27 14:43:32 UTC (rev 286413) +++ phd/branches/PHD_0_4/formats/manpage.php 2009-07-27 14:52:48 UTC (rev 286414) @@ -67,7 +67,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', @@ -273,9 +273,16 @@ } 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_method($open, $name, $attrs, $props) { + if ($open && isset($attrs[PhDReader::XMLNS_DOCBOOK]["role"]) && $attrs[PhDReader::XMLNS_DOCBOOK]["role"] == "reference") { + $this->cchunk['methodsynopsis']['params'][count($this->cchunk['methodsynopsis']['params'])-1]['reference'] = true; + } + return ""; + } + public function format_parameter_term_text($value, $tag) { return "\n\\fI$" . $value . "\\fP\n\-"; } @@ -349,7 +356,9 @@ "optional" => $opt, "type" => "", "name" => "", - "initializer" => ""); + "initializer" => "", + "reference" => false, + ); } return ""; } @@ -360,7 +369,9 @@ "optional" => false, "type" => "void", "name" => "", - "initializer" => ""); + "initializer" => "", + "reference" => false, + ); } return ""; } @@ -400,9 +411,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();

« previous php.doc.cvs (#4528) next »