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

Function run_ast_parser

code2flow/php.py:214–226  ·  view source on GitHub ↗

Parse the php file and return the output + the returncode Separate function b/c unittesting and asserting php-parser installation. :param filename str: :type: str, int

(filename)

Source from the content-addressed store, hash-verified

212
213
214def run_ast_parser(filename):
215 """
216 Parse the php file and return the output + the returncode
217 Separate function b/c unittesting and asserting php-parser installation.
218 :param filename str:
219 :type: str, int
220 """
221
222 script_loc = os.path.join(os.path.dirname(os.path.realpath(__file__)),
223 "get_ast.php")
224 cmd = ["php", script_loc, filename]
225 proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
226 return proc.communicate()[0], proc.returncode
227
228
229class PHP(BaseLanguage):

Callers 2

assert_dependenciesMethod · 0.85
get_treeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected