artur-gajewski/documentor-bundle
app/console). For modern Laravel projects, this requires abstraction or a rewrite to fit Laravel’s Artisan CLI and service container.phpdoc). Laravel’s ecosystem lacks native integration, necessitating CLI bridging or a custom wrapper.php artisan commands).AppKernel, Command namespace) conflicts with Laravel’s architecture. Key challenges:
Artisan uses Illuminate\Console\Command, while the bundle assumes Symfony’s Symfony\Component\Console\Command.ServiceProvider/Package instead of Symfony’s Bundle.assets:install; Laravel uses mix/vite or manual asset publishing.Artisan command.phpdoc directly (bypassing the bundle’s Symfony layer).ContainerInterface vs. Laravel’s Container).config.yml vs. Laravel’s config/ files).composer.json claims MIT). Risk of abandoned dependencies.php artisan doc if available]).phpdoc via shell_exec).phpdoc generation time impact CI pipelines?ServiceProvider with an Artisan command./documentor-package
├── src/
│ ├── Console/DocumentorCommand.php // Extends Illuminate\Console\Command
│ ├── Services/DocumentorService.php // Handles phpdoc CLI calls
├── config/documentor.php // Laravel config
├── README.md
Process facade (Illuminate\Support\Facades\Process) to execute phpdoc.phpdoc as a dev dependency and create a simple Laravel command to proxy calls.// app/Console/Commands/GenerateDocs.php
use Illuminate\Support\Facades\Process;
Process::run('phpdoc -d src -t public/docs');
post-install-cmd or post-update-cmd script in composer.json to auto-generate docs on install/update."scripts": {
"post-install-cmd": [
"@phpdoc -d src -t public/docs"
]
}
phpdoc). Ensure it’s installed globally or via Composer ("require-dev": { "phpdocumentor/phpdocumentor": "^2.0" }).phpdoc image).phpdoc calls, other tools).Artisan command to generate docs.src/ directory).config/app.php and AppServiceProvider.php artisan documentor:generate command.phpdoc workflow in README.md.main branch pushes.phpdoc in a dev container.# .github/workflows/docs.yml
jobs:
generate-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: composer install
- run: phpdoc -d src -t public/docs
- uses: actions/upload-artifact@v3
with:
name: docs
path: public/docs
Console components). Prefer Laravel’s native alternatives.dev environment via Laravel’s whenIs() or manual checks:
if (app()->environment('local', 'testing')) {
Process::run('phpdoc -d src -t public/docs');
}
public/docs directory should be added to .gitignore if auto-generated (unless docs are versioned).mix.copy() or vite.copy() to integrate docs into the build process if needed.phpdocumentor/phpdocumentor via Composer:
composer require-dev phpdocumentor/phpdocumentor
phpdoc is in PATH or use the Composer vendor bin:
./vendor/bin/phpdoc -d src -t public/docs
docs directory to .gitignore (unless versioned).php artisan documentor:generate command (or alias php artisan doc).phpdoc CLI arguments change, the wrapper command must update.How can I help you explore Laravel packages today?