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

Function propertyClass

src/resolution/frameworks/codeigniter.ts:269–279  ·  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

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