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

Function phpOwnMethods

src/resolution/import-resolver.ts:3175–3182  ·  view source on GitHub ↗

* The methods a PHP class declares as `member`: spelled exactly so, else in * any letter case, since PHP reads method names without regard to it (#3297).

(owner: Node, member: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

3173 * any letter case, since PHP reads method names without regard to it (#3297).
3174 */
3175function phpOwnMethods(owner: Node, member: string, context: ResolutionContext): Node[] {
3176 const exact = context.getNodesByQualifiedName(`${owner.qualifiedName}::${member}`)
3177 .filter((n) => n.language === 'php' && n.kind === 'method' && n.filePath === owner.filePath);
3178 if (exact.length > 0) return exact;
3179 const want = `${owner.qualifiedName}::${member}`.toLowerCase();
3180 return context.getNodesInFile(owner.filePath)
3181 .filter((n) => n.language === 'php' && n.kind === 'method' && n.qualifiedName.toLowerCase() === want);
3182}
3183
3184/**
3185 * A module specifier written as a path — relative (`./x`, `../x`), rooted, or

Callers 2

Calls 2

getNodesInFileMethod · 0.65

Tested by

no test coverage detected