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.
app/, routes/, database/ directories by default).php artisan phploc).sebastianbergmann/phploc (now forked as cmgmyr/phploc), which may introduce backward compatibility risks if the fork diverges.require --dev cmgmyr/phploc integration.sebastianbergmann/phploc’s original CLI.vendor/ directory might be excluded by default (requires --exclude flags).cmgmyr/phploc is a recent fork (2024) of sebastianbergmann/phploc, which may introduce untested changes or dependency drift.composer.json to avoid updates ("cmgmyr/phploc": "8.0.7").sebastianbergmann/phploc (last updated 2023) if cmgmyr/ is unreliable.cmgmyr/phploc a trusted fork, or is it abandoned/unmaintained?composer show cmgmyr/phploc)?Illuminate\Support\) correctly?app/Providers/ or config/ analysis)?php artisan phploc).LOC > threshold).composer require --dev cmgmyr/phploc.app/, routes/, and database/).wc -l app/*.php) for accuracy..github/workflows/ci.yml:
- name: Run PHPLOC
run: php artisan phploc --log-junit > phploc-report.xml
LOC > 50K).phploc_metrics table).$output = shell_exec('php artisan phploc --log-json');
$metrics = json_decode($output, true);
// Save to DB...
cmgmyr/phploc fails, use the original sebastianbergmann/phploc (v8.0.6) with:
composer require sebastianbergmann/phploc:^8.0
./vendor/bin/phploc app/
| Factor | Compatibility | Risk |
|---|---|---|
| Laravel Versions | Tested on Laravel 8+ (PHP 7.4–8.0). May fail on Laravel 5.7 (PHP 7.1). | Medium |
| PHP Versions | Supports 7.4–8.0 (aligns with Laravel 8–10). | Low |
| Directory Structure | Auto-detects app/, routes/, database/. Custom paths require --exclude. |
Low (configurable) |
| CI Systems | Works with GitHub Actions, GitLab CI, Jenkins. | Low |
| Monorepos | May miscount if multiple Laravel apps share a vendor/ directory. |
High (requires --exclude) |
| Windows/Linux/macOS | CLI tool; path separators may cause issues on Windows. | Medium |
LOC > 10% growth).How can I help you explore Laravel packages today?