covex-nn/phpcb
PHP Code Beautifier (phpcb) for formatting and cleaning up PHP codebases. Helps apply consistent styling, improve readability, and standardize code output across projects and teams, suitable for use in local workflows or automation.
php artisan phpcb:generate).ArtisanStarting, JobProcessed) for dynamic execution.public/ directory or embedded in a custom admin panel (e.g., using Laravel Mix)..phpcs.xml/.phpmd.xml in Laravel’s config/ directory for version control.php artisan queue:work) for async generation.git diff --name-only) to reduce scope.phpcb be tightly coupled (e.g., Artisan command) or loosely coupled (e.g., CLI wrapper)?phpcb package if issues arise?phpcb (e.g., Docker) for consistent environments?phpcb via a custom command (e.g., php artisan phpcb:scan --path=app/Http).$phpcb = app()->make('covex-nn\PHP_CodeBrowser\CodeBrowser');
$phpcb->setSnifferReport(storage_path('app/sniffer-report.xml'));
$schedule->command('phpcb:generate')->nightly();
phpcb post-deploy or post-QA:
// app/Providers/EventServiceProvider.php
protected $listen = [
'illuminate\queue\JobProcessed' => ['App\Listeners\GenerateCodeBrowser'],
];
route('phpcb') with middleware (e.g., auth).composer require --dev phpcs/phpcs phpmd/phpmd covex-nn/phpcb
.phpcs.xml/.phpmd.xml in config/phpcb.php.app/Console/Commands/GenerateCodeBrowser).AppServiceProvider:
$this->commands([Commands\GenerateCodeBrowser::class]);
- name: Generate Code Browser
run: php artisan phpcb:generate --report=sniffer-report.xml
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: code-browser
path: storage/app/phpcb_output/
Route::get('/phpcb', function () {
return file_get_contents(storage_path('app/phpcb_output/index.html'));
})->middleware('auth');
phpcb:generate vs. phpunit).phpcb_output in storage/app/phpcb_output/ (excluded from Git).| Step | Task | Dependencies | Owner |
|---|---|---|---|
| 1 | Install phpcb, PHP_CodeSniffer, PHPMD |
Composer | Backend |
| 2 | Configure QA rulesets (.phpcs.xml) |
Static analysis standards | QA/Dev |
| 3 | Create custom Artisan command | Laravel CLI | Backend |
| 4 | Integrate into CI/CD (e.g., GitHub Actions) | Pipeline config | DevOps |
| 5 | Serve reports via Laravel route | Web server config | Frontend |
| 6 | Add task scheduling (nightly) | Laravel scheduler | DevOps |
| 7 | Monitor performance (e.g., memory usage) | Profiling tools | SRE |
phpcb or replace with alternatives (e.g., PHPStan Browser)..phpcs.xml.config/phpcb.php.logs/ directory.storage/ is writable.Log::info('PHP_CodeBrowser violations found', ['file' => $file, 'line' => $line]);
docs/phpcb.md with:
GenerateCodeBrowserJob::dispatch($reportPath)->onQueue('phpcb');
--memory=2G.git diff --name-only HEAD~1 | xargs php artisan phpcb:generate
How can I help you explore Laravel packages today?