- Can I use this package directly in a Laravel application as a Composer dependency?
- No, this package is not designed for Composer installation. It’s a fork of phploc to support `wnx/laravel-stats` compatibility. Use the official PHAR or Phive instead, as recommended by Sebastian Bergmann.
- How do I integrate phploc metrics into a Laravel dashboard?
- You’ll need to run the PHAR via `shell_exec()` or an Artisan command, parse the JSON/XML output (if using `--log-json`), and store results in a database. For Laravel-specific dashboards, consider using `wnx/laravel-stats` instead.
- What Laravel versions does this package support?
- This fork doesn’t explicitly guarantee Laravel version support. It focuses on compatibility with `wnx/laravel-stats` by supporting multiple `sebastian/version` releases, but test thoroughly in your environment.
- Is this package safe to use in production?
- No, the package explicitly warns against production use. It’s a static analysis tool for CI/CD, local development, or non-critical environments. Avoid runtime dependencies in production.
- How do I run phploc in a Laravel CI/CD pipeline?
- Add a step to execute the PHAR (e.g., `php phploc.phar src --log-json`) and parse the output. Use it to enforce thresholds (e.g., fail builds if complexity exceeds limits) or log trends over time.
- What PHP versions are supported by this fork?
- This fork drops support for PHP <8.0. Ensure your Laravel app runs on PHP 8.0+ to avoid compatibility issues with the underlying phploc tool.
- How do I handle phploc’s CLI output in Laravel?
- Use `shell_exec()` or `Artisan::command()` to run the PHAR, then parse the JSON output (if using `--log-json`) or regex-scrape the CLI output. Store results in a database or log them for later analysis.
- What’s the difference between this fork and the original phploc?
- This fork is only for maintaining compatibility with `wnx/laravel-stats` across Laravel versions. The original phploc (PHAR) is actively maintained and recommended for standalone use.
- Can I use this package to track real-time metrics in a Laravel app?
- No, phploc is a batch-process tool for static analysis, not real-time metrics. Run it periodically (e.g., via Laravel scheduler or CI/CD) and cache results for dashboard display.
- Who maintains this fork, and how often is it updated?
- This fork is maintained by Stefan Zweifel for `wnx/laravel-stats` compatibility but isn’t actively updated. Monitor the repository for changes or rely on the upstream phploc for long-term stability.