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

Function extract

src/resolution/frameworks/drupal.ts:825–845  ·  view source on GitHub ↗
(filePath: string, content: string)

Source from the content-addressed store, hash-verified

823 },
824
825 extract(filePath: string, content: string): { nodes: Node[]; references: UnresolvedRef[] } {
826 if (filePath.endsWith('.routing.yml')) {
827 return extractDrupalRoutes(filePath, content);
828 }
829
830 if (filePath.endsWith('.services.yml')) {
831 return extractDrupalServices(filePath, content);
832 }
833
834 if (isDrupalHookFile(filePath) || filePath.endsWith('.php')) {
835 const hooks = extractDrupalHooks(filePath, content);
836 const declarations = content.includes('#[') ? attributedDeclarations(content) : [];
837 const plugins = extractDrupalPlugins(filePath, content, declarations);
838 return {
839 nodes: plugins.nodes,
840 references: [...hooks.references, ...oopHookReferences(filePath, content, declarations), ...plugins.references],
841 };
842 }
843
844 return { nodes: [], references: [] };
845 },
846};

Callers

nothing calls this directly

Calls 7

extractDrupalRoutesFunction · 0.85
extractDrupalServicesFunction · 0.85
isDrupalHookFileFunction · 0.85
extractDrupalHooksFunction · 0.85
attributedDeclarationsFunction · 0.85
extractDrupalPluginsFunction · 0.85
oopHookReferencesFunction · 0.85

Tested by

no test coverage detected