stop_coverage
Stop tracking code coverage in PHP debugging and generate the coverage report for analysis.
Instructions
Stop tracking code coverage and get the report
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/advanced.ts:457-475 (registration)Registration of the 'stop_coverage' MCP tool using server.tool(), including schema (empty input) and handler function.server.tool( 'stop_coverage', 'Stop tracking code coverage and get the report', {}, async () => { ctx.coverageTracker.stopTracking(); const summary = ctx.coverageTracker.getSummary(); const report = ctx.coverageTracker.generateReport(); return { content: [ { type: 'text', text: JSON.stringify({ summary, report }, null, 2), }, ], }; } );
- src/tools/advanced.ts:461-474 (handler)The handler function that executes the tool logic: stops coverage tracking, retrieves summary and report, and returns them as JSON.async () => { ctx.coverageTracker.stopTracking(); const summary = ctx.coverageTracker.getSummary(); const report = ctx.coverageTracker.generateReport(); return { content: [ { type: 'text', text: JSON.stringify({ summary, report }, null, 2), }, ], }; }
- src/session/code-coverage.ts:50-61 (helper)Core stopTracking() method in CodeCoverageTracker class, which finalizes the coverage report by setting end time, stopping tracking, updating stats, and returning the report.stopTracking(): CoverageReport | null { if (!this.currentReport) return null; this.currentReport.endedAt = new Date(); this.isTracking = false; // Calculate final statistics this.updateStatistics(); logger.info('Code coverage tracking stopped'); return this.currentReport; }