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

Method assert_dependencies

code2flow/php.py:231–241  ·  view source on GitHub ↗

Assert that php and php-parser are installed

()

Source from the content-addressed store, hash-verified

229class PHP(BaseLanguage):
230 @staticmethod
231 def assert_dependencies():
232 """Assert that php and php-parser are installed"""
233 assert is_installed('php'), "No php installation could be found"
234 self_ref = os.path.join(os.path.dirname(os.path.realpath(__file__)),
235 "get_ast.php")
236 outp, returncode = run_ast_parser(self_ref)
237 path = os.path.dirname(os.path.realpath(__file__))
238 assert_msg = 'Error running the PHP parser. From the `%s` directory, run ' \
239 '`composer require nikic/php-parser "^4.10"`.' % path
240 assert not returncode, assert_msg
241 return outp
242
243 @staticmethod
244 def get_tree(filename, lang_params):

Callers 1

map_itFunction · 0.45

Calls 2

is_installedFunction · 0.85
run_ast_parserFunction · 0.85

Tested by

no test coverage detected