hholzgra Sun Jan 15 00:14:17 2006 UTC
Modified files:
/phpdoc/scripts zendapi_protos.php
Log:
special treatment of 'void' and magic *_D and *_DC parameters
http://cvs.php.net/viewcvs.cgi/phpdoc/scripts/zendapi_protos.php?r1=1.19&r2=1.20&diff_format=u
Index: phpdoc/scripts/zendapi_protos.php
diff -u phpdoc/scripts/zendapi_protos.php:1.19
phpdoc/scripts/zendapi_protos.php:1.20
--- phpdoc/scripts/zendapi_protos.php:1.19 Sat Jan 14 23:21:53 2006
+++ phpdoc/scripts/zendapi_protos.php Sun Jan 15 00:14:17 2006
@@ -81,10 +81,16 @@
$tokens = preg_split("/\s+/", trim($param));
$name = array_pop($tokens);
+ if (preg_match("|_DC$|", $name)) {
+ $magic = $name;
+ $name = array_pop($tokens);
+ } else {
+ $magic = "";
+ }
$type = implode(" ", $tokens);
if (empty($name)) {
- $new_param['type'] = "";
+ $new_param['type'] = "magic";
$new_param['name'] = $type;
} else {
while ($name[0] == '*') {
@@ -95,6 +101,10 @@
$new_param['name'] = $name;
}
$params[] = $new_param;
+
+ if ($magic) {
+ $params[] = array("type"=>"magic", "name"=>$magic);
+ }
}
@@ -109,10 +119,20 @@
&reftitle.description;
<literallayout>#include <<?php echo basename($infile);
?>></literallayout>
<methodsynopsis>
- <type><?php echo $return_type; ?></type><methodname><?php echo $function;
?></methodname>
-<?php
- foreach($params as $param) {
- echo "
<methodparam><type>$param[type]</type><parameter>$param[name]</parameter></methodparam>\n";
+<?php
+ if ($return_type == "void") {
+ echo "<void/>";
+ } else {
+ echo "<type>$return_type</type>";
+ }
+ echo "<methodname>$function;</methodname>";
+ if (count($params)) {
+ echo "\n";
+ foreach($params as $param) {
+ echo "
<methodparam><type>$param[type]</type><parameter>$param[name]</parameter></methodparam>\n";
+ }
+ } else {
+ echo "<void/>\n";
}
?>
</methodsynopsis>