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)
| 212 | |
| 213 | |
| 214 | def 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 | |
| 229 | class PHP(BaseLanguage): |
no outgoing calls
no test coverage detected