MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / get_inherits

Function get_inherits

code2flow/php.py:195–211  ·  view source on GitHub ↗

Get the various types of inheritances this class/namespace/trait can have :param tree ast: :rtype: list[str]

(tree)

Source from the content-addressed store, hash-verified

193
194
195def get_inherits(tree):
196 """
197 Get the various types of inheritances this class/namespace/trait can have
198
199 :param tree ast:
200 :rtype: list[str]
201 """
202 ret = []
203
204 if tree.get('extends', {}):
205 ret.append(djoin(tree['extends']['parts']))
206
207 for stmt in tree.get('stmts', []):
208 if stmt['nodeType'] == 'Stmt_TraitUse':
209 for trait in stmt['traits']:
210 ret.append(djoin(trait['parts']))
211 return ret
212
213
214def run_ast_parser(filename):

Callers 1

make_class_groupMethod · 0.70

Calls 1

djoinFunction · 0.85

Tested by

no test coverage detected