Get the various types of inheritances this class/namespace/trait can have :param tree ast: :rtype: list[str]
(tree)
| 193 | |
| 194 | |
| 195 | def 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 | |
| 214 | def run_ast_parser(filename): |
no test coverage detected