@@ -111,7 +111,8 @@ private function struct($node, $reset=FALSE, $parent=array())
111111 $ structs = array ();
112112 }
113113
114- $ kind = $ name = $ line = $ access = '' ;
114+ $ kind = $ name = $ line = $ access = $ extends = '' ;
115+ $ implements = array ();
115116
116117 if (!empty ($ parent )) array_push ($ scope , $ parent );
117118
@@ -122,6 +123,8 @@ private function struct($node, $reset=FALSE, $parent=array())
122123 } elseif ($ node instanceof PHPParser_Node_Stmt_Class) {
123124 $ kind = 'c ' ;
124125 $ name = $ node ->name ;
126+ $ extends = $ node ->extends ;
127+ $ implements = $ node ->implements ;
125128 $ line = $ node ->getLine ();
126129 foreach ($ node as $ subNode ) {
127130 $ this ->struct ($ subNode , FALSE , array ('class ' => $ name ));
@@ -218,6 +221,8 @@ private function struct($node, $reset=FALSE, $parent=array())
218221 'file ' => $ this ->mFile ,
219222 'kind ' => $ kind ,
220223 'name ' => $ name ,
224+ 'extends ' => $ extends ,
225+ 'implements ' => $ implements ,
221226 'line ' => $ line ,
222227 'scope ' => $ scope ,
223228 'access ' => $ access ,
@@ -298,6 +303,21 @@ private function render()
298303 $ str .= "\t" . $ scope ;
299304 }
300305
306+ #field=i
307+ if (in_array ('i ' , $ this ->mOptions ['fields ' ])) {
308+ $ inherits = array ();
309+ if (!empty ($ struct ['extends ' ])) {
310+ $ inherits [] = $ struct ['extends ' ]->toString ();
311+ }
312+ if (!empty ($ struct ['implements ' ])) {
313+ foreach ($ struct ['implements ' ] as $ interface ) {
314+ $ inherits [] = $ interface ->toString ();
315+ }
316+ }
317+ if (!empty ($ inherits ))
318+ $ str .= "\t" . 'inherits: ' . implode (', ' , $ inherits );
319+ }
320+
301321 #field=a
302322 if (in_array ('a ' , $ this ->mOptions ['fields ' ]) && !empty ($ struct ['access ' ])) {
303323 $ str .= "\t" . "access: " . $ struct ['access ' ];
0 commit comments