PHP qualified names use "." in the graph (project.path.module.class[.method]). * Convert "App\\Models\\User" to "App.Models.User" so we can compose with * module_qn (which already uses ".") and look up registry entries. */
| 91 | * Convert "App\\Models\\User" to "App.Models.User" so we can compose with |
| 92 | * module_qn (which already uses ".") and look up registry entries. */ |
| 93 | static char *php_ns_to_dot(CBMArena *a, const char *ns) { |
| 94 | if (!ns) |
| 95 | return NULL; |
| 96 | size_t n = strlen(ns); |
| 97 | char *out = (char *)cbm_arena_alloc(a, n + 1); |
| 98 | if (!out) |
| 99 | return NULL; |
| 100 | for (size_t i = 0; i < n; i++) { |
| 101 | char c = ns[i]; |
| 102 | out[i] = (c == '\\') ? '.' : c; |
| 103 | } |
| 104 | out[n] = '\0'; |
| 105 | /* Trim leading dot from "\\Foo". */ |
| 106 | if (out[0] == '.') |
| 107 | return out + 1; |
| 108 | return out; |
| 109 | } |
| 110 | |
| 111 | /* Return the substring after the last '.' or '\\'. */ |
| 112 | static const char *php_short_name(const char *qn) { |
no test coverage detected