(context: ResolutionContext)
| 289 | }, |
| 290 | |
| 291 | detect(context: ResolutionContext): boolean { |
| 292 | if (context.fileExists('system/core/CodeIgniter.php')) return true; |
| 293 | // `system/` is often a Composer package, and `application/` can sit below the |
| 294 | // repository root. A CodeIgniter routes file names its default controller. |
| 295 | const routes = context.getAllFiles().find((file) => file.endsWith('application/config/routes.php')); |
| 296 | return routes !== undefined && /\$route\s*\[\s*['"]default_controller['"]\s*\]/.test(context.readFile(routes) ?? ''); |
| 297 | }, |
| 298 | |
| 299 | resolve(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null { |
| 300 | const name = ref.referenceName; |
nothing calls this directly
no test coverage detected