jakub-onderka/php-var-dump-check
Abandoned CLI tool that scans PHP projects for leftover debug dumps (var_dump, print_r, var_export, plus Tracy/Ladybug/Symfony/Laravel/Doctrine/Zend helpers). Supports excludes, extension filtering, and optional colored output via console highlighter.
Installation:
Add to composer.json under require-dev:
"jakub-onderka/php-var-dump-check": "^0.3"
Run composer install.
First Run: Execute in your project root:
./vendor/bin/var-dump-check .
This scans all .php files for forgotten var_dump, var_export, or print_r calls.
Laravel-Specific Scan:
For Laravel projects, use the --laravel flag to detect dd()/dump() calls:
./vendor/bin/var-dump-check --laravel --exclude vendor app/
CI/CD Pipeline:
Add to composer.json scripts:
"scripts": {
"test": [
"@phpunit",
"@var-dump-check"
]
}
Run with composer test.
Pre-Commit Hook: Use with tools like Husky or Git Hooks:
./vendor/bin/var-dump-check --laravel --exclude vendor app/
IDE Integration:
File > Settings > Inspections > Custom Scopes.tasks.json) to trigger the check on save.Team Onboarding:
Document the check in CONTRIBUTING.md or README.md as a mandatory step for new developers.
dd() calls:
./vendor/bin/var-dump-check --laravel app/Http/Controllers/
--symfony, --tracy, or --doctrine flags for framework-specific debug tools:
./vendor/bin/var-dump-check --symfony --exclude vendor .
./vendor/bin/var-dump-check --laravel app/Models/User.php
False Positives:
debug() methods).tests/ or DebugHelper.php:
./vendor/bin/var-dump-check --exclude tests/ --exclude app/Helpers/DebugHelper.php app/
Performance:
vendor/ or monorepos may be slow. Use --extensions php to limit file types.jakub-onderka/php-parallel-lint (though this package is abandoned; use alternatives like php-parallel-lint/PHP-Var-Dump-Check).Framework-Specific Quirks:
--laravel flag misses dd() calls inside closures or dynamic function calls (e.g., $callback()).dump() calls in Twig templates or service container configs.Abandoned Package:
php-parallel-lint/PHP-Var-Dump-Check (active fork).dealerdirect/phpcodesniffer-composer with custom rules.Verbose Output:
Use --no-colors to parse logs programmatically:
./vendor/bin/var-dump-check --laravel --no-colors app/ | grep "dump found"
Custom Patterns:
Extend functionality by modifying the source (e.g., add support for Xdebug::dump()).
Exclusion Strategies:
./vendor/bin/var-dump-check --exclude {vendor,tests,storage/*} app/
.php files only:
./vendor/bin/var-dump-check --extensions php app/
Custom Debug Functions: Add support for new debug tools by:
JakubOnderka\VarDumpCheck\VarDumpCheck.--custom flag to accept regex patterns for function names.Integration with PHPStan/Nikic: Combine with static analyzers for deeper checks:
./vendor/bin/phpstan analyse app/ --level=5
./vendor/bin/var-dump-check --laravel app/
Git Integration:
Use with git diff to check only modified files:
git diff --name-only HEAD~1 | xargs ./vendor/bin/var-dump-check --laravel
How can I help you explore Laravel packages today?