MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / php_use_shape

Function php_use_shape

src/pipeline/pass_pkgmap.c:2624–2645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2622}
2623
2624static php_use_shape_t php_use_shape(const char *source_rel, const CBMImport *imp) {
2625 if (!source_rel || cbm_language_for_filename(path_leaf(source_rel)) != CBM_LANG_PHP) {
2626 return PHP_USE_NONE;
2627 }
2628 const char *p = imp->module_path;
2629 if (p[0] == '\\') {
2630 p++;
2631 }
2632 if (!p[0]) {
2633 return PHP_USE_NONE;
2634 }
2635 bool qualified = false;
2636 for (; *p; p++) {
2637 unsigned char c = (unsigned char)*p;
2638 if (c == '\\') {
2639 qualified = true;
2640 } else if (!php_ident_byte(c)) {
2641 return PHP_USE_NONE;
2642 }
2643 }
2644 return qualified ? PHP_USE_NAMESPACED : PHP_USE_GLOBAL;
2645}
2646
2647/* The next usable file of a namespace-map bucket (a '\n'-delimited list of
2648 * __file__ QNs): a PHP File node that is not the importing file. Advances

Callers 2

php_import_known_absentFunction · 0.85

Calls 3

path_leafFunction · 0.85
php_ident_byteFunction · 0.85

Tested by

no test coverage detected