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.
Architecture fit: Well-suited for Laravel’s ecosystem due to Artisan command integration and native support for Laravel directory structures. The package’s repository (cmgmyr/phploc) is now confirmed public, resolving prior legitimacy concerns. However, the package’s primary purpose (PHPLOC analysis) is orthogonal to Laravel’s core workflows, limiting direct architectural synergy.
Integration feasibility: Low friction for installation via Composer (publicly available on Packagist). Minimal code changes required, but integration depends on the Laravel app’s need for static analysis metrics (e.g., cyclomatic complexity, lines of code). No breaking changes in 8.0.7; revert of a foreach modification suggests stability focus.
Technical risk: Medium (previously high). The package is actively maintained (recent commits, contributors), but:
sebastianbergmann/phploc (v8.x), which may introduce version conflicts if the Laravel app uses older SebastianBergmann tools.phploc itself is a static analysis tool—risk lies in false positives/negatives in Laravel-specific codebases.Key questions:
Stack fit: Strong for analysis workflows but not a core Laravel dependency. Ideal for:
Migration path:
composer.json:
"require": {
"cmgmyr/phploc": "^8.0"
}
php artisan phploc:report [--path=app] [--output=storage/logs/phploc.json]
Compatibility:
phploc v8.x).sebastianbergmann/phploc v8.x is stable but may pull in older phpunit/phpunit versions—audit for conflicts.Sequencing:
--dry-run flag.Maintenance:
phploc upstream changes (e.g., new CLI flags) that may require Laravel wrapper updates.Support:
phploc GitHub issues.resources/views).Scaling:
Failure modes:
sebastianbergmann/phploc may pull in older phpunit versions.phploc:report.Ramp-up:
vendor/, node_modules/).Log::info()).How can I help you explore Laravel packages today?