CodeDoc/Data/Method.php
[PHP_CodeDoc] / CodeDoc / Data / Method.php
index 19b51cb..28120f4 100644 (file)
@@ -95,10 +95,74 @@ class PHP_CodeDoc_Data_Method extends PHP_CodeDoc_Data {
         }    
         
         
-        return
+        $items = array(
+            array(
+                'name' => $this->name ,
+                'is_static' => $this->isStatic ? true:false,
+                'is_constructor' => $this->name == '__construct' ,
+                'memberof' => $this->class,
+                'returndesc' => $this->name == '_construct' ? '' : $this->description->return->desc,
+                'returntype' => $this->name == '_construct' ? '' : $this->description->return->type,
+                
+                '|xns' => 'Roo.doc',
+                'xtype' => 'Synopsis',
+                'items' => $params
+            ),
+            array(
+                'stype' => 'desc',
+                '|xns' => 'Roo.doc',
+                'xtype' => 'Section',
+                'items' => array(
+                    array(
+                        'html' => $this->description->long,
+                      '|xns' => 'Roo.doc',
+                       'xtype' => 'Para',
+                   )
+                )
+            ),
+            array(
+                'stype' => 'parameter',
+                '|xns' => 'Roo.doc',
+                'xtype' => 'Section',
+            ),
+          
+        );
+        
+        if ( $this->name != '__construct') {
+            $items[] = array(
+                'stype' => 'return',
+                '|xns' => 'Roo.doc',
+                'xtype' => 'Section',
+            );
+        }
+        if ( !empty($this->description->throws)) {
+           
+            $items[] = array(
+                'stype' => 'throws',
+                '|xns' => 'Roo.doc',
+                'xtype' => 'Section',
+                'items' => array(
+                    array(
+                        '|xns' => 'Roo.doc',
+                        'xtype' => 'para',
+                        'html' => $this->description->throws
+                    )
+                    
+                )
+            );
+        }
+        
         
-        array(
-            "name" => $this->name,
+                        /* -- fixme - needs to read from an example file..
+                        array(
+                            'stype' => 'example',
+                            '|xns' => 'Roo.doc',
+                            'xtype' => 'Section',
+                        )
+                        */
+        
+        return array(
+            "name" => $this->name ,
             "parent" => "",
             "title" => "",
             "permname" => "",
@@ -113,47 +177,10 @@ class PHP_CodeDoc_Data_Method extends PHP_CodeDoc_Data {
                     'stype' => 'function',
                     '|xns' => 'Roo.doc',
                     'xtype' => 'Entry',
-                    'isConstructor' => $this->name == '__construct' ,
-                    'items' => array(
-                        array(
-                            'name' => $this->name == '__construct' ? ('new ' . $this->class) : $this->name,
-                            'is_static' => $this->isStatic ? true:false,
-                            'memberof' => $this->class,
-                            'returndesc' => $this->name == '_construct' ? '' : $this->description->return->desc,
-                            'returntype' => $this->name == '_construct' ? '' : $this->description->return->type,
-                            
-                            '|xns' => 'Roo.doc',
-                            'xtype' => 'Synopsis',
-                            'items' => $params
-                        ),
-                        array(
-                            'stype' => 'desc',
-                            '|xns' => 'Roo.doc',
-                            'xtype' => 'Section',
-                            'items' => array(
-                                array(
-                                    'html' => $this->description->long,
-                                  '|xns' => 'Roo.doc',
-                                   'xtype' => 'Para',
-                               )
-                            )
-                        ),
-                        array(
-                            'stype' => 'parameter',
-                            '|xns' => 'Roo.doc',
-                            'xtype' => 'Section',
-                        ),
-                        array(
-                            'stype' => 'return',
-                            '|xns' => 'Roo.doc',
-                            'xtype' => 'Section',
-                        ),
-                        array(
-                            'stype' => 'example',
-                            '|xns' => 'Roo.doc',
-                            'xtype' => 'Section',
-                        )
-                    )   
+                    
+                    'items' => $items
+                         
+                    
                 )
             )
         );