MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / propertyClass

Function propertyClass

src/resolution/frameworks/codeigniter.ts:271–281  ·  view source on GitHub ↗

The class a property holds in `file`: by its own name, or by the alias a load there gave it.

(property: string, file: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

269
270/** The class a property holds in `file`: by its own name, or by the alias a load there gave it. */
271function propertyClass(property: string, file: string, context: ResolutionContext): Node | null {
272 const table = classTable(context);
273 const alias = table.loadable.has(property.toLowerCase()) ? undefined : aliasesIn(file, table, context).get(property);
274 const classes = table.loadable.get(alias ?? property.toLowerCase());
275 if (!classes) return null;
276 if (classes.length === 1) return classes[0]!;
277 // One name in two HMVC modules: the caller's own, and no guess past that.
278 const module = MODULE_OF.exec(file)?.[1];
279 const own = module ? classes.filter((c) => MODULE_OF.exec(c.filePath)?.[1] === module) : [];
280 return own.length === 1 ? own[0]! : null;
281}
282
283export const codeigniterResolver: FrameworkResolver = {
284 name: 'codeigniter',

Callers 1

resolveFunction · 0.85

Calls 5

classTableFunction · 0.85
aliasesInFunction · 0.85
hasMethod · 0.80
getMethod · 0.65
execMethod · 0.65

Tested by

no test coverage detected