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

Function controller

__tests__/laravel-controller-strings.test.ts:18–26  ·  view source on GitHub ↗
(ns: string, name: string, methods: string[])

Source from the content-addressed store, hash-verified

16let cg: CodeGraph;
17
18const controller = (ns: string, name: string, methods: string[]) => `<?php
19
20namespace App\\Http\\Controllers\\${ns};
21
22class ${name}
23{
24${methods.map((m) => ` public function ${m}() { return 1; }`).join('\n')}
25}
26`;
27
28beforeAll(async () => {
29 root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-laravel-strings-'));

Calls 2

mapMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected