sebastian/lines-of-code
Count lines of code in PHP source with sebastian/lines-of-code. A lightweight library for analyzing PHP files and reporting LOC metrics, useful for tooling, CI checks, and development workflows. Install easily via Composer as a runtime or dev dependency.
cloc or tokei).phpstan/extension-installer or phpmetrics).*"This open-source tool gives us data-driven control over codebase growth—critical for scaling our engineering team without sacrificing quality. By integrating LOC metrics into our CI pipeline, we can:
*"This package lets us stop guessing about codebase health. We can:
*"Tired of manually counting lines of code in PRs? Or want to automate LOC checks in your CI? This tool gives you:
composer require sebastian/lines-of-code and call Counter::count().src/’).
No setup, no dependencies—just reliable metrics for your workflow. Perfect for:
✅ PR reviews (e.g., ‘This adds 300 LOC—is it worth it?’)
✅ CI checks (e.g., ‘Fail if LOC > 500’)
✅ Local scripts (e.g., php artisan loc:count --dir=src)"*"This tool helps us balance speed and quality by:
How can I help you explore Laravel packages today?