Skip to content

Code Coverage

Collect and view PHP code coverage data in real-time.

Code Coverage

What It Shows

FieldDescription
DriverCoverage driver in use (pcov or xdebug)
Total filesNumber of files with coverage data
Covered linesLines executed during the request
Executable linesTotal lines that can be executed
PercentageOverall coverage percentage

Per-File Coverage

Click a file to see line-by-line coverage highlighting — which lines were executed (green) and which were missed (red).

API Endpoints

MethodPathDescription
GET/inspect/api/coverageCollect coverage data with per-file stats
GET/inspect/api/coverage/file?path=/src/Service.phpRead source file for coverage display

Requirements

Requires one of:

  • PCOV extension (recommended, lightweight)
  • Xdebug extension with coverage mode enabled

WARNING

Code coverage collection adds overhead. Enable only during development/testing.

Released under the MIT License.