marekmiklusek / auditor
A package that provides auditing for: dd(), dump(), // FIXME:, // TODO:, and more...
Requires
- php: ^8.3.0
- laravel/framework: ^12.17.0
Requires (Dev)
- larastan/larastan: ^3.4.0
- laravel/pint: ^1.22.1
- pestphp/pest: ^3.8
- rector/rector: ^2.0.17
This package is auto-updated.
Last update: 2025-06-08 16:00:26 UTC
README
๐ Laravel Auditor
A Laravel package that helps you audit your codebase for debugging statements and task-related comments that should not make it to production, such as:
- ๐ฅ
dd()
debug statements - ๐ฎ
dump()
debug statements - โ
// TODO:
comments - ๐ ๏ธ
// FIXME:
comments
๐ Requirements
- PHP 8.3 or higher
- Laravel 12.17 or higher
๐ฅ Installation
You can install the package via Composer:
composer require marekmiklusek/auditor --dev
๐ Usage
๐ Audit Your Code
Run the following command to scan your codebase for debugging statements and task-related comments:
php artisan audit:code
This will scan the following directories for PHP and Blade files:
- ๐ app
- ๐ config
- ๐ database
- ๐ resources
- ๐ routes
- ๐ tests
The command will display a list of all found issues with their file paths, line numbers, and content.
๐ง Fixing Issues
You can automatically remove the detected issues using the --fix
option:
# Remove all detected issues php artisan audit:code --fix=all # Remove only dd() statements php artisan audit:code --fix=dd # Remove only dump() statements php artisan audit:code --fix=dump # Remove only TODO comments php artisan audit:code --fix=todo # Remove only FIXME comments php artisan audit:code --fix=fixme
๐ Example Output
When running the audit command, you'll see output similar to this:
๐ Auditing codebase...
app/Http/Controllers/UserController.php (Line 25): dd($user);
app/Models/Post.php (Line 47): // TODO: Add validation
resources/views/welcome.blade.php (Line 15): {{ dump($data) }}
โ Found 3 issue(s). Run with --fix=all to remove them all.
After fixing:
๐ Auditing codebase...
๐ง Fixed: app/Http/Controllers/UserController.php
๐ง Fixed: app/Models/Post.php
๐ง Fixed: resources/views/welcome.blade.php
๐ง Fixed 3 issue(s).
๐ก Why Use This Package?
- ๐ก๏ธ Code Quality: Prevent debugging code from accidentally being deployed to production
- ๐ Task-Related comments: Keep track of TODOs and FIXMEs comments in your codebase
- ๐ฆ Pre-Deployment Check: Run as part of your CI/CD pipeline to ensure clean code
- ๐งน Simple Cleanup: Easily remove all debugging statements with a single command
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
The MIT License (MIT). Please see License File for more information.