cmgmyr/phploc
Laravel-friendly wrapper around phpLOC for measuring PHP project size and structure. Generate lines-of-code, classes, methods, complexity-style stats from the command line or within builds to quickly gauge codebase scope and trends.
composer require --dev cmgmyr/phplocphp artisan phploc — this outputs key metrics (LOC, classes, methods, functions, files) for your current Laravel project.app/, routes/, and database/ directories, which covers most Laravel code.php artisan phploc during development to get immediate feedback on code growth — e.g., after adding a big feature or refactoring.php artisan phploc --ci) to capture metrics over time. Use the --log-csv or --log-json options to export results (e.g., php artisan phploc --log-json=phploc-report.json) for reporting or trend dashboards.phploc-summary.txt) and compare across branches or commits with git diff.php artisan vendor:publish --provider="Cmgmyr\Phploc\PhplocServiceProvider") to exclude tests (tests/) or include config/ or database/ more explicitly.phploc CLI to be installed globally (e.g., via PHAR or Composer) — ensure it’s on $PATH. The Artisan command fails if not found; check via phploc --version outside Laravel.artisan runs). If you use php artisan phploc from a subdirectory (e.g., app/Console), use cd .. && php artisan phploc or configure paths explicitly in config.storage/ and bootstrap/cache/ to your phploc.php config (or pass --exclude) to avoid counting auto-generated files and logs — those bloat LOC without meaningful metrics.--min-coverage=0 (or omit coverage-related flags) — Laravel apps rarely track test coverage in pure LOC analysis; leaving defaults may cause phploc to fail if no coverage data exists.php artisan phploc --log-csv=phploc-latest.csv --exclude=tests → append to a rolling log for trend analysis.How can I help you explore Laravel packages today?