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

Function handlerIn

src/resolution/frameworks/codeigniter.ts:215–218  ·  view source on GitHub ↗

The method the segment after a controller names, `index` when none does, and the class when a variable does.

(cls: Node, segments: readonly string[], at: number, context: ResolutionContext)

Source from the content-addressed store, hash-verified

213
214/** The method the segment after a controller names, `index` when none does, and the class when a variable does. */
215function handlerIn(cls: Node, segments: readonly string[], at: number, context: ResolutionContext): Node {
216 const segment = segments[at] ?? 'index';
217 return (segment.includes('$') ? null : methodOf(cls, segment, context)) ?? cls;
218}
219
220/** What `controller/method/$1` serves: the first run of segments that names a controller, then the method after it. */
221function routeHandler(root: string, uri: string, context: ResolutionContext): Node | null {

Callers 1

routeHandlerFunction · 0.85

Calls 1

methodOfFunction · 0.70

Tested by

no test coverage detected