- Does PHP VarDump Check work with Laravel 10.x and PHP 8.2+?
- No, this package is abandoned and lacks PHP 8.x or Laravel 10.x support. The original repo hasn’t been updated since 2018, so you’ll need to fork and modernize it or use an alternative like PHPStan with custom rules. Test thoroughly if you attempt to adapt it.
- How do I install PHP VarDump Check for Laravel projects?
- Add it as a dev dependency via Composer: `composer require-dev jakub-onderka/php-var-dump-check:^0.3`. For Laravel-specific checks, use the `--laravel` flag. Install `jakub-onderka/php-console-highlighter` separately for colored output.
- Can I exclude specific directories (e.g., tests, staging) from scans?
- Yes, use the `--exclude` flag to skip directories. For example, `--exclude vendor --exclude tests` ignores those folders. This helps avoid false positives in non-production code.
- Will this tool detect Laravel’s `dd()` and `dump()` functions?
- Yes, the `--laravel` flag explicitly checks for `dd()` and `dump()` calls. It also supports Blade templates if you include `.blade.php` extensions via `--extensions`. Test in a non-critical branch first to confirm coverage.
- How can I integrate this into Laravel’s CI/CD pipeline?
- Add it to your GitHub Actions or GitLab CI as a pre-merge check. Example: `run: ./vendor/bin/var-dump-check --laravel --exclude vendor .`. Set it to fail builds if dumps are found, or use `--no-colors` for cleaner logs.
- Are there false positives with intentional debug calls (e.g., feature flags)?
- Yes, it may flag legitimate debug calls in staging or feature branches. Mitigate this by excluding those directories or using `--exclude` to target only production-relevant paths. Review output carefully before enforcing strict checks.
- What alternatives exist for Laravel debug dump detection?
- Consider PHPStan with the [`phpstan/extension-installer`](https://github.com/phpstan/extension-installer) and custom rules, or Psalm. These modern tools offer IDE integration, broader static analysis, and active maintenance. The abandoned fork at `php-parallel-lint/PHP-Var-Dump-Check` is another option.
- Does this tool support Blade templates (e.g., `@dump`)?
- No, it only scans PHP files by default. To include Blade templates, manually specify `.blade.php` extensions with `--extensions php,blade.php`. Note this may produce false positives in dynamic Blade code.
- How do I handle dependencies like `jakub-onderka/php-parallel-lint`?
- The tool relies on abandoned dependencies, which could introduce instability. Test thoroughly in a staging environment. For long-term use, fork the repo and update dependencies to modern versions compatible with PHP 8.x.
- Can I use this in a Laravel monorepo with multiple apps?
- Yes, but configure `--exclude` to target only the relevant app directories. Run it separately for each app or use a script to aggregate results. Example: `./vendor/bin/var-dump-check --laravel --exclude vendor ./app/Backend ./app/Frontend`.