cvs: php-gtk-doc /updater updateMethods.php

[email protected] ("Christian Weiske")
Newsgroups php.gtk.doc
Message-ID <cvscweiske1160580491@cvsserver>
cweiske		Wed Oct 11 15:28:11 2006 UTC

  Modified files:              
    /php-gtk-doc/updater	updateMethods.php 
  Log:
  - adding constructor: replace __construct name with classname
  - beautify when adding new <constructors> or <methods> tag
  
  
http://cvs.php.net/viewvc.cgi/php-gtk-doc/updater/updateMethods.php?r1=1.21&r2=1.22&diff_format=u
Index: php-gtk-doc/updater/updateMethods.php
diff -u php-gtk-doc/updater/updateMethods.php:1.21 php-gtk-doc/updater/updateMethods.php:1.22
--- php-gtk-doc/updater/updateMethods.php:1.21	Wed Oct 11 09:22:09 2006
+++ php-gtk-doc/updater/updateMethods.php	Wed Oct 11 15:28:10 2006
@@ -17,7 +17,6 @@
 *   - add/check properties
 *   - write no-<methods> and no-<constructors> testcase
 *   - testcase for adding constructor
-*   - adding constructor: replace __construct name with classname
 *
 *   Done:
 *   - add void if no return value (always since we cannot determine)
@@ -30,6 +29,7 @@
 *   - check parameters of already docced methods
 *       (void -> parameter, parameter count)
 *   - what happens if no <methods> tag exists?
+*   - adding constructor: replace __construct name with classname
 *
 *   @author Anant Narayanan <[email protected]>
 *   @author Christian Weiske <[email protected]>
@@ -218,7 +218,9 @@
             $xmlSynopsis    = $doc->createElement('funcsynopsis', "\n");
             $xmlPrototype   = $doc->createElement('funcprototype', "\n");
             $xmlFuncdef     = $doc->createElement('funcdef', $ismethod ? 'void ' : '');
-            if ($ismethod || $methodName == "__construct") {
+            if ($methodName == '__construct') {
+                $xmlFunction = $doc->createElement('function', $classname);
+            } else if ($ismethod) {
                 $xmlFunction = $doc->createElement('function', $methodName);
             } else {
                 //alternative constructors need Classname::new_* as funcname
@@ -284,7 +286,11 @@
                 // If there is no methods section, create one.
                 if ($topLevels->length == 0) {
                     $methods        = $doc->createElement('methods');
-                    $doc->getElementsByTagName('classentry')->item(0)->appendChild($methods);
+                    $classentry     = $doc->getElementsByTagName('classentry')->item(0);
+                    $classentry->appendChild($doc->createTextNode("\n\n "));
+                    $classentry->appendChild($methods);
+                    $classentry->appendChild($doc->createTextNode("\n"));
+                    $methods->appendChild($doc->createTextNode("\n"));
                     $topLevels       = $doc->getElementsByTagName('methods');
                 }
             } else {
@@ -294,7 +300,11 @@
                 // If there is no constructor section, create one.
                 if ($topLevels->length == 0) {
                     $constructors   = $doc->createElement('constructors');
-                    $doc->getElementsByTagName('classentry')->item(0)->appendChild($constructors);
+                    $classentry     = $doc->getElementsByTagName('classentry')->item(0);
+                    $classentry->appendChild($doc->createTextNode("\n\n "));
+                    $classentry->appendChild($constructors);
+                    $classentry->appendChild($doc->createTextNode("\n"));
+                    $constructors->appendChild($doc->createTextNode("\n"));
                     $topLevels       = $doc->getElementsByTagName('constructors');
                 }
             }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.