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

Function phpOwnMethods

src/resolution/import-resolver.ts:2927–2934  ·  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

2925 * any letter case, since PHP reads method names without regard to it (#3297).
2926 */
2927function phpOwnMethods(owner: Node, member: string, context: ResolutionContext): Node[] {
2928 const exact = context.getNodesByQualifiedName(`${owner.qualifiedName}::${member}`)
2929 .filter((n) => n.language === 'php' && n.kind === 'method' && n.filePath === owner.filePath);
2930 if (exact.length > 0) return exact;
2931 const want = `${owner.qualifiedName}::${member}`.toLowerCase();
2932 return context.getNodesInFile(owner.filePath)
2933 .filter((n) => n.language === 'php' && n.kind === 'method' && n.qualifiedName.toLowerCase() === want);
2934}
2935
2936/**
2937 * 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