@@ -112,7 +112,8 @@ private function struct($node, $reset=FALSE, $parent=array())
112112 $ structs = array ();
113113 }
114114
115- $ kind = $ name = $ line = $ access = '' ;
115+ $ kind = $ name = $ line = $ access = $ extends = '' ;
116+ $ implements = array ();
116117
117118 if (!empty ($ parent )) array_push ($ scope , $ parent );
118119
@@ -123,6 +124,8 @@ private function struct($node, $reset=FALSE, $parent=array())
123124 } elseif ($ node instanceof PHPParser_Node_Stmt_Class) {
124125 $ kind = 'c ' ;
125126 $ name = $ node ->name ;
127+ $ extends = $ node ->extends ;
128+ $ implements = $ node ->implements ;
126129 $ line = $ node ->getLine ();
127130 foreach ($ node as $ subNode ) {
128131 $ this ->struct ($ subNode , FALSE , array ('class ' => $ name ));
@@ -221,6 +224,8 @@ private function struct($node, $reset=FALSE, $parent=array())
221224 'file ' => $ this ->mFile ,
222225 'kind ' => $ kind ,
223226 'name ' => $ name ,
227+ 'extends ' => $ extends ,
228+ 'implements ' => $ implements ,
224229 'line ' => $ line ,
225230 'scope ' => $ scope ,
226231 'access ' => $ access ,
@@ -321,6 +326,21 @@ private function render()
321326 $ str .= "\t" . $ s_str ;
322327 }
323328
329+ #field=i
330+ if (in_array ('i ' , $ this ->mOptions ['fields ' ])) {
331+ $ inherits = array ();
332+ if (!empty ($ struct ['extends ' ])) {
333+ $ inherits [] = $ struct ['extends ' ]->toString ();
334+ }
335+ if (!empty ($ struct ['implements ' ])) {
336+ foreach ($ struct ['implements ' ] as $ interface ) {
337+ $ inherits [] = $ interface ->toString ();
338+ }
339+ }
340+ if (!empty ($ inherits ))
341+ $ str .= "\t" . 'inherits: ' . implode (', ' , $ inherits );
342+ }
343+
324344 #field=a
325345 if (in_array ('a ' , $ this ->mOptions ['fields ' ]) && !empty ($ struct ['access ' ])) {
326346 $ str .= "\t" . "access: " . $ struct ['access ' ];
0 commit comments