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

Function handlerIn

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

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