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

Function phpOwnMethods

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

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